POST
/templates/{template_type}/{slug}/previewDeprecatedPreview changes to a template
Returns a preview of a template using the specified template type, slug, and optional body values. Use the body fields to preview changes; subject, from_email_name, and reply_to_email_name apply only to email templates.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
template_typestringrequired
The type of template to preview.
slugstringrequired
The slug identifying the template to preview.
Optional template values to use when generating the preview.
subjectstringoptional
The email subject.
Applicable only to email templates.
bodystringoptional
The template body before variable interpolation
from_email_namestringoptional
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_namestringoptional
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.
200Returns a preview result object for the specified template and supplied values.
400Returned when the request is unsuccessful.
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
401Returned when authentication is invalid.
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
404Returned when the template resource is not found.
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
422Returned when request parameters are invalid.
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
Error handling
A 400 is returned when the request is unsuccessful, and a 401 is returned when authentication is invalid. A 404 is returned when the template resource is not found, and a 422 is returned when request parameters are invalid. The template_type path parameter and slug path parameter identify the template; subject, from_email_name, and reply_to_email_name apply only to email templates.