Auphere
Documentation menu

Auphere Partner API · Guides

/ v0.1

Connecting WhatsApp

Link each client's own WhatsApp Business number to their agent, from your own product, using Meta Embedded Signup.

Each of your clients sends from their own WhatsApp Business number, not from a shared one. Linking that number is the only step in the whole flow that needs a human: someone with access to the client’s Meta Business account has to authorize it.

What the client needs

  • A Meta Business account they can log into (or a delegated admin who can).
  • A phone number for WhatsApp Business — new, or one already on the WhatsApp Business app.
  • The number must not be linked to another Auphere workspace.

1. Fetch the Meta identifiers

The popup runs under our Meta App, so your frontend needs our public identifiers. Read them at runtime instead of hardcoding — they can change without notice.

Request
GET https://api.auphere.com/v1/partners/whatsapp/signup-config
Authorization: Bearer ak_live_…

{
  "app_id": "957213733862330",
  "coexistence_config_id": "…",
  "cloud_api_config_id": "…",
  "graph_api_version": "v23.0"
}

Load the Facebook JS SDK on the page and call FB.login with the config id. Meta returns a single-use code — send it to your backend, never to us from the browser.

Your frontend
// Your settings/onboarding page. The identifiers come from
// GET /v1/partners/whatsapp/signup-config — never hardcode them.
FB.login(
  (response) => {
    const code = response.authResponse?.code;
    if (!code) return; // user closed the popup
    // Hand the code to YOUR backend; it finishes the flow.
    fetch("/api/auphere/whatsapp-connected", {
      method: "POST",
      body: JSON.stringify({ clientId, code }),
    });
  },
  {
    config_id: coexistenceConfigId,
    response_type: "code",
    override_default_response_type: true,
  },
);

3. Finish it from your backend

One call closes the loop: we exchange the code, register the number, subscribe our webhook, store the credentials encrypted and attach the channel to that client’s agent.

Request
POST https://api.auphere.com/v1/partners/clients/{external_client_ref}/whatsapp/signup
Authorization: Bearer ak_live_…
Content-Type: application/json

{
  "code": "<single-use code from Meta>",
  "waba_id": "<waba id from the signup event>",
  "mode": "coexistence"
}
Response
{
  "status": "connected",
  "waba_id": "…",
  "phone_number_id": "…",
  "display_phone_number": "+584241234567",
  "mode": "coexistence",
  "tenant_status": "active",
  "tenant_activated": true,
  "activation_blocked_reason": null
}

Reading the activation result

A successful connection usually also flips the client live. When it does not, activation_blocked_reason says why:

tenant_statusactivation_blocked_reasonWhat it means
activenullDone — the agent is answering on that number.
provisioningno_agentThe client has no agent yet. Check the provisioning call succeeded.
provisioningoperator_reviewYour blueprint does not auto-activate; an Auphere operator reviews and activates.