> ## 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 Facebook Pages.

## What you can do

* send Messenger messages from your connected Page
* receive incoming messages, reactions, reads, deliveries, postbacks, comments and post 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
* publish text, links, photos, videos and reels, and delete posts
* read Page and post insights
* list, reply to, hide and delete comments, and answer commenters in private

## Authentication

Use two tokens:

| Token                 | Use it for                                                                                | Base URL                                   |
| --------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------ |
| `hmok_` API key       | Manage orgs, workspaces, channels, webhooks, channel tokens, and publish reels            | `https://api.hookmyapp.com`                |
| `hmat_` channel token | Call Meta's Page API (Messenger, posts, comments, insights) through one connected channel | `https://gateway.hookmyapp.com/meta/v25.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/v25.0/{PAGE_ID}/messages \
  -H "Authorization: Bearer hmat_..." \
  -H "Content-Type: application/json" \
  -d '{"recipient":{"id":"200000000000001"},"message":{"text":"Hello"}}'
```

You can also get the same channel token with `hookmyapp channels token <channel>`. The Page id is on `GET /meta/channels/{id}` as `metaResourceId`.

The channel token only reaches the Page it was minted for, and the Instagram account linked to that Page. Any other Page, post, comment or thread is refused with `FACEBOOK_SCOPE_DENIED`.

## Next steps

* [Send a message](/facebook/api/messages/send-message): Send Messenger messages.
* [Receive webhooks](/facebook/receive-webhooks): Handle inbound events and read the PSID.
