The bundles endpoint allows you to create and manage bundles of account resources.
Provisioning API (1.2.7)
https://provisioning.api.sinch.com/
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 server
https://provisioning.api.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_JWT_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.
{ "totalSize": 0, "pageSize": 0, "previousPageToken": "string", "nextPageToken": "string", "templates": [ { … } ] }
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 server
https://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/templates
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
'https://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/templates' \
-H 'Authorization: Bearer <YOUR_JWT_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.
Response when successfully creating a template.
{ "name": "My WhatsApp Template", "category": "UTILITY", "language": "EN_US", "qualityScore": "QUALITY_SCORE_GREEN", "changes": { "status": "DRAFT", "details": { … } }, "analytics": [] }
The unique ID of the project. You can find this on the Sinch Dashboard.
- Production server
https://provisioning.api.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_JWT_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.
{ "totalSize": 0, "pageSize": 0, "previousPageToken": "string", "nextPageToken": "string", "templates": [ { … } ] }
WhatsApp Senders
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.