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

# Send Message to User — POST /api/v1/send-message-to-user

> Proactively push a message to a bot user on Messenger or other connected channels. Supports text, rich cards, and Messenger policy tags.

Use this endpoint to proactively push a message to a specific user on Messenger or another channel connected to your Botsify bot — without waiting for the user to initiate a conversation. This is useful for sending notifications, follow-ups, order updates, or any outbound communication your workflow requires. You authenticate with your bot's API key rather than a Bearer token for this endpoint.

## Request

**`POST https://app.botsify.com/api/v1/send-message-to-user`**

**Authorization:** API key — pass your bot's API key either as the `apikey` field in the request body or in the `X-Api-Key` request header.

### Body Parameters

<ParamField body="apikey" type="string" required>
  Your bot's API key. You can find this in the Botsify dashboard under bot settings. Alternatively, pass this value in the `X-Api-Key` header instead of the request body.
</ParamField>

<ParamField body="to" type="string" required>
  The recipient's user ID on the connected channel (e.g. a Facebook Messenger PSID or platform-specific user identifier).
</ParamField>

<ParamField body="message" type="any" required>
  The message payload to send. This can be a plain string, a structured object (e.g. a card or quick-reply template), or any format supported by the target channel.
</ParamField>

<ParamField body="type" type="string">
  The message type, which may affect how the payload is rendered or routed on the target channel (e.g. `"text"`, `"card"`, `"image"`).
</ParamField>

<ParamField body="user_id" type="integer">
  An internal Botsify user ID, used when targeting a user by their Botsify platform record rather than their channel-specific ID.
</ParamField>

<ParamField body="tag" type="string">
  A Messenger message tag for policy compliance (e.g. `"CONFIRMED_EVENT_UPDATE"`, `"POST_PURCHASE_UPDATE"`). Required when sending messages outside the standard 24-hour messaging window on Facebook Messenger.
</ParamField>

## Example — Send a Plain Text Message via Header Auth

```bash theme={null}
curl --request POST \
  --url "https://app.botsify.com/api/v1/send-message-to-user" \
  --header "X-Api-Key: <your_api_key>" \
  --header "Content-Type: application/json" \
  --data '{
    "to": "1234567890",
    "message": "Your order #4521 has been shipped!",
    "type": "text",
    "tag": "POST_PURCHASE_UPDATE"
  }'
```

## Example — Send a Rich Message with Body Auth

```bash theme={null}
curl --request POST \
  --url "https://app.botsify.com/api/v1/send-message-to-user" \
  --header "Content-Type: application/json" \
  --data '{
    "apikey": "<your_api_key>",
    "to": "1234567890",
    "type": "card",
    "message": {
      "title": "Your Appointment",
      "subtitle": "Tomorrow at 10 AM",
      "buttons": [{ "type": "postback", "title": "Confirm", "payload": "CONFIRM_APPT" }]
    }
  }'
```

## Response

A successful request returns `200 OK` confirming the message was dispatched.

```json theme={null}
{
  "success": true,
  "recipient_id": "1234567890",
  "message_id": "mid.abc123xyz",
  "timestamp": "2024-06-10T15:00:00Z"
}
```


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