Transactional Templates Versions
Represents the code for a particular transactional template. Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates.
For more information about transactional templates, please see our Transactional Templates documentation. You can also manage your Transactional Templates in the Dynamic Templates section of the Twilio SendGrid App.
Create a new transactional template version.
POST /v3/templates/{template_id}/versions
Base url: https://api.sendgrid.com
This endpoint allows you to create a new version of a template.
Authentication
- API Key
Headers
The on-behalf-of
header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be "account-id" followed by the customer account's ID (e.g., on-behalf-of: account-id <account-id>
). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., on-behalf-of: <subuser-username>
). See On Behalf Of for more information.
Request Body
Set the version as the active version associated with the template (0 is inactive, 1 is active). Only one version of a template can be active. The first version created for a template will automatically be set to Active.
Allowed Values: 0, 1Name of the transactional template version.
maxLength: 100The HTML content of the version. Maximum of 1048576 bytes allowed.
maxLength: 1048576Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed.
default: <generated from html_content if left empty>maxLength: 1048576If true, plain_content is always generated from html_content. If false, plain_content is not altered.
default: TrueSubject of the new transactional template version.
maxLength: 255The editor used in the UI.
Allowed Values: code, designFor dynamic templates only, the mock json data that will be used for template preview and test sends.
{
"template_id": "Excepteur Ut qui",
"active": 1,
"name": "pariatur non incididunt commodo",
"html_content": "dolor",
"generate_plain_content": false,
"subject": "aliquip nulla Ut",
"editor": "design",
"plain_content": "labore dolore"
}
Path Parameters
Responses
Warning message for the user
Set the version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active.
Allowed Values: 0, 1Name of the transactional template version.
maxLength: 100The HTML content of the version. Maximum of 1048576 bytes allowed.
maxLength: 1048576Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed.
default: <generated from html_content if left empty>maxLength: 1048576If true, plain_content is always generated from html_content. If false, plain_content is not altered.
default: TrueSubject of the new transactional template version.
maxLength: 255The editor used in the UI.
Allowed Values: code, designFor dynamic templates only, the mock json data that will be used for template preview and test sends.
ID of the transactional template version.
format: uuidID of the transactional template.
The date and time that this transactional template version was updated.
A Thumbnail preview of the template's html content.
{
"template_id": "Excepteur Ut qui",
"active": 1,
"name": "pariatur non incididunt commodo",
"html_content": "dolor",
"generate_plain_content": false,
"subject": "aliquip nulla Ut",
"editor": "design",
"plain_content": "labore dolore"
}
Need some help?
We all do sometimes. Get help now from the Twilio SendGrid Support Team.
Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.