1. Project webhooks
Configure a project webhook to receive thewhatsapp.phone_number.created event. This is the recommended approach for server-to-server notifications.
Setup
- Open Integrations → Webhooks
- Go to the Platform webhooks tab
- Click Add Webhook
- Enter your HTTPS endpoint URL
- Copy the auto-generated secret key
- Subscribe to
whatsapp.phone_number.createdevent
Webhook payload
Handle the webhook
2. Success redirect URL
When customers complete WhatsApp setup, they’re redirected to yoursuccess_redirect_url with query parameters.
Setup
When creating a setup link, provide redirect URLs:Query parameters
After successful setup, customer is redirected to:setup_link_id- UUID of the setup linkstatus- Alwayscompletedfor successphone_number_id- WhatsApp phone number ID (primary identifier)business_account_id- Meta WABA ID (if available)whatsapp_config_id- Legacy identifier (provided for backward compatibility)provisioned_phone_number_id- Kapso phone number ID (if provisioning was used)display_phone_number- E.164 formatted phone number (URL encoded)
Handle the redirect
These parameters are convenience identifiers to avoid extra API fetches. Use
phone_number_id as the primary identifier.Failure redirect
If setup fails, customer is redirected to yourfailure_redirect_url:
facebook_auth_failed- Facebook login cancelledphone_verification_failed- Phone verification failedwaba_limit_reached- Too many WhatsApp accountstoken_exchange_failed- OAuth failedlink_expired- Link expired (30 days)already_used- Link already used
3. Read the setup link
Read a link to see how far the customer got, without waiting for a redirect or a webhook:string
Lifecycle of the link itself:
active, used, expired, or revoked.string
How far the WhatsApp connection got:
pending, processing, completed, or failed.whatsapp_setup_status is failed, whatsapp_setup_error carries the reason. When a number was provisioned, provisioned_phone_number carries it:
Choosing the right method
Use project webhooks when:- You need server-to-server notification
- Customer doesn’t need immediate visual feedback
- You’re building automated onboarding flows
- You need to process the connection before showing UI
- Customer needs immediate confirmation in your app
- You want to show a custom success page
- You’re building a wizard-style onboarding flow
- You need to collect additional information after connection
- You need to reconcile state after a webhook never arrived
- You’re debugging a setup that failed and want the error
- You’re checking status on demand rather than reacting to an event

