Embedded Signup

Onboard WhatsApp Business numbers to your App via Meta's Embedded Signup flow.

BYON numbers are onboarded through Meta's Embedded Signup — a guided flow that connects a WhatsApp Business number to PipesBot and grants the necessary API permissions.

Starting the flow

From your App's Numbers tab, click Connect Number. This opens Meta's Embedded Signup dialog where the number owner:

  1. Logs into their Meta Business account
  2. Selects or creates a WhatsApp Business Account (WABA)
  3. Selects the phone number to connect
  4. Grants PipesBot permission to manage messages

Numbers already on the WhatsApp Business app

Every Embedded Signup started by PipesBot, from the dashboard or from a signup link, supports Coexistence. If the number is registered on the WhatsApp Business app, choose the option to connect your existing WhatsApp Business app number, then confirm in the app on the phone. The number keeps working in the app, and your App sends and receives through the API.

Don't migrate or disconnect

To keep the app working, never pick migrate or disconnect in Meta's flow. If Meta only offers Add a new number and says the number is already registered to a WhatsApp account, stop and contact us.

What happens during signup

When the flow completes, PipesBot automatically:

StepDescription
Token storageStores the access token granted by Meta, encrypted at rest
Webhook configurationSubscribes to Meta's webhook for the connected WABA
Number linkingAssociates the BYON number with your App via appId and activates it immediately

All of this happens in the background — you'll see the new number appear in your App's number list within a few seconds.

Token lifecycle

The access token provided by Meta is a System User Token with a long expiry. PipesBot monitors token health. Each number's own status is active or unhealthy (driven by whether its token is broken). The healthy / degraded / down values you see are the App-level aggregate across its numbers — see Number Management.

If a token breaks (e.g. the user revokes access in Meta Business Manager), the number's health status changes and you'll see a warning in your dashboard. To fix it, remove the number and re-run Embedded Signup.

Who can complete signup

The person completing the Embedded Signup flow must have admin access to the Meta Business Account that owns the WhatsApp number. This is typically:

  • Your customer (if you're building a product for others)
  • You (if connecting your own business number)

Programmatic signup via API

If you need to start the Embedded Signup flow programmatically (e.g. from your own onboarding UI), use the token endpoint to generate a one-time signup URL.

POST /v1/apps/token
Authorization: Bearer ak_your_app_key
Content-Type: application/json

Request

FieldTypeDescription
redirectUrlstring?Optional. URL the user is redirected to after signup. Must be HTTPS unless the host is localhost/127.0.0.1, else 400 "redirectUrl must use HTTPS protocol". Stored as null when omitted
metadataobject?Optional. Arbitrary metadata stored with the session (defaults to {})
importHistoryboolean?Optional. Import the number's chat history if it connects with Coexistence. Overrides the App's Import chat history setting for this link. API v2 only, ignored on legacy Apps. A non-boolean returns 400 "importHistory must be a boolean"
importContactsboolean?Optional. Same for the phone's contact list. Overrides the App's Import contacts setting for this link. A non-boolean returns 400 "importContacts must be a boolean"
localestring?Optional. Forces the signup page language for this link: en, es or pt-BR. Any other value returns 400 "locale must be one of: en, es, pt-BR"

Response

{
  "token": "<JWT>",
  "expiresAt": "2025-01-15T10:45:00.000Z"
}

The token is an HS256 JWT valid for 15 minutes and single-use — its JTI is consumed when signup completes, so it can onboard exactly one number.

Usage

Use the returned token to redirect the user to the signup flow:

https://app.pipes.bot/apps/{slug}?token={token}

The signup URL completes by calling POST /v1/apps/onboard with the token and Meta's authorization code. Once the number is ready, the user is redirected to your redirectUrl with ?numberId=&phone= appended. While a step is pending, such as the two-step verification PIN, the user stays on the signup page.

Signup page language

The signup page is available in English (en), Spanish (es) and Brazilian Portuguese (pt-BR). The language is picked in this order:

  1. The locale you passed to POST /v1/apps/token, if any.
  2. The customer's browser languages, in order. Regional variants match on the language, so pt-PT shows pt-BR and es-419 shows es.
  3. English.

Pass locale when you already know your customer's language, for example from their account settings:

{ "redirectUrl": "https://yourapp.com/onboarding/complete", "locale": "pt-BR" }

If the customer reopens the link to finish a pending step, the page keeps the language you forced.

Some text on the page doesn't follow this setting:

  • Meta's signup popup. It uses the language of the customer's Facebook account, so the page and the popup can differ.
  • Your App's name, logo and tagline. They are shown as you wrote them.

Numbers connected from the dashboard aren't affected: the dashboard is in English.

Example

const res = await fetch("https://api.pipes.bot/v1/apps/token", {
  method: "POST",
  headers: {
    Authorization: "Bearer ak_your_app_key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    redirectUrl: "https://yourapp.com/onboarding/complete",
    metadata: { partnerId: "partner_123" },
  }),
});

const { token, expiresAt } = await res.json();

// Redirect the user to complete Embedded Signup
const signupUrl = `https://app.pipes.bot/apps/your-app-slug?token=${token}`;

The metadata object is stored with the onboarding session and can be used to correlate the signup with your internal records.

Next steps

On this page