Connect

Connect WhatsApp from Embedded Signup

Exchange the authorization code Meta's Embedded Signup popup returned. This is the call the Zernio-hosted signup page makes after the popup closes (GET /v1/connect/whatsapp?signup=hosted), sending the wabaId and phoneNumberId Meta reported so exactly the chosen number is connected; when both are omitted the first number the token can see is used. The code never passes through a redirect_uri, so POST /v1/connect/{platform} cannot accept it. Authenticates with an API key, or with the connect token the hosted flow issues (X-Connect-Token header).

post/v1/connect/whatsapp/embedded-signup

Headers

X-Connect-Tokenstring

Connect token issued by the hosted signup flow, accepted instead of an API key.

Request body

codestring required

Authorization code from the WA_EMBEDDED_SIGNUP postMessage

profileIdstring required
wabaIdstring

WhatsApp Business Account id, when the SDK reported one

phoneNumberIdstring
isCoexistenceboolean

Number is also live in the WhatsApp Business app

expectedPhoneNumberstring

Rejects the connect when Meta returns a different number

redirectUrlstring

Hosted signup page only. When present, the response also carries redirectUrl, the URL the user should land on, with the outcome mapped exactly like the redirect flow (success params, or error and platform with the same values). Must be an absolute http(s) URL or a custom app scheme.

echoConnectTokenboolean

Hosted signup page only. Append the connect token to the success redirect, as the redirect flow does for API-key callers.

Response

Number connected

messagestring
redirectUrlstring

Present only when redirectUrl was sent; also present on error responses.

Changes