You have two ways to detect when customers connect their WhatsApp account through setup links.Documentation Index
Fetch the complete documentation index at: https://docs.kapso.ai/llms.txt
Use this file to discover all available pages before exploring further.
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 the sidebar and click Webhooks
- Go to the Project 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
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
- Webhook for backend processing (database updates, welcome messages)
- Redirect for frontend experience (success page, next steps)

