curl --request POST \
--url https://app.kapso.ai/api/v1/whatsapp_templates/sync \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"whatsapp_config_id": "550e8400-e29b-41d4-a716-446655440000"
}
'{
"status": "queued",
"sync_requests": [
{
"id": "sync-run-123abc",
"business_account_id": "123456789012345",
"anchor_whatsapp_config_id": "config-123abc",
"status": "queued",
"templates_synced": 0,
"templates_created": 0,
"templates_updated": 0,
"templates_removed": 0,
"queued_at": "2024-01-15T10:30:00Z",
"started_at": null,
"finished_at": null,
"job_id": "job-456def",
"error_class": null,
"error_message": null,
"results": {},
"affected_whatsapp_config_ids": [
"config-123abc"
],
"anchor_whatsapp_config": {
"id": "config-123abc",
"name": "Main WhatsApp",
"display_phone_number": "+1234567890"
}
}
],
"summary": {
"total_requests": 1,
"jobs_enqueued": 1,
"already_in_progress": 0
}
}WhatsApp Templates
Sync WhatsApp templates
Synchronize WhatsApp templates from Meta with the local database.
Sync Options:
- With
whatsapp_config_id: Queue sync for that specific config - With
customer_id: Queue sync for all production configs of that customer - With no parameters: Queue sync for all production configs in the project
Important Notes:
- Sync operations are grouped by WhatsApp Business Account ID
- Only one active sync can run per Business Account at a time
- If a sync is already running/queued for a Business Account, the existing sync request is returned
- The sync operation is asynchronous and runs in the background
- Use the sync_status endpoint to track progress
Response Structure: The response includes an array of sync requests (one per Business Account) with:
- Individual sync request details and status
- Summary statistics (total requests, jobs enqueued, already in progress)
POST
/
whatsapp_templates
/
sync
curl --request POST \
--url https://app.kapso.ai/api/v1/whatsapp_templates/sync \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"whatsapp_config_id": "550e8400-e29b-41d4-a716-446655440000"
}
'{
"status": "queued",
"sync_requests": [
{
"id": "sync-run-123abc",
"business_account_id": "123456789012345",
"anchor_whatsapp_config_id": "config-123abc",
"status": "queued",
"templates_synced": 0,
"templates_created": 0,
"templates_updated": 0,
"templates_removed": 0,
"queued_at": "2024-01-15T10:30:00Z",
"started_at": null,
"finished_at": null,
"job_id": "job-456def",
"error_class": null,
"error_message": null,
"results": {},
"affected_whatsapp_config_ids": [
"config-123abc"
],
"anchor_whatsapp_config": {
"id": "config-123abc",
"name": "Main WhatsApp",
"display_phone_number": "+1234567890"
}
}
],
"summary": {
"total_requests": 1,
"jobs_enqueued": 1,
"already_in_progress": 0
}
}Authorizations
API key required for all endpoints
Body
application/json

