> ## Documentation Index
> Fetch the complete documentation index at: https://www.vobiz.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# WhatsApp Webhooks API — Subscribe to Delivery & Inbound Events

> Manage Vobiz outbound webhook subscriptions and the inbound Meta callback - receive WhatsApp messages, delivery status, and call events on your server.

Two separate webhook systems work together in a Vobiz WhatsApp integration. See the [Webhooks overview](https://www.vobiz.ai/docs/whatsapp/webhooks.md) for the conceptual split.

| System | Direction | Purpose |
| - | - | - |
| **Inbound** | Meta → Vobiz | Meta delivers raw WhatsApp Cloud API events to a Vobiz endpoint. Platform plumbing you set once in your Meta App. |
| **Outbound** | Vobiz → your server | Vobiz forwards a signed event envelope to the endpoint URL you register here. |

All endpoints are under the base URL `https://api.vobiz.ai/api/v1/Account/{auth_id}/WhatsApp`, except the inbound Meta callback which is at `https://api.vobiz.ai/api/v1/webhooks/whatsapp`.

## Inbound (Meta → Vobiz)

These endpoints are called **by Meta**, not by your application. You normally configure the callback URL and verify token once inside your Meta App. The examples below are for understanding and local simulation only.

### Verify webhook (challenge-response)

```http theme={null}
GET https://api.vobiz.ai/api/v1/webhooks/whatsapp
```

When you register the webhook in your Meta App, Meta sends a `GET` with the standard `hub.*` query params. Vobiz echoes the `hub.challenge` back as `text/plain` `200` **only when** `hub.verify_token` matches the token configured on the Vobiz side. **No auth header** is used on this endpoint.

| Param | Description |
| - | - |
| `hub.mode` | Always `subscribe`. |
| `hub.verify_token` | The verify token you set. Must match the Vobiz-side token or the request is rejected with `403`. |
| `hub.challenge` | Random string Meta expects echoed back verbatim. |

```bash Simulate Meta's verification theme={null}
curl -X GET \
  "https://api.vobiz.ai/api/v1/webhooks/whatsapp?hub.mode=subscribe&hub.verify_token=<your-verify-token>&hub.challenge=test_challenge_123"
```

```text 200 OK theme={null}
test_challenge_123
```

### Receive webhook (Meta callback)

```http theme={null}
POST https://api.vobiz.ai/api/v1/webhooks/whatsapp
```

Meta `POST`s the WhatsApp Cloud API event here. Meta signs the request with `X-Hub-Signature-256: sha256=<hex HMAC-SHA256 of the raw body, keyed by your Meta App Secret>`. Vobiz verifies that signature and enforces a **replay window**, rejecting stale or future-dated payloads. The body is the standard Meta envelope (`object` = `whatsapp_business_account`, `entry[].changes[].value` carrying `messaging_product`, `metadata`, and any of `contacts[]`, `messages[]`, `statuses[]`, `calls[]`).

```bash Simulate a delivery status callback theme={null}
curl -X POST \
  "https://api.vobiz.ai/api/v1/webhooks/whatsapp" \
  -H "Content-Type: application/json" \
  -H "X-Hub-Signature-256: sha256=<hex_hmac_of_raw_body>" \
  -d '{"object":"whatsapp_business_account","entry":[{"id":"<waba_id>","changes":[{"field":"messages","value":{"messaging_product":"whatsapp","metadata":{"display_phone_number":"919876543210","phone_number_id":"<phone_number_id>"},"statuses":[{"id":"wamid.test","status":"delivered","recipient_id":"918888888888","timestamp":"1711360805"}]}}]}]}'
```

```text 200 OK theme={null}
// Empty body on success
```

After Vobiz accepts an inbound Meta event, it fans it out to your registered subscriptions as an [outbound webhook](#outbound-vobiz-to-your-server).

## Outbound (Vobiz to your server)

Register an HTTPS endpoint and a shared secret. Vobiz then delivers a signed event envelope to your endpoint for the three supported event types. See the [Event Reference](https://www.vobiz.ai/docs/whatsapp/webhooks/events.md) for envelope and payload shapes, and the [overview](https://www.vobiz.ai/docs/whatsapp/webhooks.md#verifying-the-signature) for signature verification.

**Authentication (subscription management):** every request needs the `X-Auth-ID: MA_XXXXXXXX` and `X-Auth-Token: YOUR_AUTH_TOKEN` headers, and the `{auth_id}` in the path must be the account those credentials belong to. Get credentials from [console.vobiz.ai](https://console.vobiz.ai).

### Create webhook subscription

```http theme={null}
POST https://api.vobiz.ai/api/v1/Account/{auth_id}/WhatsApp/Webhook/
```

Register an HTTPS endpoint to receive events. Subscribing a URL you already have replaces its secret and reactivates it. A missing `url` or `secret` returns `400`. Returns `201 Created`; the secret isn't returned.

| Field | Required | Description |
| - | - | - |
| `url` | Yes | HTTPS endpoint that will receive event deliveries. Sending a URL you already subscribed replaces its secret. |
| `secret` | Yes | Shared secret used to sign deliveries (HMAC-SHA256 → `X-Webhook-Signature`). Store it securely - it is **never** returned in any response. |

```bash cURL theme={null}
curl -X POST \
  "https://api.vobiz.ai/api/v1/Account/MA_XXXXXXXX/WhatsApp/Webhook/" \
  -H "X-Auth-ID: MA_XXXXXXXX" \
  -H "X-Auth-Token: YOUR_AUTH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/webhooks/whatsapp","secret":"YOUR_WEBHOOK_SECRET"}'
```

```json 201 Created theme={null}
{
  "id": "6a1c3e5b-7d9f-4b2a-8c4e-6f8a0b2c4d16",
  "url": "https://example.com/webhooks/whatsapp",
  "status": "active",
  "created_at": "2026-03-25T10:00:00Z",
  "updated_at": "2026-03-25T10:00:00Z"
}
```

| Field | Type | Description |
| - | - | - |
| `id` | string (UUID) | Subscription identifier. |
| `url` | string | Your registered HTTPS endpoint. |
| `status` | string | Subscription state, for example `active`. |
| `created_at` | string (RFC3339, UTC) | Creation timestamp. |
| `updated_at` | string (RFC3339, UTC) | Last-update timestamp. |

### List webhook subscriptions

```http theme={null}
GET https://api.vobiz.ai/api/v1/Account/{auth_id}/WhatsApp/Webhook/
```

Returns the webhook subscriptions for your account, newest first. The `secret` is never included.

```bash cURL theme={null}
curl -X GET \
  "https://api.vobiz.ai/api/v1/Account/MA_XXXXXXXX/WhatsApp/Webhook/" \
  -H "X-Auth-ID: MA_XXXXXXXX" \
  -H "X-Auth-Token: YOUR_AUTH_TOKEN"
```

```json 200 OK theme={null}
{
  "items": [
    {
      "id": "6a1c3e5b-7d9f-4b2a-8c4e-6f8a0b2c4d16",
      "url": "https://example.com/webhooks/whatsapp",
      "status": "active",
      "created_at": "2026-03-25T10:00:00Z",
      "updated_at": "2026-03-25T10:00:00Z"
    }
  ]
}
```

### Delete webhook subscription

```http theme={null}
DELETE https://api.vobiz.ai/api/v1/Account/{auth_id}/WhatsApp/Webhook/{id}/
```

Remove a subscription by its UUID. Vobiz stops delivering events to that URL. Returns `204 No Content`, or `404` for an unknown subscription.

```bash cURL theme={null}
curl -X DELETE \
  "https://api.vobiz.ai/api/v1/Account/MA_XXXXXXXX/WhatsApp/Webhook/6a1c3e5b-7d9f-4b2a-8c4e-6f8a0b2c4d16/" \
  -H "X-Auth-ID: MA_XXXXXXXX" \
  -H "X-Auth-Token: YOUR_AUTH_TOKEN"
```

```text 204 No Content theme={null}
// Empty body on success
```

## Delivery to your endpoint

When an event fires, Vobiz sends a `POST` to your registered `url` with:

**Headers**

| Header | Description |
| - | - |
| `X-Webhook-Signature` | Hex-encoded HMAC-SHA256 of the exact raw request body, keyed by your subscription `secret`. **No** `sha256=` prefix - just the hex digest. |
| `X-Webhook-Event` | The event type, equal to the body's `event_type`. |
| `Content-Type` | `application/json`. |

**Body** - the common envelope ([full reference](https://www.vobiz.ai/docs/whatsapp/webhooks/events.md#common-envelope)):

```json theme={null}
{
  "event_id": "f4c1a0d2-3b6e-4a9c-8e2f-0a1b2c3d4e5f",
  "event_type": "message.inbound",
  "account_id": "MA_XXXXXXXX",
  "occurred_at": "2026-03-25T10:00:00Z",
  "payload": { }
}
```

The `event_type` values are `message.inbound` for a received message, `message.status` for a delivery status update (with `status` ∈ `sent`/`delivered`/`read`/`failed`), and `call.` followed by the WhatsApp call event (e.g. `call.connect`, `call.terminate`). The `payload` is the WhatsApp Business Platform webhook payload that triggered the event, unchanged.

Vobiz waits up to 5 seconds for your endpoint to respond and delivers each event once. Return any `2xx` status quickly, and do heavier processing after you respond.

> [!WARNING]
>
> Verify `X-Webhook-Signature` against the **raw** body before processing - compute HMAC-SHA256 with your `secret`, hex-encode, and constant-time compare. See the [signature example](https://www.vobiz.ai/docs/whatsapp/webhooks.md#verifying-the-signature).

## Related Topics

* [Webhooks Overview →](https://www.vobiz.ai/docs/whatsapp/webhooks.md)
* [Webhook Event Reference →](https://www.vobiz.ai/docs/whatsapp/webhooks/events.md)
* [Send Message API →](https://www.vobiz.ai/docs/whatsapp/api/send-message.md)
* [Inbox Management →](https://www.vobiz.ai/docs/whatsapp/messaging/inbox.md)


## OpenAPI

````yaml openapi-whatsapp.yaml POST /api/v1/Account/{auth_id}/WhatsApp/Webhook/
openapi: 3.1.0
info:
  title: Vobiz WhatsApp API
  description: >
    Connect WhatsApp Business channels, submit message templates, send text,
    media and template

    messages, place and answer WhatsApp voice calls, run template campaigns, and
    manage contacts,

    canned responses, webhooks (callbacks) and media on the WhatsApp Business
    Platform through Vobiz.


    **Base URL:** `https://api.vobiz.ai/api/v1/Account/{auth_id}/WhatsApp`,
    where `{auth_id}` is your

    account Auth ID. Paths in descriptions, such as `POST /Message/`, are
    relative to it. The trailing

    slash is optional on every path.


    **Authentication:** every request needs the `X-Auth-ID` and `X-Auth-Token`
    headers. The

    `{auth_id}` in the path must be the account those credentials belong to,
    otherwise the request

    returns `403`. Send `Content-Type: application/json` on requests with a JSON
    body.


    **Conventions:** field names are snake_case. IDs that Vobiz issues
    (channels, templates,

    contacts, conversations, messages, campaigns, webhooks) are UUIDs; send them
    exactly as

    returned. Timestamps are RFC 3339 in UTC.

    Errors return a flat object with one `error` string. Authentication and
    authorization errors

    (`401` and `403`) nest a `code` and `message` under `error`.
  version: '1.0'
  contact:
    email: support@vobiz.ai
    url: https://www.vobiz.ai
servers:
  - url: https://api.vobiz.ai
    description: Production
security:
  - AuthID: []
    AuthToken: []
tags:
  - name: Channels
    description: >-
      WhatsApp Business phone numbers connected to your Vobiz account. Every
      send, template, call and campaign runs on a channel.
  - name: SIP integration
    description: >-
      Route a channel's WhatsApp voice calls over SIP to your own PBX or contact
      center instead of the browser (WebRTC) calling flow.
  - name: Templates
    description: >-
      Meta-approved message templates, the only messages you can send outside
      the 24-hour customer service window.
  - name: Numbers
    description: >-
      Search and buy WhatsApp-capable numbers from Vobiz inventory, or verify
      ownership of a number you already have (BYON).
  - name: Conversations
    description: >-
      Threads between one of your channels and one contact, with their message
      history.
  - name: Messages
    description: Send text, media and template messages.
  - name: Calls
    description: >-
      Place, answer and end WhatsApp Business voice calls with WebRTC signaling,
      and list call history.
  - name: Webhooks
    description: >-
      Subscriptions that deliver inbound messages, delivery status and call
      events to your server.
  - name: Media
    description: >-
      Upload media for outbound messages and download inbound attachments
      without handling Meta access tokens.
  - name: Contacts
    description: >-
      The people you message, with tags and custom attributes used for campaign
      targeting.
  - name: Canned responses
    description: Reusable reply snippets that inbox agents insert with a shortcut.
  - name: Campaigns
    description: >-
      Bulk sends of one approved template to a tagged, selected or full contact
      audience.
paths:
  /api/v1/Account/{auth_id}/WhatsApp/Webhook/:
    parameters:
      - $ref: '#/components/parameters/AuthId'
    post:
      tags:
        - Webhooks
      summary: Create a webhook subscription
      description: >-
        Subscribes a URL to your account's WhatsApp events. Vobiz posts each
        event as JSON with `X-Webhook-Event` (the event type) and
        `X-Webhook-Signature` (hex HMAC-SHA256 of the raw body, keyed with your
        `secret`). Verify the signature before you trust a delivery. Subscribing
        a URL you already have updates its secret and reactivates it, and
        returns the same `id`.
      operationId: whatsapp-create-webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
            example:
              url: https://example.com/webhooks/whatsapp
              secret: YOUR_WEBHOOK_SECRET
      responses:
        '201':
          description: The subscription. The secret is not returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscription'
              example:
                id: 6a1c3e5b-7d9f-4b2a-8c4e-6f8a0b2c4d16
                url: https://example.com/webhooks/whatsapp
                status: active
                created_at: '2026-10-20T09:15:00Z'
                updated_at: '2026-10-20T09:15:00Z'
        '400':
          description: '`url` or `secret` is missing.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: url and secret are required
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    AuthId:
      name: auth_id
      in: path
      required: true
      description: Your account Auth ID. It must match the `X-Auth-ID` header.
      schema:
        type: string
        example: MA_XXXXXXXX
  schemas:
    CreateWebhookRequest:
      type: object
      required:
        - url
        - secret
      properties:
        url:
          type: string
          format: uri
          description: >-
            The HTTPS URL that receives event deliveries. Sending a URL you
            already subscribed updates its secret.
          example: https://example.com/webhooks/whatsapp
        secret:
          type: string
          description: >-
            Shared secret used to sign deliveries (HMAC-SHA256, hex-encoded, in
            `X-Webhook-Signature`). Responses don't include it.
          example: YOUR_WEBHOOK_SECRET
    WebhookSubscription:
      type: object
      required:
        - id
        - url
        - status
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: Subscription ID.
          example: 6a1c3e5b-7d9f-4b2a-8c4e-6f8a0b2c4d16
        url:
          type: string
          format: uri
          example: https://example.com/webhooks/whatsapp
        status:
          type: string
          description: Subscription state, for example `active`.
          example: active
        created_at:
          type: string
          format: date-time
          example: '2026-10-20T09:15:00Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-10-20T09:15:00Z'
    Error:
      type: object
      description: >-
        An error response: a flat object with one `error` string. Use the HTTP
        status code to decide how to handle the error, and log `error` for
        diagnosis.
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            Human-readable explanation of the error. Branch on the HTTP status
            code rather than on this text.
          example: channel not found
    GatewayError:
      type: object
      description: The body of an authentication (`401`) or authorization (`403`) error.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: integer
              description: The HTTP status code, repeated.
              example: 401
            message:
              type: string
              description: What went wrong.
              example: Invalid authentication credentials
  responses:
    Unauthorized:
      description: Missing or invalid `X-Auth-ID` / `X-Auth-Token`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GatewayError'
          examples:
            invalid:
              summary: Invalid credentials
              value:
                error:
                  code: 401
                  message: Invalid authentication credentials
            missing:
              summary: Missing credentials
              value:
                error:
                  code: 401
                  message: >-
                    Authentication required: provide either Authorization header
                    or X-Auth-ID and X-Auth-Token headers
    Forbidden:
      description: >-
        The `{auth_id}` in the path is not the account your credentials belong
        to.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GatewayError'
          example:
            error:
              code: 403
              message: 'Access denied: account ID mismatch'
  securitySchemes:
    AuthID:
      type: apiKey
      in: header
      name: X-Auth-ID
      description: Your Vobiz account Auth ID (`MA_XXXXXXXX`).
    AuthToken:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: Your Vobiz account Auth Token.

````

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