Create a new template with enhanced metadata and optional submission for review

Creates a new message template for the authenticated customer with comprehensive template definitions including headers, body, footer, and interactive buttons. Supports automatic metadata generation using AI (display name, language, category). Optionally submits the template for WhatsApp review. The customer ID is extracted from the authentication token.

POST
/v2/templates

Header Parameters

x-sender-idstring
Formatguid
x-api-keystring
category?string|null

The template category (e.g., MARKETING, UTILITY, AUTHENTICATION). Can only be set when creating a new template. If not provided, will be auto-generated using AI.

language?string|null

The template language code (e.g., en_US, es_ES). Can only be set when creating a new template. If not provided, will be auto-detected using AI.

definition

Template definition containing header, body, footer, and buttons

submitForReview?boolean

When false, the template will be saved as draft. When true, the template will be submitted for review.

Response Body

application/json

curl -X POST "https://api.sent.dm/v2/templates" \  -H "x-sender-id: string" \  -H "x-api-key: string" \  -H "Content-Type: application/json" \  -d '{    "category": "MARKETING",    "language": "en_US",    "definition": {      "header": {        "type": "text",        "template": "Welcome to {{1:variable}}!",        "variables": [          {            "id": 1,            "name": "companyName",            "type": "variable",            "props": {              "variableType": "text",              "sample": "SentDM",              "url": null,              "shortUrl": null,              "alt": null,              "mediaType": null            }          }        ]      },      "body": {        "multiChannel": {          "type": null,          "template": "Hello {{1:variable}}, thank you for joining our service. We\'re excited to help you with your messaging needs!",          "variables": [            {              "id": 1,              "name": "customerName",              "type": "variable",              "props": {                "variableType": "text",                "sample": "John Doe",                "url": null,                "shortUrl": null,                "alt": null,                "mediaType": null              }            }          ]        },        "sms": null,        "whatsapp": null      },      "footer": {        "type": "text",        "template": "Best regards, The SentDM Team",        "variables": null      },      "buttons": null,      "definitionVersion": "1.0"    },    "submitForReview": false  }'
{
  "id": "string",
  "displayName": "string",
  "category": "string",
  "language": "string",
  "definition": {
    "header": {
      "type": "string",
      "template": "string",
      "variables": [
        {
          "id": 0,
          "name": "string",
          "type": "string",
          "props": {
            "variableType": "string",
            "sample": "string",
            "url": "string",
            "shortUrl": "string",
            "alt": "string",
            "mediaType": "string"
          }
        }
      ]
    },
    "body": {
      "multiChannel": {
        "type": "string",
        "template": "string",
        "variables": [
          {
            "id": 0,
            "name": "string",
            "type": "string",
            "props": {
              "variableType": "string",
              "sample": "string",
              "url": "string",
              "shortUrl": "string",
              "alt": "string",
              "mediaType": "string"
            }
          }
        ]
      },
      "sms": {
        "type": "string",
        "template": "string",
        "variables": [
          {
            "id": 0,
            "name": "string",
            "type": "string",
            "props": {
              "variableType": "string",
              "sample": "string",
              "url": "string",
              "shortUrl": "string",
              "alt": "string",
              "mediaType": "string"
            }
          }
        ]
      },
      "whatsapp": {
        "type": "string",
        "template": "string",
        "variables": [
          {
            "id": 0,
            "name": "string",
            "type": "string",
            "props": {
              "variableType": "string",
              "sample": "string",
              "url": "string",
              "shortUrl": "string",
              "alt": "string",
              "mediaType": "string"
            }
          }
        ]
      }
    },
    "footer": {
      "type": "string",
      "template": "string",
      "variables": [
        {
          "id": 0,
          "name": "string",
          "type": "string",
          "props": {
            "variableType": "string",
            "sample": "string",
            "url": "string",
            "shortUrl": "string",
            "alt": "string",
            "mediaType": "string"
          }
        }
      ]
    },
    "buttons": [
      {
        "id": 0,
        "type": "string",
        "props": {
          "text": "string",
          "quickReplyType": "string",
          "urlType": "string",
          "url": "string",
          "activeFor": 0,
          "countryCode": "string",
          "phoneNumber": "string",
          "offerCode": "string"
        }
      }
    ],
    "definitionVersion": "string"
  },
  "status": "string",
  "isPublished": true,
  "whatsappTemplateId": "string",
  "whatsappTemplateName": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
Empty
Empty