Create a new email template with HTML content and design settings using the AutoSend API.
curl --request POST \
--url https://api.autosend.com/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"templateName": "Welcome Email",
"description": "Welcome email for new users",
"subject": "Welcome to {{companyName}}, {{firstName}}!",
"previewText": "We are glad to have you on board",
"emailTemplate": "<h1>Welcome, {{firstName}}!</h1><p>Thanks for joining {{companyName}}.</p>",
"templateType": "transactional",
"builderType": "code"
}'
{
"success": true,
"data": {
"templateId": "A-abc123def456ghi789jk",
"templateName": "Welcome Email",
"description": "Welcome email for new users",
"subject": "Welcome to {{companyName}}, {{firstName}}!",
"previewText": "We are glad to have you on board",
"emailTemplate": "<h1>Welcome, {{firstName}}!</h1><p>Thanks for joining {{companyName}}.</p>",
"templateType": "transactional",
"builderType": "code",
"createdAt": "2026-03-17T10:30:00.000Z",
"updatedAt": "2026-03-17T10:30:00.000Z"
}
}
curl --request POST \
--url https://api.autosend.com/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"templateName": "Welcome Email",
"description": "Welcome email for new users",
"subject": "Welcome to {{companyName}}, {{firstName}}!",
"previewText": "We are glad to have you on board",
"emailTemplate": "<h1>Welcome, {{firstName}}!</h1><p>Thanks for joining {{companyName}}.</p>",
"templateType": "transactional",
"builderType": "code"
}'
{
"success": true,
"data": {
"templateId": "A-abc123def456ghi789jk",
"templateName": "Welcome Email",
"description": "Welcome email for new users",
"subject": "Welcome to {{companyName}}, {{firstName}}!",
"previewText": "We are glad to have you on board",
"emailTemplate": "<h1>Welcome, {{firstName}}!</h1><p>Thanks for joining {{companyName}}.</p>",
"templateType": "transactional",
"builderType": "code",
"createdAt": "2026-03-17T10:30:00.000Z",
"updatedAt": "2026-03-17T10:30:00.000Z"
}
}
<token>, where <token> is your auth token.90Example: "Welcome Email"988Example: "Welcome to {{companyName}}, {{firstName}}!"140Example: "Welcome email for new users"140Example: "We are glad to have you on board"{{variableName}}.Example:<h1>Welcome, {{firstName}}!</h1>
<p>Thanks for joining {{companyName}}.</p>
dynamicData field when sending emails using this template.transactional, marketingDefault: "transactional"Example: "transactional"code, visualDefault: "code"Example: "code"{
"firstName": "string",
"companyName": "string"
}
"60d5ec49f1b2c72d9c8b4567"trueShow child attributes
"A-abc123def456ghi789jk""Welcome Email""Welcome email for new users""Welcome to {{companyName}}, {{firstName}}!""We are glad to have you on board""transactional""code""2026-03-17T10:30:00.000Z""2026-03-17T10:30:00.000Z"curl --request POST \
--url https://api.autosend.com/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"templateName": "Welcome Email",
"description": "Welcome email for new users",
"subject": "Welcome to {{companyName}}, {{firstName}}!",
"previewText": "We are glad to have you on board",
"emailTemplate": "<h1>Welcome, {{firstName}}!</h1><p>Thanks for joining {{companyName}}.</p>",
"templateType": "transactional",
"builderType": "code"
}'
{
"success": true,
"data": {
"templateId": "A-abc123def456ghi789jk",
"templateName": "Welcome Email",
"description": "Welcome email for new users",
"subject": "Welcome to {{companyName}}, {{firstName}}!",
"previewText": "We are glad to have you on board",
"emailTemplate": "<h1>Welcome, {{firstName}}!</h1><p>Thanks for joining {{companyName}}.</p>",
"templateType": "transactional",
"builderType": "code",
"createdAt": "2026-03-17T10:30:00.000Z",
"updatedAt": "2026-03-17T10:30:00.000Z"
}
}