Connect WhatsApp via credentials
Connect a WhatsApp Business Account by providing Meta credentials directly. This is the headless alternative to the Embedded Signup browser flow.
To get the required credentials:
- Go to Meta Business Suite (business.facebook.com)
- Create or select a WhatsApp Business Account
- In Business Settings > System Users, create a System User
- Assign it the whatsapp_business_management and whatsapp_business_messaging permissions
- Generate a permanent access token
- Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers
- Get the Phone Number ID from the same page (click on the number)
API key authentication - use your Zernio API key as a Bearer token
In: header
Your Zernio profile ID
Permanent System User access token from Meta Business Suite
WhatsApp Business Account ID from Meta
Phone Number ID from Meta WhatsApp Manager
The 6-digit two-step verification PIN set on the number. Required if you enabled two-step verification for it, otherwise Meta rejects the Cloud API registration with error 133005 and the number cannot send messages.
^\d{6}$Response Body
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.connect.connectWhatsAppCredentials({ body: { profileId: 'profile_abc123', accessToken: 'tok_abc123', wabaId: 'waba_abc123', phoneNumberId: 'phonenumber_abc123', },});console.log(data);{
"message": "WhatsApp connected successfully",
"account": {
"accountId": "6507a1b2c3d4e5f6a7b8c9d0",
"platform": "whatsapp",
"username": "+1 555-123-4567",
"displayName": "Acme Corp",
"isActive": true,
"selectedPhoneNumber": "+1 555-123-4567"
}
}Connect an OpenAI Ads account POST
Connect an OpenAI Ads account using an API key from ChatGPT Ads Manager. The key grants full campaign write access on OpenAI's side (OpenAI does not offer a read-only key scope). Zernio uses it to read ads and performance, and to create and manage campaigns you set up through Zernio (create, status, budget, and cancel). Campaigns created directly in ChatGPT Ads Manager can still be managed there.
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.