WhatsApp accounts API
Connect WhatsApp Business Accounts and phone numbers, check their health. 9 ops: list_whatsapp_accounts, get_whatsapp_account, get_connect_config, get_whatsapp_onboarding, connect_whatsapp_account, register_phone_number, check_account_health, sync_whatsapp_account, disconnect_whatsapp_account.
Connect WhatsApp Business Accounts and phone numbers, check their health.
List WhatsApp accounts · POST /api/v1/list_whatsapp_accounts · scope accounts:read or GET …?input=
The WhatsApp Business Accounts this organization sends from, each with its phone numbers, connection status, Meta review and verification state and the latest health check. Includes the sandbox account (mode sandbox). Use a phone number's `id` as phone_number_id in send_message.
curl -X POST https://getwabi.dev/api/v1/list_whatsapp_accounts \ -H "Authorization: Bearer wabi_…"npx @meterapp/wabi list_whatsapp_accounts{
"type": "object",
"properties": {
"include_disconnected": {
"default": false,
"description": "Also list accounts that were disconnected (their history is kept).",
"type": "boolean"
}
}
}Get a WhatsApp account · POST /api/v1/get_whatsapp_account · scope accounts:read or GET …?input=
One WhatsApp Business Account with its numbers, status, Meta review and verification state, webhook subscription, latest health check and recent Meta account events.
curl -X POST https://getwabi.dev/api/v1/get_whatsapp_account \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"account_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'npx @meterapp/wabi get_whatsapp_account --json '{"account_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'{
"type": "object",
"properties": {
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "WhatsApp Business Account id in this organization (whatsapp_accounts.id, not Meta's WABA id)."
}
},
"required": [
"account_id"
]
}Get connect options · POST /api/v1/get_connect_config · scope accounts:read or GET …?input=
How to connect a WhatsApp Business Account here: whether Meta's Embedded Signup is available (with the app id and configuration id the browser flow needs), the steps for a manual connect with a system user token, the permissions the token needs, and the managed webhook URL.
curl -X POST https://getwabi.dev/api/v1/get_connect_config \ -H "Authorization: Bearer wabi_…"npx @meterapp/wabi get_connect_config{
"type": "object",
"properties": {}
}Get the connect wizard state · POST /api/v1/get_whatsapp_onboarding · scope accounts:read or GET …?input=
Where this organization is in connecting WhatsApp: connect an account → register a number → send a test message → done. Each step is read from the data, so the wizard resumes where it stopped. Returns the current step, the account and numbers involved, the latest test message, the connect options and a hint naming the op for the next step.
curl -X POST https://getwabi.dev/api/v1/get_whatsapp_onboarding \ -H "Authorization: Bearer wabi_…"npx @meterapp/wabi get_whatsapp_onboarding{
"type": "object",
"properties": {}
}Connect a WhatsApp account · POST /api/v1/connect_whatsapp_account · scope accounts:write
Connects (or reconnects) the organization's own WhatsApp Business Account. method embedded_signup takes the `code` from Meta's Embedded Signup in the browser (plus the waba_id and phone_number_id it reported); method manual takes a waba_id and a system user access_token with whatsapp_business_management and whatsapp_business_messaging. Checks the token, reads the account and its numbers, subscribes the account's webhooks (no server to run), and stores the token encrypted. Reconnecting the same WABA keeps all history. Numbers not yet registered come back pending: call register_phone_number next. Errors say whether Meta, your setup or we must act (controlled_by).
curl -X POST https://getwabi.dev/api/v1/connect_whatsapp_account \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"method":"embedded_signup"}'npx @meterapp/wabi connect_whatsapp_account --json '{"method":"embedded_signup"}'{
"type": "object",
"properties": {
"method": {
"type": "string",
"enum": [
"embedded_signup",
"manual"
]
},
"code": {
"description": "embedded_signup: the code FB.login returned.",
"type": "string",
"minLength": 10,
"maxLength": 2000
},
"access_token": {
"description": "manual: a system user access token (stored encrypted, never returned).",
"type": "string",
"minLength": 20,
"maxLength": 4000
},
"waba_id": {
"description": "Meta's WhatsApp Business Account id. Required when the token covers several.",
"type": "string",
"pattern": "^\\d{5,25}$"
},
"phone_number_ids": {
"description": "Meta's phone_number_ids to connect; default every number on the account (within your plan).",
"maxItems": 50,
"type": "array",
"items": {
"type": "string",
"pattern": "^\\d{5,25}$"
}
}
},
"required": [
"method"
]
}Register a phone number · POST /api/v1/register_phone_number · scope accounts:write
Registers a connected number for the Cloud API with its 6-digit two-step verification PIN (for a number that has none yet, this sets it: keep it safe). Needed once after connecting a number that is pending. Returns the number and its account, now connected.
curl -X POST https://getwabi.dev/api/v1/register_phone_number \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"phone_number_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10","pin":"pin"}'npx @meterapp/wabi register_phone_number --json '{"phone_number_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10","pin":"pin"}'{
"type": "object",
"properties": {
"phone_number_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Connected sender id (whatsapp_phone_numbers.id, not Meta's phone_number_id)."
},
"pin": {
"type": "string",
"pattern": "^\\d{6}$",
"description": "The 6-digit two-step verification PIN."
}
},
"required": [
"phone_number_id",
"pin"
]
}check_account_health
writeCheck account health · POST /api/v1/check_account_health · scope accounts:write
Runs the connectivity and permissions health check on a WhatsApp account: access token and permissions, webhook subscription, Meta's account review and business verification, and for each number its registration, quality rating, messaging limit and display name. Each check says ok, warning or error, who controls it (meta: Meta's decision, setup: fixable by you, platform: ours) and the fix. repair: true re-subscribes missing webhooks (admin). Stores the result on the account.
curl -X POST https://getwabi.dev/api/v1/check_account_health \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"account_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'npx @meterapp/wabi check_account_health --json '{"account_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'{
"type": "object",
"properties": {
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "WhatsApp Business Account id in this organization (whatsapp_accounts.id, not Meta's WABA id)."
},
"repair": {
"default": false,
"description": "Fix what can be fixed automatically (re-subscribe webhooks). Needs admin on the account.",
"type": "boolean"
}
},
"required": [
"account_id"
]
}Sync a WhatsApp account · POST /api/v1/sync_whatsapp_account · scope accounts:write
Re-reads a WhatsApp account and its numbers from Meta (name, review and verification status, quality, messaging limits, display names). Webhooks keep these current; use it after changing something in Meta Business Suite.
curl -X POST https://getwabi.dev/api/v1/sync_whatsapp_account \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"account_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'npx @meterapp/wabi sync_whatsapp_account --json '{"account_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'{
"type": "object",
"properties": {
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "WhatsApp Business Account id in this organization (whatsapp_accounts.id, not Meta's WABA id)."
}
},
"required": [
"account_id"
]
}Disconnect a WhatsApp account · POST /api/v1/disconnect_whatsapp_account · scope accounts:write
Stops using a WhatsApp Business Account: unsubscribes its webhooks, revokes the stored token and marks it and its numbers disconnected. Messages, contacts and conversations are kept, and connecting it again restores everything. Nothing changes at Meta: the account and numbers stay the customer's.
curl -X POST https://getwabi.dev/api/v1/disconnect_whatsapp_account \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"account_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'npx @meterapp/wabi disconnect_whatsapp_account --json '{"account_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'{
"type": "object",
"properties": {
"account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "WhatsApp Business Account id in this organization (whatsapp_accounts.id, not Meta's WABA id)."
}
},
"required": [
"account_id"
]
}