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

# Overview

> Base URL, authentication and how to use the Zapfy API.

The Zapfy API is REST over HTTPS. You send messages and manage instances and
webhooks through a single surface — how it connects to WhatsApp stays
abstracted.

**Base URL**

```
https://api.zapfy.io
```

## Authentication

Everything via `Authorization: Bearer <token>`. There are **two tokens**, each with
its own scope:

<CardGroup cols={2}>
  <Card title="Account token" icon="key">
    Prefix `zpfy_acct_`. Manages **instances and webhooks** (create, list, edit, delete).
  </Card>

  <Card title="Instance token" icon="message-dots">
    Prefix `zpfy_inst_`. **Sends messages** for a specific number.
  </Card>
</CardGroup>

```bash theme={null}
# send a message (instance token)
curl -X POST https://api.zapfy.io/v1/messages/send-text \
  -H "Authorization: Bearer zpfy_inst_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "to": "5511999998888", "text": "Hi!" }'
```

<Note>
  Each endpoint shows which token to use in the **Authorization** selector of the
  playground on the right. Messages use the instance token; instances and webhooks,
  the account token.
</Note>

## Identifiers

Zapfy uses **two** identifiers, abstracting away WhatsApp's internal JIDs:

| Field   | Represents                    | Format                                                     | Example                   |
| ------- | ----------------------------- | ---------------------------------------------------------- | ------------------------- |
| `phone` | a person                      | phone in E.164 (with or without `+`, spaces or formatting) | `5511999998888`           |
| `id`    | a group, community or channel | opaque value returned by the API                           | `120363012345678901@g.us` |

* **`phone`** is just the person's number — never `...@s.whatsapp.net`.
* **`id`** is the exact value the API returns (from `GET /groups`, `GET /communities`,
  `GET /newsletters`). It's opaque: it may look like `...@g.us` (group/community) or
  `...@newsletter` (channel) — **use it as received**, don't rebuild it or derive it from a phone.

<Note>
  **When sending**, the recipient goes in the `to` field, which accepts a `phone` (person)
  **or** a group `id`. The response returns `{ messageId }` — keep it to reuse in follow-up
  actions on the message (status, reaction, `delete`, `edit`).
</Note>

## Webhooks

Inbound events (message received, status, connection) arrive at the webhooks you
register — one URL, many events. See [Configuration](/en/webhooks/configuration) and
[Events](/en/webhooks/events).
