Create a new template
Creates a new message template with header, body, footer, and buttons. The template can be submitted for review immediately or saved as draft for later submission.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://api.sent.dm/v3/templates" \ -H "Idempotency-Key: req_abc123_retry1" \ -H "Content-Type: application/json" \ -d '{ "category": "MARKETING", "language": "en_US", "definition": { "header": null, "body": { "multiChannel": { "type": null, "template": "Hello {{0:variable}}! Welcome to {{1:variable}}.", "variables": [ { "id": 0, "name": "name", "type": "variable", "props": { "variableType": "text", "sample": "John", "regex": null, "url": null, "shortUrl": null, "alt": null, "mediaType": null } }, { "id": 1, "name": "company", "type": "variable", "props": { "variableType": "text", "sample": "SentDM", "regex": null, "url": null, "shortUrl": null, "alt": null, "mediaType": null } } ] }, "sms": null, "whatsapp": null }, "footer": null, "buttons": null, "definitionVersion": "1.0", "authenticationConfig": null }, "creation_source": null, "submit_for_review": false, "sandbox": false }'{
"success": true,
"data": {
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"name": "Welcome Message",
"category": "MARKETING",
"language": "en_US",
"status": "DRAFT",
"channels": [
"sms",
"whatsapp"
],
"variables": [
"name",
"company"
],
"created_at": "2026-03-31T15:21:52.0570209+00:00",
"updated_at": "2026-03-31T15:21:52.0570288+00:00",
"is_published": false
},
"error": null,
"meta": {
"request_id": "req_7X9zKp2jDw",
"timestamp": "2026-03-31T15:21:52.0570434+00:00",
"version": "v3"
}
}{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_001",
"message": "Template definition is required",
"details": {
"definition": [
"Template definition is required"
]
},
"doc_url": "https://docs.sent.dm/docs/reference/api/error-catalog"
},
"meta": {
"request_id": "req_7X9zKp2jDw",
"timestamp": "2026-03-31T15:21:52.0570462+00:00",
"version": "v3"
}
}{
"success": false,
"data": null,
"error": {
"code": "INTERNAL_001",
"message": "An unexpected error occurred while creating the template",
"details": null,
"doc_url": "https://docs.sent.dm/docs/reference/api/error-catalog"
},
"meta": {
"request_id": "req_7X9zKp2jDw",
"timestamp": "2026-03-31T15:21:52.0570469+00:00",
"version": "v3"
}
}