Skip to content

Sync Templates

POST
/platform/v1/templates/sync
curl --request POST \
--url https://example.com/platform/v1/templates/sync \
--header 'Content-Type: application/json' \
--data '{ "channel_id": 1 }'

Import + upsert all templates from a channel’s WABA.

Idempotent — re-running upserts by (platform_channel_id, name, language_code). Returns {imported, updated, skipped, total}.

Errors: * channel not found / not owned / not WhatsApp / not active / missing credentials → 422. * Meta error → 502 (the message is the Meta-side error string; NEVER includes the channel token).

Media type application/json
PlatformTemplateSyncRequest

Body for POST /platform/v1/templates/sync — import from a WABA.

object
channel_id
required
Channel Id
integer
Example generated
{
"channel_id": 1
}

Successful Response

Media type application/json
PlatformTemplateSyncResponse

Counts returned by sync-from-Meta. Idempotent: re-running upserts.

object
imported
required
Imported
integer
skipped
required
Skipped
integer
total
required
Total
integer
updated
required
Updated
integer
Example generated
{
"imported": 1,
"skipped": 1,
"total": 1,
"updated": 1
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}