OverviewProductsPlatformsAPI ReferenceResources
Connect

Complete number selection

POSThttps://zernio.com/api/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.

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Body

application/json

What every request needs

profileIdstringRequired

The Zernio profile ID

phoneNumberIdstringRequired

The selected phone number ID (from listWhatsAppPhoneNumbers)

wabaIdstringRequired

The WABA ID containing the selected phone

tempTokenstringRequired

The temporary access token from the headless redirect

Optional parameters2 fields
userProfileobject

Optional user profile data (passthrough)

redirect_urlstring

Optional URL to receive the post-connection redirect target

Headers

Optional
X-Connect-Tokenstring

Alternative auth for API users' end customers

Responses

Success· the request worked

Errors· the request failed

POST/v1/connect/whatsapp/select-phone-number
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.connect.completeWhatsAppPhoneSelection({  body: {    profileId: 'profile_abc123',    phoneNumberId: 'phonenumber_abc123',    wabaId: 'waba_abc123',    tempToken: 'tok_abc123',  },});console.log(data);
{  "message": "WhatsApp phone number connected successfully",  "account": {    "accountId": "6507a1b2c3d4e5f6a7b8c9d0",    "platform": "whatsapp",    "username": "+55 83 8793-2039",    "displayName": "Bioface",    "isActive": true,    "selectedPhoneNumber": "+55 83 8793-2039"  }}
OpenAPI specification
Was this page helpful?