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.

POST
/v3/templates

Header Parameters

Idempotency-Key?string

Unique key to ensure idempotent request processing. Must be 1-255 alphanumeric characters, hyphens, or underscores. Responses are cached for 24 hours per key per customer.

Match^[a-zA-Z0-9_-]+$
Lengthlength <= 255
x-profile-id?string

Profile UUID to scope the request to a child profile. Only organization API keys can use this header. The profile must belong to the calling organization.

Formatuuid

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-11T21:50:49.7921353+00:00",
    "updated_at": "2026-03-11T21:50:49.7921546+00:00",
    "is_published": false
  },
  "error": null,
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-03-11T21:50:49.7921876+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/errors/VALIDATION_001"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-03-11T21:50:49.7921907+00:00",
    "version": "v3"
  }
}
Empty
Empty
{
  "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/errors/INTERNAL_001"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-03-11T21:50:49.792191+00:00",
    "version": "v3"
  }
}