Complete 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.
API key authentication - use your Zernio API key as a Bearer token
In: header
Header Parameters
Alternative auth for API users' end customers
The Zernio profile ID
The selected phone number ID (from listWhatsAppPhoneNumbers)
The WABA ID containing the selected phone
The temporary access token from the headless redirect
Optional user profile data (passthrough)
Optional URL to receive the post-connection redirect target
Response Body
application/json
application/json
application/json
application/json
application/json
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"
}
}{
"error": "string",
"type": "invalid_request_error",
"code": "string",
"param": "string",
"platform": "string",
"platformError": {},
"details": {}
}{
"error": "Unauthorized"
}{
"error": "string",
"type": "invalid_request_error",
"code": "string",
"param": "string",
"platform": "string",
"platformError": {},
"details": {}
}{
"error": "string",
"type": "invalid_request_error",
"code": "string",
"param": "string",
"platform": "string",
"platformError": {},
"details": {}
}List numbers for selection GET
Fetch the WhatsApp phone numbers available across the user's WhatsApp Business Accounts (WABAs) after a headless OAuth flow. WhatsApp OAuth grants access at the WABA level. When a connected WABA has 2 or more phone numbers, you must call this endpoint to list them and then `POST /v1/connect/whatsapp/select-phone-number` to bind one to the Zernio profile. Single-phone WABAs auto-complete during the OAuth callback and never reach this endpoint. Use the `profileId` and `tempToken` returned in the headless redirect (`step=select_phone_number`). Alternative: if you already know `wabaId` and `phoneNumberId` (e.g. from Meta Business Suite), use `connectWhatsAppCredentials` instead, which skips this two-step flow.
List YouTube playlists GET
Returns the playlists available for a connected YouTube account. Use this to get a playlist ID when creating a YouTube post with the playlistId field.