Auphere
Documentation menu

Auphere Partner API · Getting started

/ v0.1

Quickstart

Take one client from "just signed up in your product" to "agent answering on their own WhatsApp" — four calls from your backend.

Everything below runs from your backend with your secret key. Nothing here belongs in a browser.

The four calls

  1. Provision the client

    Call this wherever your product creates the business record. It is idempotent on external_client_ref — use your own stable id (a UUID works well). This clones your blueprint into an isolated, personalised agent.

    POST /v1/partners/clients
    curl -X POST https://api.auphere.com/v1/partners/clients \
      -H "Authorization: Bearer $AUPHERE_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "external_client_ref": "3f6c1a2e-9d41-4b7f-8f2a-0c5d9e1b7a44",
        "name": "Bodegón El Ávila",
        "timezone": "America/Caracas",
        "agent": {
          "placeholders": {
            "policies.admin_access.admin_phones": ["+584241234567"]
          }
        }
      }'
  2. Get the Meta identifiers

    Your frontend needs these to open Facebook Login for Business. Use coexistence_config_id so the business keeps using the WhatsApp Business app on their phone.

    GET /v1/partners/whatsapp/signup-config
    curl https://api.auphere.com/v1/partners/whatsapp/signup-config \
      -H "Authorization: Bearer $AUPHERE_SECRET_KEY"
    
    # → { "app_id": "…", "coexistence_config_id": "…",
    #     "cloud_api_config_id": "…", "graph_api_version": "v23.0" }
  3. Complete the WhatsApp connection

    Meta hands your frontend a single-use code; forward it from your backend. We register the number, subscribe the webhook, store credentials encrypted and — if your blueprint auto-activates — the agent starts answering.

    POST /v1/partners/clients/{ref}/whatsapp/signup
    curl -X POST \
      https://api.auphere.com/v1/partners/clients/$CLIENT_REF/whatsapp/signup \
      -H "Authorization: Bearer $AUPHERE_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "code": "<oauth code de Meta>", "waba_id": "<waba>", "mode": "coexistence" }'
    
    # → { "status": "connected", "display_phone_number": "+584241234567",
    #     "tenant_status": "active", "tenant_activated": true }
  4. Send a campaign

    Same endpoint for one recipient or for thousands. 202 means queued and durable — delivery is asynchronous and you can poll it.

    POST /v1/partners/clients/{ref}/broadcasts
    curl -X POST \
      https://api.auphere.com/v1/partners/clients/$CLIENT_REF/broadcasts \
      -H "Authorization: Bearer $AUPHERE_BROADCAST_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "template_name": "recordatorio_pago_vencido",
        "language": "es",
        "idempotency_key": "factura-991-aviso-1",
        "recipients": [
          { "phone": "+584241234567",
            "variables": { "cliente": "Ana", "monto": "36.00", "fecha": "12/08" } }
        ]
      }'

Knowing where a client stands

One read tells your UI what to render: an onboarding prompt, or the campaign screen. missing lists what is still pending (agent, whatsapp, admins, activation).

GET /v1/partners/clients/{ref}
curl https://api.auphere.com/v1/partners/clients/$CLIENT_REF \
  -H "Authorization: Bearer $AUPHERE_SECRET_KEY"

# → { "status": "active", "whatsapp_connected": true,
#     "agent_configured": true, "admins_count": 1,
#     "ready": true, "missing": [] }

The one human step

Everything above is automatic except the Meta authorisation: someone with access to the client’s Meta Business account has to complete the popup. Your admin can do it on the client’s behalf if they have delegated access — the flow does not care who clicks, only that the session has access.