Legacy API Notice: This documentation covers the Legacy Sent API (v2). While this API remains fully supported, we recommend new integrations use the latest Sent API v3 for enhanced features, improved performance, and long-term support.

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

Request Body

application/json
  1. body

Request to create a new message template with comprehensive metadata

category?|

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?|

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

Success

application/json
  1. response

Represents a message template with comprehensive metadata including definition structure

id?string

The unique identifier of the template

Formatuuid
displayName?string

The display name of the template (auto-generated if not provided)

category?string

The template category (e.g., MARKETING, UTILITY, AUTHENTICATION)

language?string

The template language code (e.g., en_US, es_ES)

definition?

The complete template definition including header, body, footer, and buttons

status?string

The approval status of the template (e.g., APPROVED, PENDING, REJECTED, DRAFT)

isPublished?boolean

Indicates whether the template is published and available for use

whatsappTemplateId?string

The WhatsApp Business API template ID from Meta

whatsappTemplateName?string

The WhatsApp template name as registered with Meta

createdAt?string

The date and time when the template was created

Formatdate-time
updatedAt?|

The date and time when the template was last updated

Formatdate-time
Example Request
curl -X POST 'https://api.sent.dm/v2/templates' \  -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",            "regex": null,            "url": null,            "shortUrl": null,            "alt": null,            "mediaType": null          }        }      ],      "example_url": null,      "static_resource": false,      "location": null    },    "body": {      "multiChannel": {        "type": "text",        "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",              "regex": null,              "url": null,              "shortUrl": null,              "alt": null,              "mediaType": null            }          }        ]      },      "sms": null,      "whatsapp": null,      "rcs": null,      "mms": null    },    "footer": {      "type": "text",      "template": "Best regards, The SentDM Team",      "variables": null    },    "buttons": null,    "definitionVersion": "1.0",    "authenticationConfig": null  },  "submitForReview": false}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "displayName": "string",  "category": "string",  "language": "string",  "definition": {    "header": {      "type": "string",      "template": "string",      "variables": [        {          "id": 0,          "name": "string",          "type": "string",          "props": {            "variableType": "string",            "sample": "string",            "regex": "string",            "url": "string",            "shortUrl": "string",            "alt": "string",            "mediaType": "string"          }        }      ],      "example_url": "string",      "static_resource": true,      "location": {        "latitude": "string",        "longitude": "string",        "name": "string",        "address": "string"      }    },    "body": {      "multiChannel": {        "type": "string",        "template": "string",        "variables": [          {            "id": 0,            "name": "string",            "type": "string",            "props": {              "variableType": "string",              "sample": "string",              "regex": "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",              "regex": "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",              "regex": "string",              "url": "string",              "shortUrl": "string",              "alt": "string",              "mediaType": "string"            }          }        ]      },      "rcs": {        "type": "string",        "template": "string",        "variables": [          {            "id": 0,            "name": "string",            "type": "string",            "props": {              "variableType": "string",              "sample": "string",              "regex": "string",              "url": "string",              "shortUrl": "string",              "alt": "string",              "mediaType": "string"            }          }        ]      },      "mms": {        "type": "string",        "template": "string",        "variables": [          {            "id": 0,            "name": "string",            "type": "string",            "props": {              "variableType": "string",              "sample": "string",              "regex": "string",              "url": "string",              "shortUrl": "string",              "alt": "string",              "mediaType": "string"            }          }        ],        "subject": "string",        "media": [          {            "url": "string",            "mediaType": "string"          }        ]      }    },    "footer": {      "type": "string",      "template": "string",      "variables": [        {          "id": 0,          "name": "string",          "type": "string",          "props": {            "variableType": "string",            "sample": "string",            "regex": "string",            "url": "string",            "shortUrl": "string",            "alt": "string",            "mediaType": "string"          }        }      ]    },    "buttons": [      {        "id": 0,        "type": "string",        "props": {          "text": "string",          "quickReplyType": "string",          "urlType": "string",          "url": "string",          "variables": [            {              "id": 0,              "name": "string",              "type": "string",              "props": {                "variableType": "string",                "sample": "string",                "regex": "string",                "url": "string",                "shortUrl": "string",                "alt": "string",                "mediaType": "string"              }            }          ],          "activeFor": 1,          "countryCode": "string",          "phoneNumber": "string",          "offerCode": "string",          "otpType": "string",          "autofillText": "string",          "packageName": "string",          "signatureHash": "string"        }      }    ],    "definitionVersion": "string",    "authenticationConfig": {      "addSecurityRecommendation": true,      "codeExpirationMinutes": 0    }  },  "status": "string",  "isPublished": true,  "whatsappTemplateId": "string",  "whatsappTemplateName": "string",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}