Skip to main content
You have three ways to detect when customers connect their WhatsApp account through setup links.

1. Project webhooks

Configure a project webhook to receive the whatsapp.phone_number.created event. This is the recommended approach for server-to-server notifications.

Setup

  1. Open Integrations → Webhooks
  2. Go to the Platform webhooks tab
  3. Click Add Webhook
  4. Enter your HTTPS endpoint URL
  5. Copy the auto-generated secret key
  6. Subscribe to whatsapp.phone_number.created event

Webhook payload

Handle the webhook

See webhooks documentation for signature verification and best practices.

2. Success redirect URL

When customers complete WhatsApp setup, they’re redirected to your success_redirect_url with query parameters.

Setup

When creating a setup link, provide redirect URLs:

Query parameters

After successful setup, customer is redirected to:
Parameters:
  • setup_link_id - UUID of the setup link
  • status - Always completed for success
  • phone_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 your failure_redirect_url:
Error codes:
  • facebook_auth_failed - Facebook login cancelled
  • phone_verification_failed - Phone verification failed
  • waba_limit_reached - Too many WhatsApp accounts
  • token_exchange_failed - OAuth failed
  • link_expired - Link expired (30 days)
  • already_used - Link already used
Read a link to see how far the customer got, without waiting for a redirect or a webhook:
Two fields track progress:
string
Lifecycle of the link itself: active, used, expired, or revoked.
string
How far the WhatsApp connection got: pending, processing, completed, or failed.
When whatsapp_setup_status is failed, whatsapp_setup_error carries the reason. When a number was provisioned, provisioned_phone_number carries it:
Use webhooks to react to connections as they happen. Read the link when you need to reconcile state or debug a setup that never reported back.

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
Use success redirect when:
  • 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
Read the setup link when:
  • 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
Most integrations use the first two together: the webhook for backend processing (database updates, welcome messages), the redirect for the frontend experience (success page, next steps). Reading the link is the fallback when neither reported back.