Appearance
Complete WhatsApp phone number selection
Bind a specific WhatsApp phone number to the Zernio profile after the user picks one from listWhatsAppPhoneNumbers. Exchanges the short-lived OAuth token for a long-lived token, subscribes the WABA to webhooks, and creates the SocialAccount.
POST /v1/connect/whatsapp/select-phone-number
Bind a specific WhatsApp phone number to the Zernio profile after the user picks one from listWhatsAppPhoneNumbers. Exchanges the short-lived OAuth token for a long-lived token, subscribes the WABA to webhooks, and creates the SocialAccount.
Parameters
X-Connect-Token(header, string) — Alternative auth for API users' end customers
Request body
Content-Type: application/json
profileId(string) required — The Zernio profile IDphoneNumberId(string) required — The selected phone number ID (from listWhatsAppPhoneNumbers)wabaId(string) required — The WABA ID containing the selected phonetempToken(string) required — The temporary access token from the headless redirectuserProfile(object) — Optional user profile data (passthrough)redirect_url(string) — Optional URL to receive the post-connection redirect target
Example:
json
{
"profileId": "6507a1b2c3d4e5f6a7b8c9d0",
"phoneNumberId": "1875844705851813",
"wabaId": "317766992490131",
"tempToken": "EAABsbCS...short-lived-token"
}Responses
200 — Phone number connected successfully
message(string)redirect_url(string) — Present only if redirect_url was provided in the requestaccount(object)
400 — Missing required fields (profileId, phoneNumberId, wabaId, or tempToken)
error(string)details(object)
401
403 — Profile limit exceeded for the user's plan (PROFILE_LIMIT_EXCEEDED)
404 — Selected phone number not found in the specified WABA
error(string)details(object)
500 — Failed to bind phone number
error(string)details(object)