/whatsapp-accounts/onboarding-sessionsA single-use link your customer opens to connect their WhatsApp number to your organization.
Create an onboarding link
Meta runs its signup dialog only on domains allowlisted on the Meta app, so it cannot run on your site with Aethex's app. Send your customer to url instead. An Aethex-hosted page runs Meta's dialog, connects the number to your organization with the agent you chose, and sends your customer to return_url with whatsapp_onboarding_session, status, whatsapp_account_id and your state. The agent's webhook receives a signed whatsapp.onboarding.completed event. url is returned only in this response and its secret is stored hashed. The link can be retried until it completes or expires. Links stop working if your organization's account is closed or suspended: they then answer like a link that does not exist.
Request body
5return_urlstring (https URL)requiredWhere your customer is sent back, finished or cancelled. HTTPS, with no credentials or #fragment. Aethex adds
whatsapp_onboarding_session,status,whatsapp_account_id(when completed) andstate.statestringoptionalOpaque value of yours (up to 512 characters), returned unchanged on
return_urland in the event, such as your customer's id.default_agent_idstring (uuid)optionalThe agent that answers messages and calls on this number.
labelstringoptionalA name for this number in your own dashboard. Never shown to customers.
expires_in_secondsintegeroptionalHow long the link works: 300 to 604800 seconds (5 minutes to 7 days). Default 86400 (24 hours).
Errors
3Code whatsapp_hosted_onboarding_requires_billing: your organization has no payment method on file and is not on a paid plan. The page names your organization on Aethex's domain, so only an accountable account may issue links.
Add a payment method in Billing, or move to a paid plan, then create the link again.
return_url is not an absolute HTTPS URL, default_agent_id is not a UUID, or expires_in_seconds is out of range.
Correct the field named in fields and send it again.
Code whatsapp_hosted_onboarding_unavailable: hosted onboarding is not available on this deployment yet. Nothing was created.
Retry later, or link numbers you manage yourself with POST /whatsapp-accounts.
