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"
}
}Set TikTok brand identity PATCH
Set or update the Brand Identity (display name + avatar) for a `tiktokads` SocialAccount. TikTok requires every ad to carry an `identity_id + identity_type` pair. The Brand Identity is the CUSTOMIZED_USER alternative to attributing ads to a real @username (TT_USER). This route uploads the supplied image to TikTok, creates the identity via `/v2/identity/create/`, and caches the resulting `identity_id` on the account so subsequent `POST /v1/ads/create` calls can opt into it via `identityType: 'CUSTOMIZED_USER'`. Configurable on every `tiktokads` account, including linked-mode ones (those with a posting account on the same profile). Configuration is idempotent and harmless when posting is also connected: the default ad-create path still prefers TT_USER, and CUSTOMIZED_USER is only used per-ad when the caller explicitly opts in. TikTok identities are immutable post-creation. Re-saving creates a new identity on TikTok and swaps the cached id; the old identity stays orphaned on TikTok's side (harmless, no billing impact). Alternative: pass `brandIdentity` directly on `POST /v1/ads/create` to configure on first ad creation in a single round-trip.
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.