Email & SMS templates allow you to customize the theming and wording of emails & SMS messages that are sent by your instance.
Returns a list of all templates. The templates are returned sorted by position.
Success
Request was not successful
Authentication invalid
Invalid request parameters
[- {
- "id": "string",
- "object": "template",
- "instance_id": "string",
- "resource_type": "string",
- "template_type": "string",
- "name": "string",
- "slug": "string",
- "position": 0,
- "can_revert": true,
- "can_delete": true,
- "can_toggle": true,
- "subject": "string",
- "markup": "string",
- "body": "string",
- "available_variables": [
- "string"
], - "required_variables": [
- "string"
], - "from_email_name": "string",
- "reply_to_email_name": "string",
- "delivered_by_clerk": true,
- "enabled": true,
- "updated_at": 0,
- "created_at": 0
}
]
Returns the details of a template
Success
Request was not successful
Authentication invalid
Resource not found
{- "id": "string",
- "object": "template",
- "instance_id": "string",
- "resource_type": "string",
- "template_type": "string",
- "name": "string",
- "slug": "string",
- "position": 0,
- "can_revert": true,
- "can_delete": true,
- "can_toggle": true,
- "subject": "string",
- "markup": "string",
- "body": "string",
- "available_variables": [
- "string"
], - "required_variables": [
- "string"
], - "from_email_name": "string",
- "reply_to_email_name": "string",
- "delivered_by_clerk": true,
- "enabled": true,
- "updated_at": 0,
- "created_at": 0
}
Updates the existing template of the given type and slug
name | string The user-friendly name of the template |
subject | string or null The email subject. Applicable only to email templates. |
markup | string or null The editor markup used to generate the body of the template |
body | string The template body before variable interpolation |
delivered_by_clerk | boolean or null Whether Clerk should deliver emails or SMS messages based on the current template |
from_email_name | string The local part of the From email address that will be used for emails. For example, in the address 'hello@example.com', the local part is 'hello'. Applicable only to email templates. |
reply_to_email_name | string The local part of the Reply To email address that will be used for emails. For example, in the address 'hello@example.com', the local part is 'hello'. Applicable only to email templates. |
Success
Request was not successful
Authentication invalid
Payment required
Request was not successful
Resource not found
Invalid request parameters
{- "name": "string",
- "subject": "string",
- "markup": "string",
- "body": "string",
- "delivered_by_clerk": true,
- "from_email_name": "string",
- "reply_to_email_name": "string"
}
{- "id": "string",
- "object": "template",
- "instance_id": "string",
- "resource_type": "string",
- "template_type": "string",
- "name": "string",
- "slug": "string",
- "position": 0,
- "can_revert": true,
- "can_delete": true,
- "can_toggle": true,
- "subject": "string",
- "markup": "string",
- "body": "string",
- "available_variables": [
- "string"
], - "required_variables": [
- "string"
], - "from_email_name": "string",
- "reply_to_email_name": "string",
- "delivered_by_clerk": true,
- "enabled": true,
- "updated_at": 0,
- "created_at": 0
}
Reverts an updated template to its default state
Success
Request was not successful
Authentication invalid
Payment required
Resource not found
{- "id": "string",
- "object": "template",
- "instance_id": "string",
- "resource_type": "string",
- "template_type": "string",
- "name": "string",
- "slug": "string",
- "position": 0,
- "can_revert": true,
- "can_delete": true,
- "can_toggle": true,
- "subject": "string",
- "markup": "string",
- "body": "string",
- "available_variables": [
- "string"
], - "required_variables": [
- "string"
], - "from_email_name": "string",
- "reply_to_email_name": "string",
- "delivered_by_clerk": true,
- "enabled": true,
- "updated_at": 0,
- "created_at": 0
}
Returns a preview of a template for a given template_type, slug and body
Required parameters
subject | string or null The email subject. Applicable only to email templates. |
body | string The template body before variable interpolation |
from_email_name | string The local part of the From email address that will be used for emails. For example, in the address 'hello@example.com', the local part is 'hello'. Applicable only to email templates. |
reply_to_email_name | string The local part of the Reply To email address that will be used for emails. For example, in the address 'hello@example.com', the local part is 'hello'. Applicable only to email templates. |
OK
Request was not successful
Authentication invalid
Resource not found
Invalid request parameters
{- "subject": "string",
- "body": "string",
- "from_email_name": "string",
- "reply_to_email_name": "string"
}
{ }
Toggles the delivery by Clerk for a template of a given type and slug.
If disabled, Clerk will not deliver the resulting email or SMS.
The app developer will need to listen to the email.created
or sms.created
webhooks in order to handle delivery themselves.
Success
Request was not successful
Authentication invalid
Resource not found
{- "delivered_by_clerk": true
}
{- "id": "string",
- "object": "template",
- "instance_id": "string",
- "resource_type": "string",
- "template_type": "string",
- "name": "string",
- "slug": "string",
- "position": 0,
- "can_revert": true,
- "can_delete": true,
- "can_toggle": true,
- "subject": "string",
- "markup": "string",
- "body": "string",
- "available_variables": [
- "string"
], - "required_variables": [
- "string"
], - "from_email_name": "string",
- "reply_to_email_name": "string",
- "delivered_by_clerk": true,
- "enabled": true,
- "updated_at": 0,
- "created_at": 0
}