POST/templates/{template_type}/{slug}/toggle_deliveryDeprecated

Toggle the delivery by Clerk for a template of a given type and slug

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.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters · 1 body field
template_typestringrequired
The type of template to toggle delivery for
Allowed:emailsms
slugstringrequired
The slug of the template for which to toggle delivery
delivered_by_clerkbooleanoptional
Whether Clerk should deliver emails or SMS messages based on the current template

6 status codes
200Success
idstringoptional
objectstringoptional
String representing the object's type. Objects of the same type share the same value.
Allowed:template
instance_idstringoptional
The ID of the instance to which the template belongs
resource_typestringoptional
whether this is a system (default) or user overridden) template
template_typestringoptional
whether this is an email or SMS template
namestringoptional
user-friendly name of the template
slugstringoptional
machine-friendly name of the template
positionintegeroptional
position with the listing of templates
can_revertbooleanoptional
whether this template can be reverted to the corresponding system default
can_deletebooleanoptional
whether this template can be deleted
can_edit_bodybooleanoptional
whether the body of this template can be edited
can_togglebooleanoptional
whether this template can be enabled or disabled, true only for notification SMS templates
subjectstringoptional
email subject
markupstringoptional
the editor markup used to generate the body of the template
bodystringoptional
the template body before variable interpolation
available_variablesarray<string>optional
list of variables that are available for use in the template body
required_variablesarray<string>optional
list of variables that must be contained in the template body
from_email_namestringoptional
reply_to_email_namestringoptional
delivered_by_clerkbooleanoptional
enabledbooleanoptional
flagged_as_suspiciousbooleanoptional
updated_atintegeroptional
Unix timestamp of last update.
created_atintegeroptional
Unix timestamp of creation.
400Request was not successful
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
401Authentication invalid
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
404Resource not found
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
423Locked
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
429Too many requests
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional

Error handling

A 400 is returned: Request was not successful. A 401 is returned: Authentication invalid. A 404 is returned: Resource not found. A 423 is returned: Locked. A 429 is returned: Too many requests.