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.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://example.com/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 } } ] }, "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", "regex": null, "url": null, "shortUrl": null, "alt": null, "mediaType": null } } ] }, "sms": null, "whatsapp": null, "rcs": null }, "footer": { "type": "text", "template": "Best regards, The SentDM Team", "variables": null }, "buttons": null, "definitionVersion": "1.0", "authenticationConfig": null }, "submitForReview": false }'{
"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"
}
}
]
},
"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"
}
}
]
}
},
"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"
}{
"statusCode": 400,
"message": "One or more errors occurred!",
"errors": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}Get template by ID with enhanced metadata GET
Retrieves a specific message template by its unique identifier for the authenticated customer with comprehensive template definitions including headers, body, footer, and interactive buttons. The customer ID is extracted from the authentication token.
Delete template by ID DELETE
Deletes a message template by ID for the authenticated customer. Templates with no messages are hard deleted; templates with message history are soft deleted.