Sync WhatsApp Templates API
Use this API to synchronize WhatsApp message templates from Meta with your EasySocial account.
What the API does
The endpoint retrieves the latest templates from Meta, imports newly found templates, updates existing template statuses and components, uploads associated media assets to cloud storage, and removes templates that are no longer present in WhatsApp Manager.
Endpoint
| Property | Value |
|---|---|
| Method | POST (also supports GET) |
| Base path | /engage/v1/wa-templates/sync |
| Full URL | https://client-api.e-so.in/engage/v1/wa-templates/sync |
| Alternative URL | https://client-api.e-so.in/engage/v1/wa-templates/sync-templates |
| Authentication | Required; use a valid business access token. |
| Rate limiting | Standard rate limiting applies. |
Authentication
Send the business access token in either the Authorization header or the auth-key header. If both are present, the API uses Authorization. Requests are scoped to the WhatsApp account associated with the business. You can refer to the given link to generate access token: https://easysocial.io/docs/generate-business-partner-access-token
| Header | Format | Example |
|---|---|---|
Authorization | Bearer <token> | Authorization: Bearer YOUR_ACCESS_TOKEN |
auth-key | <token> | auth-key: YOUR_ACCESS_TOKEN |
Request
Include either authentication header described above. The Content-Type: application/json header is optional. No query parameters or request body are required.
Successful response
A successful request returns 200 OK with counts for templates synchronized, created, updated, and deleted.
{
"status": 200,
"success": true,
"message": "Templates Synced Successfully with WhatsApp!",
"payload": {
"synced": 18,
"created": 2,
"updated": 1,
"deleted": 0
}
}| Payload field | Type | Meaning |
|---|---|---|
synced | Integer | Total templates retrieved from Meta. |
created | Integer | New templates imported into the account. |
updated | Integer | Existing templates whose status or components were updated. |
deleted | Integer | Templates removed from the account because they are no longer in Meta. |
Error responses
| Status | Name | Meaning |
|---|---|---|
400 | Bad Request | WhatsApp Business credentials (WABA ID or access token) are missing or not configured. |
401 | Unauthorized | The access token is missing, invalid, or expired. |
403 | Forbidden | Bulk template synchronization is not allowed in sandbox mode. |
503 | Service Unavailable | The business subscription plan has expired. |
500 | Internal Server Error | An unexpected error occurred while communicating with Meta or processing media assets. |
Example 400 Bad Request response:
{
"status": 400,
"success": false,
"message": "WhatsApp platform credentials (WABA ID or Access Token) are missing or incomplete.",
"errors": null,
"payload": null
}Code examples
cURL
curl -X POST "https://client-api.e-so.in/engage/v1/wa-templates/sync" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json"JavaScript (Fetch)
const response = await fetch("https://client-api.e-so.in/engage/v1/wa-templates/sync", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);Python (Requests)
import requests
url = "https://client-api.e-so.in/engage/v1/wa-templates/sync"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())