Sync Templates
POST
/platform/v1/templates/sync
const url = 'https://example.com/platform/v1/templates/sync';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"channel_id":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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).
Request Body required
Section titled “Request Body required ” 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}Responses
Section titled “ Responses ”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>
ValidationErrorobject
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" } ]}