> ## 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.

# Onboard customers with your own Meta app

> Use Kapso setup links with your own Meta app and embedded signup configuration

Onboard customers through Kapso setup links under your own Meta app, without MPS. Kapso runs messaging; customers pay Meta fees directly.

## At a glance

1. [Configure Embedded Signup](#configure-facebook-login-for-business) and [save the configuration in Kapso](#add-the-config-id-in-kapso).
2. [Create a Kapso customer](#create-customers) for each business you serve.
3. [Generate a setup link](#generate-setup-links) and let the customer connect their WhatsApp account.
4. [Confirm the connection](#detect-completion) and [start messaging](#operate-the-customer-number).

> [!NOTE]
>
> Without MPS, Kapso can't pay Meta for your customers: each customer adds their own payment method in Meta. For [managed billing](https://docs.kapso.ai/docs/platform/tech-providers/billing.md) with your own app, set up a [Multi-partner Solution](https://docs.kapso.ai/docs/platform/tech-providers/multi-partner-solutions.md), or use [Kapso's Meta app](https://docs.kapso.ai/docs/platform/setup-links/create-and-configure.md#meta-billing-policy).

## Requirements

You need:

* a [Meta app](https://docs.kapso.ai/docs/platform/create-meta-app.md)
* Facebook Login for Business on that app
* an embedded signup configuration ID
* [Be a Meta Tech Provider](https://docs.kapso.ai/docs/platform/become-tech-provider.md).

## Configure Facebook Login for Business

In your Meta app:

1. Add **Facebook Login for Business** if it is not already present.
2. Open **Facebook Login for Business > Configurations**.
3. Create a configuration from the WhatsApp embedded signup template when available.
4. If you create a custom configuration, choose the **WhatsApp Embedded Signup** login variation.
5. Select only the assets and permissions your customers need.
6. Save the configuration.
7. Copy the generated **Configuration ID**.

This Configuration ID is the **Embedded signup config ID** Kapso asks for.

## Add domains for embedded signup

In **Facebook Login for Business > Settings**, configure the OAuth and JavaScript SDK settings required by Meta.

Add the domains where customers launch setup links or embedded signup. For Kapso-hosted setup links, include the Kapso setup domain shown in the generated link, usually `app.kapso.ai`. If you launch setup from your own app, include your app domain too.

Meta requires HTTPS domains for embedded signup.

## Add the config ID in Kapso

1. In Kapso, open **Phone numbers > Meta apps**.
2. Edit or add your Meta app.
3. Turn on **Default app for embedded signup**.
4. Paste the **Embedded signup config ID**.
5. Save.

Kapso setup links and reconnect flows can now use this app for embedded signup.

## Add pool credentials to your Meta app

Do this only if the project uses [project-owned pools](https://docs.kapso.ai/docs/platform/phone-numbers/provide-local-numbers.md#pre-verified-project-pools), including imported numbers. Embedded signup and messaging do not need these values.

Kapso pre-verifies pool numbers in the business portfolio that owns your Meta app. For that, Kapso needs a system user token from that portfolio.

1. In Meta Business Settings, open **Business info**. Copy the **Business portfolio ID** of the portfolio that owns your Meta app.
2. Open **Users > System users**. Select an admin system user, or create one.
3. Assign your Meta app to that system user.
4. Generate a token for your Meta app with the `whatsapp_business_management` permission. Set the expiration to **Never**.
5. In Kapso, open **Phone numbers > Meta apps** and edit your default app.
6. Open **Project-owned number pools**.
7. Paste the **Business portfolio ID** and the **System access token**, then save.

Kapso hides the token after you save it. To replace the token, paste a new one. To keep it, leave the field blank.

## Create customers

Create one Kapso customer per business you serve.

```bash theme={null}
curl -X POST https://api.kapso.ai/platform/v1/customers \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "name": "Acme Clinic",
      "external_customer_id": "acme-clinic"
    }
  }'
```

Use `external_customer_id` to map Kapso customers back to your own database.

## Generate setup links

Create a setup link for each customer.

```bash theme={null}
curl -X POST https://api.kapso.ai/platform/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",
      "meta_billing_mode": "customer_managed",
      "allowed_connection_types": ["dedicated"]
    }
  }'
```

Send the returned `url` to the customer or open it from your onboarding UI.

To launch onboarding directly inside your own product through an active Multi-partner Solution, see [Embed WhatsApp onboarding](https://docs.kapso.ai/docs/platform/tech-providers/embed-onboarding.md).

Use `allowed_connection_types` to control the customer path:

* `["dedicated"]` for API-only WhatsApp Cloud API numbers
* `["coexistence"]` for customers who want to keep using the WhatsApp Business App alongside Kapso
* `["coexistence", "dedicated"]` when you want the customer to choose

If you want Kapso to provision a number during setup, add:

```json theme={null}
{
  "setup_link": {
    "provision_phone_number": true,
    "phone_number_country_isos": ["US"]
  }
}
```

## Detect completion

Use both redirect handling and webhooks.

The success redirect can include setup details such as:

* `status`
* `phone_number_id`
* `business_account_id`
* `display_phone_number`
* `setup_link_id`

For server-side reliability, subscribe to Kapso project webhooks and listen for `whatsapp.phone_number.created`.

See [Detecting WhatsApp connection](https://docs.kapso.ai/docs/platform/setup-links/detect-connection.md) and [Webhooks](https://docs.kapso.ai/docs/platform/webhooks/overview.md).

## Operate the customer number

After setup completes, use the customer's `phone_number_id`.

```bash theme={null}
curl -X POST https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/messages \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "to": "15551234567",
    "type": "text",
    "text": {
      "body": "Your appointment is confirmed."
    }
  }'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.