PUT/forms/{formId}/templates/{kind}

Write a form's email template

Replaces or creates an email template for a form. Send code, subject, or both; omitted fields keep their current values, and creating an autoresponder template switches the autoresponder on. Writing code replaces a visual-editor layout and cannot be undone.

2 parameters · 2 body fields
formIdstringrequired
The identifier of the form whose template you want to write. Must contain at least one character.
kindstringrequired
The template type to write: `notification` or `autoresponder`.
Allowed:notificationautoresponder

Template content and subject. Send code, subject, or both; omitted fields keep their current values. A template body is needed when creating a template.

codestringoptional
The template body: HTML with Handlebars placeholders, where the submission is reachable as {{data.<field>}}. Styling has to be inline, since no separate stylesheet is sent. Writing this replaces whatever the template held, including a layout built in the visual editor. Required when the form has no template of this kind yet; leave it out to keep the current body.
subjectstringoptional
The subject line, with the same Handlebars placeholders as the body. Leave it out to keep the current subject; send null or an empty string to clear it and use the default subject.

9 status codes
200Returns the template as it now stands, including its body, kind, editing mode, paused status, subject, and last-updated timestamp.
codestringrequired
kindstringrequired
Allowed:notificationautoresponder
modestringrequired
Whether the template is laid out in the visual editor or written as code. Writing code to a visual template replaces its layout and cannot be undone.
Allowed:visualcode
pausedbooleanrequired
Whether our content check has stopped this template from sending. A paused notification template sends no notifications at all, and a paused autoresponder template sends no replies. Submissions are still stored either way. Writing the template checks the new version before this response returns.
subjectstringrequired
The subject line as written, placeholders included, or null when the template has none and the email uses the default subject.
updatedAtstringrequired
400Returned when the request is malformed or fails validation.
codestringrequired
detailstringrequired
statusnumberrequired
titlestringrequired
typestringrequired
401Returned when the token is missing, malformed, revoked, or expired.
codestringrequired
detailstringrequired
statusnumberrequired
titlestringrequired
typestringrequired
403Returned when the token lacks the required scope, the workspace is not upgraded, or a limit has been reached.
codestringrequired
detailstringrequired
statusnumberrequired
titlestringrequired
typestringrequired
404Returned when the requested resource does not exist.
codestringrequired
detailstringrequired
statusnumberrequired
titlestringrequired
typestringrequired
409Returned when custom notification templates are switched off.
codestringrequired
detailstringrequired
statusnumberrequired
titlestringrequired
typestringrequired
429Returned when the caller is rate limited and should retry later.
codestringrequired
detailstringrequired
statusnumberrequired
titlestringrequired
typestringrequired
500Returned when something goes wrong on the service's end.
codestringrequired
detailstringrequired
statusnumberrequired
titlestringrequired
typestringrequired
503Returned when the template service is unavailable; retry shortly.
codestringrequired
detailstringrequired
statusnumberrequired
titlestringrequired
typestringrequired

Error handling

A 400 is returned for malformed requests or validation failures; a 401 is returned when the token is missing, malformed, revoked, or expired; a 403 is returned when the token lacks the required scope, the workspace is not upgraded, or a limit is reached; and a 404 is returned when the resource does not exist. A 409 means custom notification templates are switched off; a 429 means the caller is rate limited; a 500 indicates an error on the service's end; and a 503 means the template service is unavailable. The formId path parameter must contain at least one character, and the kind path parameter must be notification or autoresponder. code must be 1–262144 characters when supplied, and subject must not exceed 998 characters; send null or an empty string for subject to clear it.