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

# Send a message

> Send a customer-channel message.

Fetch the customer channel token, then send the message with the request body for that channel type.

Use the HookMyApp channel ID (`ch_...`) when you fetch the token. Then send through the gateway endpoint:

* `POST /meta/v22.0/{PHONE_NUMBER_ID}/messages` for WhatsApp
* `POST /meta/v25.0/{INSTAGRAM_ACCOUNT_ID}/messages` for Instagram

For WhatsApp, use `to` for the recipient phone number in international format. For Instagram, use the inbound `sender.id` as the outbound `recipient.id`.

Supported customer-channel sends:

* WhatsApp text, media, location, contacts, interactive messages, templates, and reactions
* Instagram text, media, quick replies, cards, reactions, and sender actions

## Authentication

Use an `hmok_` org API key to fetch the channel token:

```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_` channel token to send the message. Do not use an `hmok_` API key for the send call.

```bash theme={null}
Authorization: Bearer hmat_...
```

## Provider endpoints

| Channel type | Endpoint                                           | Path value                 |
| ------------ | -------------------------------------------------- | -------------------------- |
| WhatsApp     | `POST /meta/v22.0/{PHONE_NUMBER_ID}/messages`      | `WHATSAPP_PHONE_NUMBER_ID` |
| Instagram    | `POST /meta/v25.0/{INSTAGRAM_ACCOUNT_ID}/messages` | `INSTAGRAM_ACCOUNT_ID`     |

Use the provider-specific API page when you want the interactive request builder:

* [Send a WhatsApp message](/saas-mode/api/messages/send-whatsapp-message)
* [Send an Instagram message](/saas-mode/api/messages/send-instagram-message)

## WhatsApp example

```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",
    "recipient_type": "individual",
    "to": "15551234567",
    "type": "text",
    "text": { "body": "Hello! Your order #12345 has been shipped." }
  }'
```

Successful WhatsApp sends return Meta's message identifier:

```json theme={null}
{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "15551234567",
      "wa_id": "15551234567"
    }
  ],
  "messages": [
    {
      "id": "wamid.HBgNMTU1NTE0OTU5Nzg1FQIAERgSMDhGRjdBMDEyOTcxQzFFQkFBAA=="
    }
  ]
}
```

## Instagram example

```bash theme={null}
curl -X POST "https://gateway.hookmyapp.com/meta/v25.0/{INSTAGRAM_ACCOUNT_ID}/messages" \
  -H "Authorization: Bearer hmat_..." \
  -H "Content-Type: application/json" \
  -d '{
    "recipient": { "id": "17841400000000001" },
    "message": { "text": "Hello from HookMyApp" }
  }'
```

## Next steps

* [API overview](/saas-mode/api/overview): Fetch channel tokens and manage customer channels.
* [WhatsApp text guide](/whatsapp/send-messages/text): WhatsApp text request shape.
* [Instagram text guide](/instagram/send-messages/text): Instagram text request shape.
