Initiate Contacts/History Synchronization

Initiates one-time synchronization for the app.

  • Use syncType=smb_app_state_sync to initiate contacts synchronization. On success, smb_app_state_sync webhooks are triggered for current contacts and future contact updates.
  • Use syncType=history to initiate message history synchronization. If the business has shared history, history webhooks are triggered.

Important:

  • This step can be performed only once.
  • To perform again, customer must offboard and complete Embedded Signup again.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

CoEx Event Guide

https://partner-docs.gupshup.io/update/docs/coexistence-events


Description

  1. Method/path: POST /app/:appId/coex/sync (optional trailing slash supported).
  2. Full URL segment: BASE_URL/partner/app/:appId/coex/sync (context path /partner, controller prefix /app).
  3. Auth: Role PARTNER_APP (see Authentication above).
  4. Content-Type: application/x-www-form-urlencoded.
  5. Rate limit: 10 requests per 60 seconds

Note:

Both smb_app_state_sync and history synchronization can be triggered only once, and must be initiated within 24 hours of onboarding.


Request example

Contacts sync (smb_app_state_sync):

curl --location --request POST '{{BASE_URL}}/partner/app/{{APP_ID}}/coex/sync' \
  --header 'Authorization: Bearer {{PARTNER_APP_TOKEN}}' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'syncType=smb_app_state_sync'

Message history sync (history):

curl --location --request POST '{{BASE_URL}}/partner/app/{{APP_ID}}/coex/sync' \
  --header 'Authorization: Bearer {{PARTNER_APP_TOKEN}}' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'syncType=history'

Steps to use this API

  1. Make the API call with the desired syncType
  2. Then you will receive an event from Meta on the webhook as mentioned in the document here

Purpose of Request ID

The request ID is from meta. If you don't receive the respective event after the API call from meta, then this ID can be used to raise the missing event issue with meta.


Response example

Success

{
  "data": {
    "messaging_product": "whatsapp",
    "request_id": "<REQUEST_ID>"
  },
  "status": "success"
}

Sync modes (syncType):

ValuePurpose
smb_app_state_syncInitiates contacts synchronization. On success, smb_app_state_sync webhooks describe current WhatsApp Business App contacts; future contact changes trigger further webhooks.
historyInitiates message history synchronization. If the business opts to share history, history webhooks describe messages in the agreed time range.

Request parameters

KeyDescriptionValuesData typeRequired / optionalConstraints
Path
appIdWhatsApp / Partner app identifierUUID or app id stringStringRequiredMust be an app linked to the authenticated partner; portal checks access before proxying.
Headers
AuthorizationPartner App tokenBearer {{Partner App JWT}} or allowed alternatives per route (sk_, hardened JWT, etc.)StringRequiredMust satisfy @Authenticated + PARTNER_APP.
Content-TypeMedia typeapplication/x-www-form-urlencodedStringRequiredForm body carries syncType.
Body (form)
syncTypeSync modesmb_app_state_sync \ historyStringRequiredCase-insensitive match; other values → 400 with message syncType must be smb_app_state_sync or history.

Status codes

Status codeMeaningComments
200SuccessBody and semantics mirror the upstream WASS response when the proxy call succeeds (e.g. shape above).
400Bad RequestMissing/invalid syncType; app not linked to partner; missing API key for app; invalid parameter from portal validation.
401UnauthorizedMissing or invalid authentication for Partner App route.
403ForbiddenCaller lacks PARTNER_APP or relevant permissions.
429Too many requestsRate limit exceeded (10 / 60s for this route).
4xx/5xxUpstream or client errorWhen WASS returns a non-success, the portal passes through status and body via the same helper used for other WhatsApp proxies.
500Internal server errorUnexpected failure in portal after proxy or unhandled exception.

Path Params
string
required

App identifier

Form Data
string
enum
required

Synchronization mode

Allowed:
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json