Sync WABA Templates
Automate this endpoint with an AI agent using the 2chat-whatsapp-waba skill:
npx skills add 2ChatCo/agent-skills -s 2chat-whatsapp-waba
Trigger a background synchronization of WhatsApp Business API (WABA) message templates for a given phone number. This fetches the latest templates from Meta and updates your 2Chat account so that new, modified, or removed templates are reflected when you call Get WABA Templates.
Requires a WABA channel connected to your 2Chat account. See How to connect WABA to 2Chat.
Query parameters
| Parameter | Description | Example |
|---|---|---|
phone_number | Your WABA number in E.164 format: no spaces, with leading plus sign. Required. | +5215512345432 |
Invocation
- cURL
- Python
- JavaScript
curl --request POST \
--url 'https://api.p.2chat.io/open/waba/templates/sync?phone_number=+5215512345432' \
--header 'Content-Type: application/json' \
--header 'X-User-API-Key: your_api_key_here'
import requests
url = "https://api.p.2chat.io/open/waba/templates/sync"
params = {"phone_number": "+5215512345432"}
headers = {
"Content-Type": "application/json",
"X-User-API-Key": "your_api_key_here"
}
response = requests.post(url, params=params, headers=headers)
print(response.json())
const axios = require('axios');
axios.post('https://api.p.2chat.io/open/waba/templates/sync', null, {
params: { phone_number: '+5215512345432' },
headers: {
'Content-Type': 'application/json',
'X-User-API-Key': 'your_api_key_here'
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
Response
The endpoint returns immediately while the synchronization runs in the background.
{
"success": true,
"is_syncing": true,
"start_time_syncing": "2026-04-10T12:08:02.318000",
"message": "Template sync is already in progress. Please wait."
}
| Field | Description |
|---|---|
success | true when the request was accepted |
is_syncing | true indicates a sync is running (either already in progress or just kicked off by this request) |
start_time_syncing | ISO 8601 timestamp generated when this response was built. Use it as a reference time for polling Get WABA Templates. Present whenever is_syncing is true. |
message | Human-readable status message |
If the endpoint could not start a sync (for example, the WABA number does not have a Gupshup app linked to it), the response is:
{
"success": true,
"is_syncing": false,
"message": "Template sync could not be started."
}
In that case no background work was scheduled and a follow-up call to Get WABA Templates will return the same list as before.
The synchronization runs in the background. Updated templates will be available after a few seconds when you call Get WABA Templates. If you have a large number of templates, the sync may take longer.