Skip to main content
This guide is for SaaS platforms that want each customer to bring their own WhatsApp account. You’ll create a customer record, generate a Kapso setup link, and send it to your user so they can complete Meta’s embedded signup flow.

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 should match 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
  • WhatsApp
  • Email
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}

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

Next steps

I