The WhatsApp template endpoint offers a way for you to manage your WhatsApp channel-specific templates that can be used with the Conversation API. The WhatsApp templates are a requirement to send the initial outbound messages in the WhatsApp API.
Returns a paginated list of templates for the specified project. If no page token is supplied then the first 50
templates are returned in alphabetical order.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
List of templates
BadRequest
Unauthorized
InternalServerError
{- "totalSize": 0,
- "pageSize": 0,
- "previousPageToken": "string",
- "nextPageToken": "string",
- "templates": [
- {
- "whatsappId": "string",
- "state": "APPROVED",
- "name": "string",
- "language": "AF",
- "category": "AUTHENTICATION",
- "rejectionCode": "ABUSIVE_CONTENT",
- "qualityScore": "QUALITY_SCORE_GREEN",
- "changes": {
- "status": "DRAFT",
- "allowCategoryChange": true,
- "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "TEXT",
- "text": "string",
- "example": "string"
}
], - "messageSendTtlSeconds": 0
}
}, - "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "TEXT",
- "text": "string",
- "example": "string"
}
], - "messageSendTtlSeconds": 0
}, - "analytics": [
- {
- "sent": 0,
- "delivered": 0,
- "read": 0,
- "start": "string",
- "end": "string",
- "buttons": [
- {
- "type": "QUICK_REPLY",
- "content": "string",
- "clicks": 0
}
]
}
]
}
]
}
Creates a new template with the request data. If the status
field is set to submit
the template will be created immediately, otherwise it will be saved as a draft
.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
Template data
Created template
BadRequest
Unauthorized
Conflict
FailedDependency
TooManyRequests
InternalServerError
Minimum body to create a template.
{- "name": "my_template",
- "category": "AUTHENTICATION",
- "language": "EN",
- "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "LOCATION"
}, - {
- "type": "HEADER",
- "format": "TEXT",
- "text": "Save {{1}}% on your next purchase!",
- "example": "20"
}, - {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
], - "addSecurityRecommendation": true
}, - {
- "type": "FOOTER",
- "text": "To track your order please click the 'Track Your Order' button",
- "codeExpirationMinutes": 5
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}, - {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "OTP",
- "otpType": "COPY_CODE",
- "text": "Example text."
}
]
}, - {
- "type": "CAROUSEL",
- "cards": [
- {
- "components": [
- {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
]
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}
]
}
]
}
]
}
], - "messageSendTtlSeconds": 60
}
}
Response when successfully creating a template.
{- "name": "My WhatsApp Template",
- "category": "UTILITY",
- "language": "EN_US",
- "qualityScore": "QUALITY_SCORE_GREEN",
- "changes": {
- "status": "DRAFT",
- "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "TEXT",
- "text": "Save {{1}}% on your next purchase!",
- "example": "20"
}, - {
- "type": "HEADER",
- "format": "LOCATION"
}, - {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
], - "addSecurityRecommendation": true
}, - {
- "type": "FOOTER",
- "text": "To track your order please click the 'Track Your Order' button",
- "codeExpirationMinutes": 5
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}, - {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "OTP",
- "otpType": "COPY_CODE",
- "text": "Example text."
}
]
}, - {
- "type": "CAROUSEL",
- "cards": [
- {
- "components": [
- {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
]
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}
]
}
]
}
]
}
], - "messageSendTtlSeconds": 60
}, - "analytics": [ ]
}
}
{- "type": "WHATSAPP_TEMPLATE_COMMENT_ADDED",
- "payload": {
- "name": "My WhatsApp Template",
- "category": "UTILITY",
- "language": "EN_US",
- "qualityScore": "QUALITY_SCORE_GREEN",
- "changes": {
- "status": "DRAFT",
- "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "TEXT",
- "text": "Save {{1}}% on your next purchase!",
- "example": "20"
}, - {
- "type": "HEADER",
- "format": "LOCATION"
}, - {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
], - "addSecurityRecommendation": true
}, - {
- "type": "FOOTER",
- "text": "To track your order please click the 'Track Your Order' button",
- "codeExpirationMinutes": 5
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}, - {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "OTP",
- "otpType": "COPY_CODE",
- "text": "Example text."
}
]
}, - {
- "type": "CAROUSEL",
- "cards": [
- {
- "components": [
- {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
]
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}
]
}
]
}
]
}
], - "messageSendTtlSeconds": 60
}, - "analytics": [ ]
}
}
}
Returns a paginated list of templates for the specified project and name. If no page token is supplied then the first 50
templates are returned in alphabetical order.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
templateName required | string The name of the template to query |
List of templates with the same name
BadRequest
Unauthorized
NotFound
InternalServerError
{- "totalSize": 0,
- "pageSize": 0,
- "previousPageToken": "string",
- "nextPageToken": "string",
- "templates": [
- {
- "whatsappId": "string",
- "state": "APPROVED",
- "name": "string",
- "language": "AF",
- "category": "AUTHENTICATION",
- "rejectionCode": "ABUSIVE_CONTENT",
- "qualityScore": "QUALITY_SCORE_GREEN",
- "changes": {
- "status": "DRAFT",
- "allowCategoryChange": true,
- "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "TEXT",
- "text": "string",
- "example": "string"
}
], - "messageSendTtlSeconds": 0
}
}, - "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "TEXT",
- "text": "string",
- "example": "string"
}
], - "messageSendTtlSeconds": 0
}, - "analytics": [
- {
- "sent": 0,
- "delivered": 0,
- "read": 0,
- "start": "string",
- "end": "string",
- "buttons": [
- {
- "type": "QUICK_REPLY",
- "content": "string",
- "clicks": 0
}
]
}
]
}
]
}
Delete template that matches the name. If message templates with the same name exists in multiple languages, all those templates will also be deleted. Once deleted the name can not be used for new message templates for 30 days. Use a different name to create future templates during that time period. Messages that have been sent with the deleted template, but not yet delivered, will be attempted to be deliver for 30 days from the time of the message.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
templateName required | string The name of the template to query |
Template(s) deleted
BadRequest
Unauthorized
NotFound
TooManyRequests
InternalServerError
{- "errorCode": "project_not_initialized",
- "message": "Project not initialized for WhatsApp.",
- "resolution": "Verify that the project ID is correct and that it has been onboarded for WhatsApp."
}
Returns a template for a project, with the specified name and language.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
templateName required | string The name of the template to query |
languageCode required | string (WhatsappTemplateLanguagesEnum) The language code of the specific template. |
Template
BadRequest
Unauthorized
NotFound
InternalServerError
{- "whatsappId": "string",
- "state": "APPROVED",
- "name": "string",
- "language": "AF",
- "category": "AUTHENTICATION",
- "rejectionCode": "ABUSIVE_CONTENT",
- "qualityScore": "QUALITY_SCORE_GREEN",
- "changes": {
- "status": "DRAFT",
- "allowCategoryChange": true,
- "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "TEXT",
- "text": "string",
- "example": "string"
}
], - "messageSendTtlSeconds": 0
}
}, - "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "TEXT",
- "text": "string",
- "example": "string"
}
], - "messageSendTtlSeconds": 0
}, - "analytics": [
- {
- "sent": 0,
- "delivered": 0,
- "read": 0,
- "start": "string",
- "end": "string",
- "buttons": [
- {
- "type": "QUICK_REPLY",
- "content": "string",
- "clicks": 0
}
]
}
]
}
Delete a template draft. Please note that it is only possible to delete templates that have not yet been submitted to WhatsApp.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
templateName required | string The name of the template to query |
languageCode required | string (WhatsappTemplateLanguagesEnum) The language code of the specific template. |
Template draft deleted.
BadRequest
Unauthorized
NotFound
Conflict
InternalServerError
{- "errorCode": "project_not_initialized",
- "message": "Project not initialized for WhatsApp.",
- "resolution": "Verify that the project ID is correct and that it has been onboarded for WhatsApp."
}
Updates a template DRAFT.
Note that it is not possible to update all fields for a template, if you want to update a field that is not supported you will need to delete the draft and create a new one.
Update a template REJECTED / APPROVED / PAUSED / DISABLED
It is possible to update templates that have been rejected, approved, paused or disabled, we will automatically set the status to draft when update a rejected template.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
templateName required | string The name of the template to query |
languageCode required | string (WhatsappTemplateLanguagesEnum) The language code of the specific template. |
Supported template fields to update.
Updated template draft.
BadRequest
Unauthorized
NotFound
Conflict
FailedDependency
TooManyRequests
InternalServerError
Example body request to update a template.
{- "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "LOCATION"
}, - {
- "type": "HEADER",
- "format": "TEXT",
- "text": "Save {{1}}% on your next purchase!",
- "example": "20"
}, - {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
], - "addSecurityRecommendation": true
}, - {
- "type": "FOOTER",
- "text": "To track your order please click the 'Track Your Order' button",
- "codeExpirationMinutes": 5
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}, - {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "OTP",
- "otpType": "COPY_CODE",
- "text": "Example text."
}
]
}, - {
- "type": "CAROUSEL",
- "cards": [
- {
- "components": [
- {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
]
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}
]
}
]
}
]
}
], - "messageSendTtlSeconds": 60
}
}
Response when successfully update a template.
{- "whatsappId": "123456",
- "name": "My WhatsApp Template",
- "state": "APPROVED",
- "category": "UTILITY",
- "language": "EN_US",
- "qualityScore": "QUALITY_SCORE_GREEN",
- "changes": {
- "status": "DRAFT",
- "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "TEXT",
- "text": "Save {{1}}% on your next purchase!",
- "example": "20"
}, - {
- "type": "HEADER",
- "format": "LOCATION"
}, - {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
], - "addSecurityRecommendation": true
}, - {
- "type": "FOOTER",
- "text": "To track your order please click the 'Track Your Order' button",
- "codeExpirationMinutes": 5
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}, - {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "OTP",
- "otpType": "COPY_CODE",
- "text": "Example text."
}
]
}, - {
- "type": "CAROUSEL",
- "cards": [
- {
- "components": [
- {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
]
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}
]
}
]
}
]
}
], - "messageSendTtlSeconds": 60
}
}, - "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "TEXT",
- "text": "Save {{1}}% on your next purchase!",
- "example": "20"
}
], - "messageSendTtlSeconds": 60
}, - "analytics": [ ]
}
{- "type": "WHATSAPP_TEMPLATE_COMMENT_ADDED",
- "payload": {
- "name": "My WhatsApp Template",
- "category": "UTILITY",
- "language": "EN_US",
- "qualityScore": "QUALITY_SCORE_GREEN",
- "changes": {
- "status": "DRAFT",
- "details": {
- "components": [
- {
- "type": "HEADER",
- "format": "TEXT",
- "text": "Save {{1}}% on your next purchase!",
- "example": "20"
}, - {
- "type": "HEADER",
- "format": "LOCATION"
}, - {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
], - "addSecurityRecommendation": true
}, - {
- "type": "FOOTER",
- "text": "To track your order please click the 'Track Your Order' button",
- "codeExpirationMinutes": 5
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}, - {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "OTP",
- "otpType": "COPY_CODE",
- "text": "Example text."
}
]
}, - {
- "type": "CAROUSEL",
- "cards": [
- {
- "components": [
- {
- "type": "BODY",
- "text": "Good morning {{1}}, your package has arrived.",
- "examples": [
- "Mr. Smith"
]
}, - {
- "type": "BUTTONS",
- "buttons": [
- {
- "type": "URL",
- "text": "Example test",
}, - {
- "type": "QUICK_REPLY",
- "text": "Track Your Order"
}, - {
- "type": "PHONE_NUMBER",
- "text": "Example text.",
- "phoneNumber": "+48 777 777777"
}
]
}
]
}
]
}
], - "messageSendTtlSeconds": 60
}
}, - "analytics": [ ]
}
}
Paginated list of activities for a template. Ordered from the most recent one to the oldest one.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
templateName required | string The name of the template to query |
languageCode required | string (WhatsappTemplateLanguagesEnum) The language code of the specific template. |
Recent activities on template.
BadRequest
Unauthorized
NotFound
InternalServerError
Response for all template activities.
{- "totalSize": 2,
- "pageSize": 50,
- "notifications": [
- {
- "type": "CREATED",
- "created": "2023-01-19T13:11:08.204Z",
- "author": "Provisioning API user"
}, - {
- "type": "COMMENT_ADDED",
- "created": "2023-01-19T13:11:08.204Z",
- "comment": "Example comment",
- "author": "Provisioning API user"
}
]
}
Creates a comment for a template.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
templateName required | string The name of the template to query |
languageCode required | string (WhatsappTemplateLanguagesEnum) The language code of the specific template. |
Comment data
Example body request to create a comment.
{- "comment": "Example comment."
}
Response when successfully creating a comment.
{- "type": "CREATED",
- "comment": "Example comment",
- "created": "2023-01-19T13:11:08.204Z"
}
Compare two templates.
projectId required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
templateName required | string The name of the template to query |
languageCode required | string (WhatsappTemplateLanguagesEnum) The language code of the specific template. |
Compare data
Compared template response.
BadRequest
Unauthorized
NotFound
Conflict
InternalServerError
Example body request compare templates.
{- "templates": [
- {
- "templateName": "templateName2",
- "templateLanguage": "PL"
}
], - "timeframe": "60",
- "endTimestamp": 1694612898734
}
Response when successfully compared templates.
{- "templates": [
- {
- "name": "templateName1",
- "language": "EN",
- "blockOrder": 1,
- "messageSends": 1000,
- "topBlockReason": "NO_REASON"
}, - {
- "name": "templateName1",
- "language": "PL",
- "blockOrder": 2,
- "messageSends": 2000,
- "topBlockReason": "NO_REASON_GIVEN"
}
]
}