GhalaGhalaHelp Center
Back to ghala.ioghala.ioSign in
    • Ghala Developer API Reference
    • Ghala API vs Meta Cloud API
    • Supported Capabilities
    • Multiple Numbers and Multi-Tenant Platforms
    • Errors and Retries
    • Limits and Quotas
    • Authentication and Access Tokens
    • Connecting and Onboarding a Number
    • Templates and Media
    • Send One-Time Codes
    • Developer Tooling
    • Versioning and Changelog
Ghala

One API and one dashboard for SMS, WhatsApp, Instagram, USSD and voice.

Neurotech AfricaMeta Business Partner badge

Products

  • Ghala
  • Sarufi
  • Snippe
  • Sema

Explore

  • Use Cases
  • Pricing
  • Learn
  • Blog

Developers

  • Docs
  • API Reference
  • API Quickstart
  • Webhooks Guide

Contact

  • SkyCity Mall, 9th Floor, Dar es Salaam, Tanzania
  • info@ghala.io
  • +255 699 920 009
© 2026 Neurotech Company Limited
Terms of ServicePrivacy PolicySitemap
Ghala
  1. Help Center
  2. API Reference
  3. Connecting and Onboarding a Number

Connecting and Onboarding a Number

v2

Prerequisites, Embedded Signup, PIN registration, number states, and why an integration should branch on one flag.

Onboarding is dashboard work

There is no /api/v2 endpoint for connecting a number. Connecting, reconnecting, registering, and disconnecting all happen in the Ghala dashboard.

That is deliberate rather than an omission: onboarding involves a Meta-hosted popup, a Meta login, and in some cases an OTP sent to a physical handset. None of it can be automated from a server without a person present.

What this page gives you is the shape of the process, so you know what your client is going through, what can go wrong, and what state to wait for before your integration starts sending.

Prerequisites

Before anybody clicks anything:

RequirementNotes
A Meta Business PortfolioFormerly "Business Manager". The container that owns the WhatsApp Business Account
A WhatsApp Business Account (WABA)Created during Embedded Signup if you do not have one
A phone number you controlAble to receive an SMS or voice OTP during registration
The number is not already registered to another WhatsApp account you intend to keepA number can only be live on one WhatsApp account at a time
A Facebook account with admin rights on the portfolioThe person completing the flow needs permission to grant access
A Ghala teamThe number is connected into a team, and that team's plan governs API access

If the number is currently in use on the WhatsApp Business App, read the coexistence section below before you start.

Embedded Signup

Dashboard → Add WhatsApp Account, or the account switcher.

Ghala opens Meta's Embedded Signup popup. Everything inside that popup is Meta's: the login, the portfolio picker, the WABA and number selection, and the permission grant. Ghala never sees the client's Facebook password.

The steps a client sees:

  1. Log in to Facebook, as someone with admin rights on the business portfolio.
  2. Choose or create the Business Portfolio.
  3. Choose or create the WhatsApp Business Account.
  4. Choose or add the phone number, and set the business display name.
  5. Verify the number by OTP, if it is new to WhatsApp.
  6. Grant Ghala permission to manage messaging for that number.

When the flow finishes, Meta hands back a short-lived authorization code. Ghala exchanges it for the number's access token, verifies which WABA the token actually belongs to, and discovers the phone number if the popup did not report it. The token is derived from the grant, not from anything the browser claims, so a client cannot connect a number they do not control.

The popup can also finish in a WABA-only variant, where a portfolio and WABA are authorized but no number is selected yet. That leaves the account connected but not sendable, which is what the state fields below are for.

The PIN and registration

WhatsApp numbers use a six-digit two-step verification PIN. Ghala sets one during onboarding and stores it, because the number cannot be registered without it and the client will need it again for WhatsApp Manager.

You can read it at any time from the number's entry in the dashboard, as an explicit reveal action. Withholding it would make Ghala a lock-in point: the PIN is what a merchant needs to take their number elsewhere, so it stays theirs.

Registration is the step that makes a number able to send. If it did not complete during signup, the number's entry offers a retry, which takes the PIN and nothing else. The phone number id and access token come from the stored credential, so nobody can register a number they do not own by supplying their own ids. Retrying is safe: a number that is already live returns success unchanged.

Coexistence and migration

This is the part that goes wrong most often, and the rule is simple:

Registration applies to a new WhatsApp account only. A number already live on the WhatsApp Business App is already registered with Meta, and running registration against it is wrong.

Ghala records how a number arrived as its onboarding method:

Onboarding methodMeaningRegistration
NEW_WHATSAPP_ACCOUNTA number new to the WhatsApp Business PlatformRequired, and retryable
EXISTING_WHATSAPP_BUSINESS_APPMigrated from the WhatsApp Business AppAlready registered with Meta; do not run it
UNKNOWNMethod could not be determinedCheck the number's status before acting

Practical consequences for a number coming off the WhatsApp Business App:

  • Back up chat history first. Migrating to the Cloud API does not carry conversation history across, and it is not recoverable afterwards.
  • The WhatsApp Business App stops working for that number once it is on the platform. There is one live registration per number.
  • Two-factor PIN conflicts are the usual failure. If the number already has a PIN set in the Business App and it is not the one supplied, registration fails.

Number states

A connected number carries several state fields, and the mistake to avoid is branching on the wrong one. A number can have a valid token, a real WABA id, and a phone number id, and still be unable to send a single message.

FieldWhat it tells you
liveWhether the number can actually send. The one flag to branch on
connection_statusWhether the credential is connected, and its current state
registration_statusHow far registration with Meta has got
onboarding_methodNew account, migrated from the Business App, or unknown
action_requiredWhat the merchant must do next, when something is blocking
registered_atWhen registration completed
registration_attempted_atWhen it was last tried
registration_errorWhy the last registration attempt failed
last_status_synced_atWhen Ghala last reconciled against Meta
disconnected_atSet when the number was disconnected
account_blocked_at / account_block_reasonSet when Meta has blocked the account
template_sync_errorWhy templates could not be pulled from Meta
error_messageThe current problem, in words

Branch on live. Every other combination of ids and tokens can look healthy while the number is mute. If your integration has a "is this tenant ready" check, live is it.

Refreshing the state

The dashboard's status check reconciles against Meta before reporting, and this matters more than it sounds. Ghala's record can be stale in the dangerous direction: a registration Meta accepted but Ghala failed to record leaves a number that is live at Meta and pending in Ghala. Re-syncing resolves that rather than re-running registration.

Common onboarding failures

SymptomUsual causeFix
Popup closes with nothing connectedThe client cancelled, or lacks admin rights on the portfolioRetry with an account that has admin rights
The SMS or call code never arrivesMeta's code was blocked, delayed or rate limitedSee The Verification Code Does Not Arrive
Connected, but live is falseRegistration did not completeRetry registration with the PIN
Registration fails repeatedlyThe number already has a different two-step PIN setReset the PIN in WhatsApp Manager, then retry
Registration fails on a migrated numberRegistration was run on a number already registered via the Business AppDo not register; it is already registered
Number connected, no templates appearTemplate sync from Meta failedCheck template_sync_error; re-sync from the dashboard
Display name shows as the raw numberMeta has not approved the display name yetWait for Meta's review; it is Meta's process, not Ghala's
Everything looks right, sends return 402The team's plan lacks API accessUpgrade under Settings → Ghala plan
Everything looks right, sends return 401The token in your integration is staleRe-copy it; a reconnect invalidates the old one

Business display name is reviewed by Meta, not Ghala. A rejected name is resubmitted in WhatsApp Manager. Until it is approved, customers see the number rather than the name.

Reconnecting

Reconnecting runs Embedded Signup again against a number that is already connected, and refreshes its credentials from the new grant.

Reach for it when the token has been leaked, when Meta's grant has been revoked or has otherwise stopped working, or when permissions changed on the portfolio.

Reconnecting issues a new access token and invalidates the old one immediately. There is no overlap window. Every integration holding the previous token starts returning 401 on its next call, so update your stored secret as part of the same task.

Disconnecting

Disconnecting stops the number routing to Ghala: no inbox, no AI agent, no order capture, and no API sends.

It also frees the number to be claimed by another team, so it is not a quiet operation and it is recorded in the audit log. Disconnect when you mean to hand the number back, not as a troubleshooting step.

What an integration should wait for

Before your code sends its first message for a new tenant:

  • The number shows live
  • The team's plan includes API access
  • You hold the number's current access token
  • An event subscription is registered, and you have stored its signing secret
  • GET /api/v2/templates?limit=1 returns 200 — proof of authentication that messages nobody
  • At least one template is sendable, so you can open a conversation outside the 24-hour window

What's next

  • Authentication and Access Tokens — the token this produces
  • Multiple Numbers and Multi-Tenant Platforms — onboarding clients at scale
  • Send Your First WhatsApp Message — once the number is live
PreviousAuthentication and Access TokensNextTemplates and Media

On this page

  • Onboarding is dashboard work
  • Prerequisites
  • Embedded Signup
  • The PIN and registration
  • Coexistence and migration
  • Number states
  • Refreshing the state
  • Common onboarding failures
  • Reconnecting
  • Disconnecting
  • What an integration should wait for
  • What's next