Skip to content

Accounts

Accounts represent your WhatsApp Business API connections. Each account is linked to a phone number (phone_id) registered under a WhatsApp Business Account (business_id) on Meta's WhatsApp Business Platform.

Retrieve all connected WhatsApp accounts for the organization.

Terminal window
GET /api/accounts
{
"status": "success",
"data": {
"accounts": [
{
"id": "uuid",
"name": "Main Business",
"app_id": "1234567890",
"phone_id": "123456789",
"business_id": "987654321",
"api_version": "v21.0",
"is_default_incoming": true,
"is_default_outgoing": true,
"auto_read_receipt": false,
"business_calling_enabled": false,
"status": "active",
"has_access_token": true,
"has_app_secret": true,
"phone_number": "+1234567890",
"display_name": "Main Business",
"created_by_name": "Admin User",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
]
}
}

Retrieve a single account.

Terminal window
GET /api/accounts/{id}
{
"status": "success",
"data": {
"id": "uuid",
"name": "Main Business",
"app_id": "1234567890",
"phone_id": "123456789",
"business_id": "987654321",
"webhook_verify_token": "your_verify_token",
"api_version": "v21.0",
"is_default_incoming": true,
"is_default_outgoing": true,
"auto_read_receipt": false,
"business_calling_enabled": false,
"status": "active",
"has_access_token": true,
"has_app_secret": true,
"phone_number": "+1234567890",
"display_name": "Main Business",
"created_by_id": "uuid",
"created_by_name": "Admin User",
"updated_by_id": "uuid",
"updated_by_name": "Admin User",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
}
FieldTypeDescription
phone_idstringMeta phone number ID
business_idstringWhatsApp Business Account (WABA) ID
has_access_tokenbooleanWhether an access token is stored (the token itself is never returned)
has_app_secretbooleanWhether a Meta App Secret is stored
phone_numberstringThe display phone number, when available
display_namestringVerified display name, when available
statusstringAccount status (see table below)
created_by_name / updated_by_namestringNames of the users who created/last updated the account

Connect a new WhatsApp Business account manually.

Terminal window
POST /api/accounts
{
"name": "Support Line",
"phone_id": "123456789",
"business_id": "987654321",
"access_token": "EAAxxxx...",
"app_id": "1234567890",
"app_secret": "your_meta_app_secret",
"api_version": "v21.0",
"webhook_verify_token": "your_custom_verify_token",
"is_default_incoming": false,
"is_default_outgoing": false,
"auto_read_receipt": false,
"business_calling_enabled": false
}
FieldTypeRequiredDescription
namestringYesHuman-readable account name
phone_idstringYesMeta phone number ID
business_idstringYesWhatsApp Business Account (WABA) ID
access_tokenstringYesMeta access token (stored encrypted)
app_idstringNoMeta App ID
app_secretstringNoMeta App Secret for webhook signature verification (stored encrypted)
webhook_verify_tokenstringNoVerify token; auto-generated if omitted
api_versionstringNoGraph API version; defaults to the server default (e.g. v21.0)
is_default_incomingbooleanNoUse this account as the default for incoming messages
is_default_outgoingbooleanNoUse this account as the default for outgoing messages
auto_read_receiptbooleanNoAutomatically send read receipts for incoming messages
business_calling_enabledbooleanNoEnrolled in the Business Calling API (required to send Call buttons)

Returns the created account in the same shape as Get Account.

Update account settings. Send only the fields you want to change; omitted string fields are left unchanged.

Terminal window
PUT /api/accounts/{id}
{
"name": "Customer Support",
"access_token": "EAAyyyy...",
"auto_read_receipt": true
}

Remove a WhatsApp account connection.

Terminal window
DELETE /api/accounts/{id}
{
"status": "success",
"data": {
"message": "Account deleted successfully"
}
}

Verify the account credentials against Meta and fetch live phone details.

Terminal window
POST /api/accounts/{id}/test
{
"status": "success",
"data": {
"success": true,
"display_phone_number": "(123) 456-7890",
"verified_name": "Your Business Name",
"quality_rating": "GREEN",
"messaging_limit_tier": "TIER_1K",
"code_verification_status": "VERIFIED",
"account_mode": "LIVE",
"is_test_number": false
}
}

Register the phone number with Meta and set a two-step verification PIN. Used to complete manual or embedded-signup setup. A random 6-digit PIN is generated if none is supplied. SMB (Business App) numbers are already registered and skip this step.

Terminal window
POST /api/accounts/{id}/register
{
"pin": "123456"
}
{
"status": "success",
"data": {
"success": true,
"message": "Phone number registered successfully",
"pin": "123456"
}
}

Subscribe the app to webhooks for the account's WhatsApp Business Account. Required after registration to start receiving incoming messages.

Terminal window
POST /api/accounts/{id}/subscribe
{
"status": "success",
"data": {
"success": true,
"message": "App subscribed to webhooks successfully. You should now receive incoming messages."
}
}

The business profile is fetched from and pushed to Meta live; it is not stored locally.

Terminal window
GET /api/accounts/{id}/business_profile
{
"status": "success",
"data": {
"messaging_product": "whatsapp",
"address": "123 Main St",
"description": "We sell great things",
"vertical": "RETAIL",
"email": "hello@example.com",
"websites": ["https://example.com"],
"profile_picture_url": "https://...",
"about": "Open 9-5"
}
}
Terminal window
PUT /api/accounts/{id}/business_profile
{
"messaging_product": "whatsapp",
"address": "123 Main St",
"description": "We sell great things",
"vertical": "RETAIL",
"email": "hello@example.com",
"websites": ["https://example.com"],
"about": "Open 9-5"
}

Returns the refreshed profile (or { "message": "Profile updated successfully" } if the re-fetch fails).

Upload a new profile picture. Send the image as multipart/form-data with a file field.

Terminal window
POST /api/accounts/{id}/business_profile/photo
{
"status": "success",
"data": {
"message": "Profile picture updated successfully",
"handle": "meta-upload-handle"
}
}

Whatomate supports Meta's Embedded Signup flow, letting users connect a WhatsApp Business account without manually copying credentials. See the Embedded Signup feature guide for the end-to-end flow.

Public helper the frontend uses to bootstrap the Meta JS SDK with the org's app credentials.

Terminal window
GET /api/embedded-signup/config
{
"status": "success",
"data": {
"whatsapp_app_id": "1234567890",
"whatsapp_config_id": "9876543210",
"whatsapp_api_version": "v21.0"
}
}

Exchange the temporary authorization code returned by the Embedded Signup dialog for a permanent access token, then create (or update) the account. Phone and WABA IDs are auto-discovered from the token if omitted, and the flow attempts auto-registration and webhook subscription.

Terminal window
POST /api/accounts/exchange-token
{
"code": "AQD...",
"phone_id": "123456789",
"waba_id": "987654321",
"name": "Support Line",
"webhook_verify_token": "your_custom_verify_token"
}

Only code is required — phone_id, waba_id, name, and webhook_verify_token are optional.

{
"status": "success",
"data": {
"account": {
"id": "uuid",
"name": "Support Line",
"phone_id": "123456789",
"business_id": "987654321",
"status": "active",
"has_access_token": true
},
"pin": "123456",
"warning": "Registration failed: ..."
}
}

pin is present only when auto-registration succeeded; warning is present only when registration failed. See the Embedded Signup guide for details.

StatusDescription
pending_registrationAccount created via embedded signup, phone number not yet registered
activeAccount is connected and working

The Test Connection endpoint surfaces Meta's live quality rating for the phone number:

RatingDescription
GREENHigh quality, no issues
YELLOWSome issues, review messages
REDLow quality, account at risk