# Notification Templates API

The Notification Templates API provides programmatic access to manage email templates for Access Reviews, Lifecycle Management, and Access Security notifications. Use the API for automation, bulk template management, or integration with existing workflows.

{% hint style="info" %}
**For template customization guidance**: See [Notification Templates](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/administration/administration/notifications/email-templates) in the Administration section for concepts, placeholders, and how-to guides.
{% endhint %}

## Overview

The API enables you to:

* Create custom email templates with HTML content and images
* List and retrieve existing templates
* Update template content and attachments
* Test templates before deployment
* Delete templates to revert to defaults

## API endpoints

| Operation       | Method | Endpoint                                                   |
| --------------- | ------ | ---------------------------------------------------------- |
| List templates  | GET    | `/api/preview/notifications/email_templates`               |
| Create template | POST   | `/api/preview/notifications/email_templates`               |
| Get template    | GET    | `/api/preview/notifications/email_templates/{id}`          |
| Update template | PUT    | `/api/preview/notifications/email_templates/{value.id}`    |
| Delete template | DELETE | `/api/preview/notifications/email_templates/{id}`          |
| Test template   | POST   | `/api/preview/notifications/email_templates:test_template` |

See [Notification Templates API Reference](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/notification-templates/email-templates-api) for complete endpoint documentation, request examples, and response schemas.

## Authentication

These endpoints require an API key with appropriate permissions. See [API Authentication](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/authentication) for details.

## Template usage types

Each template is associated with a notification event type (`usage`). One custom template can exist per usage type.

### Access Reviews

| Usage Value                                  | Notification Event   |
| -------------------------------------------- | -------------------- |
| `ACCESS_WORKFLOW_STARTED`                    | Review started       |
| `ACCESS_WORKFLOW_COMPLETED`                  | Review completed     |
| `ACCESS_WORKFLOW_REVIEWER_CHANGED`           | Reviewer reassigned  |
| `ACCESS_WORKFLOW_OWNER_CHANGED`              | Owner changed        |
| `ACCESS_WORKFLOW_REMINDER_NO_ACTIVITY`       | No activity reminder |
| `ACCESS_WORKFLOW_REMINDER_DUE`               | Due date reminder    |
| `ACCESS_WORKFLOW_DIGEST_NOTIFICATION`        | Digest summary       |
| `ACCESS_WORKFLOW_REVIEW_ALERT`               | Review alert         |
| `ACCESS_WORKFLOW_ROW_ACCEPTED_AND_SIGNEDOFF` | Row approved         |
| `ACCESS_WORKFLOW_ROW_REJECTED_AND_SIGNEDOFF` | Row rejected         |

### Lifecycle Management

See [LCM Notification Templates](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/features/lifecycle-management/policies-workflows/lifecycle-management-notification-templates) for usage types.

### Access Security

| Usage Value       | Notification Event   |
| ----------------- | -------------------- |
| `ASSESSMENT_RULE` | Rule-triggered alert |
| `ASSESSMENT_RISK` | Risk notification    |

## Quick start

Create a custom template:

```bash
curl "https://{{VEZA_URL}}/api/preview/notifications/email_templates" \
  -H "Authorization: Bearer $VEZA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "value": {
      "name": "Custom Reminder",
      "subject_template": "Review {{WORKFLOW_NAME}} needs attention",
      "body_template_base64": "<base64-encoded HTML>",
      "usage": "ACCESS_WORKFLOW_REMINDER_DUE"
    }
  }'
```

See [Notification Templates API Reference](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/notification-templates/email-templates-api) for complete examples.

## Related documentation

* [Notification Templates](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/administration/administration/notifications/email-templates) - Template concepts, placeholders, and customization guides
* [Placeholders Reference](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/administration/administration/notifications/email-templates/placeholders-reference) - Complete placeholder documentation
* [Customizing Templates](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/administration/administration/notifications/email-templates/customizing-templates) - Step-by-step customization guide
