The WhatsApp accounts endpoint lets you create and update WhatsApp accounts as well as get account activity and leave comments.
Provisioning API (1.2.36)
A WhatsApp Sender is also referred to as a 'Business Profile' or a WhatsApp channel. The WhatsApp Sender endpoint allows you to create a Sender through Meta's Embedded sign up. A Sender must be provisioned for you as a consumer of the WhatsApp API to send messages to your end users.
Request
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.
The unique ID of the project. You can find this on the Sinch Dashboard.
Field masks are a way for API callers to list the fields that a request should return.
Optionally query for sender by states.
Optionally query for sender by statuses.
The date range to retrieve template analytics for. Fallback to DAY if none is set.
- Production serverhttps://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/templates
- Staging server from master branchhttps://provisioning-api.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates
- Staging server from dev branchhttps://provisioning-api-dev.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates
- Internal production server for admin authorizationhttps://provisioning-api.unauth.int.prod.sinch.com/v1/projects/{projectId}/whatsapp/templates
- Internal staging server from master branch for admin authorizationhttps://provisioning-api.unauth.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates
- Internal staging server from dev branch for admin authorizationhttps://provisioning-api-dev.unauth.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/templates?pageToken=string&pageSize=1&fieldMask=whatsappId&filterStates=APPROVED&filterStatuses=DRAFT&templateAnalyticsDateRange=DAY&templateName=string' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'List of templates
Template analytics.
Number of times buttons in the template has been clicked.
Type of button.
Rejection code if template is in status 'REJECTED'
Quality score of the HSM.
Object containing changes on the template. If empty the changes has been approved and applied to the template.
- WhatsappTemplateListDto
- WhatsappPartialTemplateListDto
{ "totalSize": 0, "pageSize": 0, "previousPageToken": "string", "nextPageToken": "string", "templates": [ { … } ] }
Request
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.
The unique ID of the project. You can find this on the Sinch Dashboard.
Template data
'Template input details and information.' Not required for draft.
List of components in the template. Must contain a BODY component and can only have one entry of each type. Not required for draft. Field 'type' must have unique values across items.
- WhatsappLocationHeaderComponentInputDto
- WhatsappTextHeaderComponentInputDto
- WhatsappMediaHeaderComponentInputDto
- WhatsappBodyComponentInputDto
- WhatsappFooterComponentInputDto
- WhatsappButtonsComponentInputDto
- WhatsappInputCarouselComponentDto
Template message delivery retry time-to-live (TTL) override value. If unable to deliver the template message, it will be periodically retry for this period of time. If it is unable to deliver the message for this period of time, the message will be dropped.
| AUTHENTICATION | MARKETING | UTILITY | |
|---|---|---|---|
| Default | 10 minutes | 30 days | 30 days |
| Customizable range | 10 seconds to 15 minutes | 12 hours to 30 days | 30 seconds to 12 hours |
| Valid values | 10 to 900 seconds | 43200 to 2592000 seconds | 30 to 43200 seconds |
Please note that authentication templates created before October 23, 2024, have a default TTL of 30 days.
Flag to save template as draft if submission fails. Defaults to false.
- Production serverhttps://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/templates
- Staging server from master branchhttps://provisioning-api.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates
- Staging server from dev branchhttps://provisioning-api-dev.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates
- Internal production server for admin authorizationhttps://provisioning-api.unauth.int.prod.sinch.com/v1/projects/{projectId}/whatsapp/templates
- Internal staging server from master branch for admin authorizationhttps://provisioning-api.unauth.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates
- Internal staging server from dev branch for admin authorizationhttps://provisioning-api-dev.unauth.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
- marketingOrUtilityFull
- marketingOrUtilityMinimum
- authenticationFull
- authenticationMinimum
- flowUtility
- flowMarketing
curl -i -X POST \
-u <username>:<password> \
'https://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/templates' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"name": "my_template",
"category": "MARKETING",
"language": "EN",
"details": {
"components": [
{
"type": "HEADER",
"format": "LOCATION"
},
{
"type": "HEADER",
"format": "TEXT",
"text": "Save {{1}}% on your next purchase!",
"example": "20"
},
{
"type": "HEADER",
"format": "DOCUMENT",
"example": {
"url": "https://example.com/photos/1.png"
}
},
{
"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",
"url": "https://www.my-website.com?name={{1}}",
"example": "https://www.my-website.com?name=john"
},
{
"type": "QUICK_REPLY",
"text": "Track Your Order"
},
{
"type": "OTP",
"otpType": "COPY_CODE",
"text": "Example text."
},
{
"type": "FLOW",
"text": "Start Flow",
"flowId": "flow-id",
"navigateScreen": "QUESTION_ONE",
"flowAction": "NAVIGATE"
}
]
},
{
"type": "CAROUSEL",
"cards": [
{
"components": [
{
"type": "HEADER",
"format": "IMAGE",
"example": {
"url": "https://example.com/photos/1.png"
}
},
{
"type": "BODY",
"text": "Good morning {{1}}, your package has arrived.",
"examples": [
"Mr. Smith"
]
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "Example test",
"url": "https://www.my-website.com?name={{1}}",
"example": "https://www.my-website.com?name=john"
},
{
"type": "QUICK_REPLY",
"text": "Track Your Order"
},
{
"type": "PHONE_NUMBER",
"text": "Example text.",
"phoneNumber": "+48 777 777777"
}
]
}
]
}
]
}
]
}
}'Created template
Template analytics.
Number of times buttons in the template has been clicked.
Rejection code if template is in status 'REJECTED'
Quality score of the HSM.
Object containing changes on the template. If empty the changes has been approved and applied to the template.
{ "name": "My WhatsApp Template", "category": "UTILITY", "language": "EN_US", "qualityScore": "QUALITY_SCORE_GREEN", "changes": { "status": "DRAFT", "details": { … } }, "analytics": [], "isMetaGenerated": false }
Request
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.
The unique ID of the project. You can find this on the Sinch Dashboard.
- Production serverhttps://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/templates/{templateName}
- Staging server from master branchhttps://provisioning-api.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates/{templateName}
- Staging server from dev branchhttps://provisioning-api-dev.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates/{templateName}
- Internal production server for admin authorizationhttps://provisioning-api.unauth.int.prod.sinch.com/v1/projects/{projectId}/whatsapp/templates/{templateName}
- Internal staging server from master branch for admin authorizationhttps://provisioning-api.unauth.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates/{templateName}
- Internal staging server from dev branch for admin authorizationhttps://provisioning-api-dev.unauth.int.staging.sinch.com/v1/projects/{projectId}/whatsapp/templates/{templateName}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/templates/{templateName}?pageToken=string&pageSize=1&fieldMask=whatsappId&templateAnalyticsDateRange=DAY' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'List of templates with the same name
Template analytics.
Number of times buttons in the template has been clicked.
Type of button.
Rejection code if template is in status 'REJECTED'
Quality score of the HSM.
Object containing changes on the template. If empty the changes has been approved and applied to the template.
- WhatsappTemplateListDto
- WhatsappPartialTemplateListDto
{ "totalSize": 0, "pageSize": 0, "previousPageToken": "string", "nextPageToken": "string", "templates": [ { … } ] }