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. There is no name field on create — the display name is derived from the template's content and can be changed afterwards with PUT /v3/templates/{id}.

POST
/v3/templates

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://example.com/v3/templates" \  -H "Idempotency-Key: req_abc123_retry1" \  -H "Content-Type: application/json" \  -d '{    "category": "MARKETING",    "language": "en_US",    "definition": {      "body": {        "multiChannel": {          "type": "text",          "template": "Hello {{0:variable}}! Welcome to {{1:variable}}. We are glad to have you on board.",          "variables": [            {              "id": 0,              "name": "name",              "type": "variable",              "props": {                "variableType": "text",                "sample": "John"              }            },            {              "id": 1,              "name": "company",              "type": "variable",              "props": {                "variableType": "text",                "sample": "SentDM"              }            }          ]        }      },      "definitionVersion": "1.0"    },    "submit_for_review": false,    "sandbox": false  }'
{
  "success": true,
  "data": {
    "id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
    "customer_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "Welcome Message",
    "category": "MARKETING",
    "auto_reply_action": null,
    "language": "en_US",
    "status": "DRAFT",
    "channels": [
      "sms",
      "whatsapp",
      "rcs"
    ],
    "variables": [
      "name",
      "company"
    ],
    "created_at": "2026-09-24T12:16:28.0044736+00:00",
    "updated_at": "2026-09-24T12:16:28.0044812+00:00",
    "is_published": false
  },
  "error": null,
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-09-24T12:16:28.004508+00:00",
    "version": "v3"
  }
}
{
  "success": false,
  "data": null,
  "error": {
    "code": "VALIDATION_004",
    "message": "A required field is missing",
    "details": {
      "definition": [
        "Template definition is required"
      ]
    },
    "doc_url": "https://docs.sent.dm/reference/api/error-catalog"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-09-24T12:16:28.0045125+00:00",
    "version": "v3"
  }
}
Empty
Empty
{
  "success": false,
  "data": null,
  "error": {
    "code": "INTERNAL_001",
    "message": "Failed to create template",
    "details": null,
    "doc_url": "https://docs.sent.dm/reference/api/error-catalog"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-09-24T12:16:28.0045132+00:00",
    "version": "v3"
  }
}