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

# API overview

> Use the HookMyApp public API for WhatsApp.

## What you can do

* send WhatsApp messages through your connected number
* receive incoming messages and status events in your webhook
* list connected channels and fetch channel tokens
* set or clear the webhook destination for a channel
* rotate a channel token if it leaks

## Authentication

Use two tokens:

| Token                 | Use it for                                                      | Base URL                                   |
| --------------------- | --------------------------------------------------------------- | ------------------------------------------ |
| `hmok_` API key       | Manage orgs, workspaces, channels, webhooks, and channel tokens | `https://api.hookmyapp.com`                |
| `hmat_` channel token | Send WhatsApp messages through one connected channel            | `https://gateway.hookmyapp.com/meta/v22.0` |

Fetch the channel token with an `hmok_` API key:

```bash theme={null}
curl https://api.hookmyapp.com/meta/channels/{channelId}/token \
  -H "Authorization: Bearer hmok_..." \
  -H "X-Workspace-Id: ws_..."
```

Use the returned `hmat_` token to send:

```bash theme={null}
curl -X POST https://gateway.hookmyapp.com/meta/v22.0/{PHONE_NUMBER_ID}/messages \
  -H "Authorization: Bearer hmat_..." \
  -H "Content-Type: application/json" \
  -d '{"messaging_product":"whatsapp","to":"15551234567","type":"text","text":{"body":"Hello"}}'
```

You can also get the same channel token with `hookmyapp channels env <channel>`.

<Note>
  The version-pinned base URL (`.../meta/v22.0`) is the exact value HookMyApp
  emits as `META_GRAPH_API_URL` from `hookmyapp channels env <channel>`. Read
  the base URL from that variable instead of hardcoding the version, so a Meta
  Graph API version bump doesn't leave your requests pinned to an old version.
</Note>

## Next steps

* [Send a message](/whatsapp/api/messages/send-message): Send WhatsApp messages.
* [Send text guide](/whatsapp/send-messages/text): Send a WhatsApp text message.
* [Receive webhooks](/whatsapp/receive-webhooks): Handle inbound messages and status events.
