Skip to main content

Step 1: Create a customer

curl -X POST https://app.kapso.ai/api/v1/customers \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "name": "Acme Corporation",
      "external_customer_id": "CUS-12345"
    }
  }'
The external_customer_id matches your internal customer ID.
curl -X POST https://app.kapso.ai/api/v1/customers/{customer_id}/setup_links \
  -H "X-API-Key: YOUR_API_KEY"
With customization:
curl -X POST https://app.kapso.ai/api/v1/customers/{customer_id}/setup_links \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "setup_link": {
      "success_redirect_url": "https://your-app.com/whatsapp/success",
      "failure_redirect_url": "https://your-app.com/whatsapp/failed",
      "allowed_connection_types": ["coexistence", "dedicated"],
      "theme_config": {
        "primary_color": "#3b82f6"
      }
    }
  }'
Response:
{
  "data": {
    "id": "link-123abc",
    "status": "active",
    "expires_at": "2024-02-15T10:00:00Z",
    "url": "https://app.kapso.ai/whatsapp/setup/aBcD123...",
    "success_redirect_url": "https://your-app.com/whatsapp/success",
    "failure_redirect_url": "https://your-app.com/whatsapp/failed"
  }
}
Send the setup URL to your customer via:
  • Your app UI
  • Email
  • In-app notification
  • SMS
Links expire after 30 days. Creating a new link revokes the previous one.

Redirect URLs

Success:
https://your-app.com/whatsapp/success?setup_link_id={link_id}&status=completed
Failure:
https://your-app.com/whatsapp/failed?setup_link_id={link_id}&error_code={code}
Error codes:
  • facebook_auth_failed - Facebook login cancelled
  • phone_verification_failed - Phone verification failed
  • waba_limit_reached - WhatsApp account limit exceeded
  • token_exchange_failed - OAuth token exchange failed
  • link_expired - Link expired
  • already_used - Link already used

Connection types

Coexistence - Keep using WhatsApp Business app
  • 5 messages per second
  • App and API work together
Dedicated - API-only access
  • Up to 1000 messages per second
  • Full automation control

More resources

I