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

# Send message

> Sends a message: text, media, quick reply, or template

<Info>
  **Endpoint** · `POST /conversation/actions`
</Info>

Sends a message. Each action sends **one kind of content**: text, media, a quick reply, or a template. A text, media, or quick reply can also carry a fallback template for when the 24h window is closed (see below).

<Tabs>
  <Tab title="Text">
    ```jsonc theme={null}
    {
      "type": "send_message",
      "body": "Hi 👋"
    }
    ```

    Plain text, up to 4096 characters.
  </Tab>

  <Tab title="Media">
    ```jsonc theme={null}
    {
      "type": "send_message",
      "file_uuid": "7b8a1c2d-3e4f-5678-90ab-cdef12345678",
      "body": "Your receipt 📄"
    }
    ```

    The `file_uuid` comes from the [Upload media](/en/action-groups/upload-media) flow. The
    `body` is an optional caption; audio doesn't accept a caption.
  </Tab>

  <Tab title="Quick reply">
    ```jsonc theme={null}
    {
      "type": "send_message",
      "quick_reply": { "name": "Bienvenida" }
    }
    ```

    Identifies the quick reply by `name` (case-insensitive).
  </Tab>

  <Tab title="Template">
    ```jsonc theme={null}
    {
      "type": "send_message",
      "template": {
        "name": "confirmacion_cita",
        "language": "es_MX",
        "body_variables": [{ "index": 1, "value": "Ana" }]
      }
    }
    ```

    `language` is **required** (Meta format `lower_UPPER`, e.g. `es_MX`). For
    templates with a media header, see [Upload media](/en/action-groups/upload-media).
  </Tab>
</Tabs>

<Note>
  **Template fallback.** A text, media, or quick reply `send_message` can also
  include an optional `template`: if the [24h window](/en/conversations) is
  **closed** at execution time, the template is sent instead of the primary (only
  templates can be sent outside the window); if it's open, the primary is sent.
  Without a `template`, a primary with the window closed fails with `WINDOW_CLOSED`.
</Note>

**Valid combinations:**

| Combination        | Fields                                                  | What gets sent                                                 |
| ------------------ | ------------------------------------------------------- | -------------------------------------------------------------- |
| Text               | `body`                                                  | The text (requires an open window)                             |
| Media              | `file_uuid` + optional `body`                           | The media with caption (requires an open window)               |
| Quick reply        | `quick_reply`                                           | The quick reply (requires an open window)                      |
| Template           | `template`                                              | The template (also with the window closed)                     |
| Primary + template | `body` \| `file_uuid` \| `quick_reply` **+** `template` | The primary if the window is open; the template if it's closed |

<CodeGroup>
  ```jsonc Text + template theme={null}
  {
    "type": "send_message",
    "body": "Hi 👋",
    "template": {
      "name": "recordatorio",
      "language": "es_MX"
    }
  }
  ```

  ```jsonc Media + template theme={null}
  {
    "type": "send_message",
    "file_uuid": "7b8a1c2d-3e4f-5678-90ab-cdef12345678",
    "body": "Your receipt 📄",
    "template": {
      "name": "recordatorio",
      "language": "es_MX"
    }
  }
  ```

  ```jsonc Quick reply + template theme={null}
  {
    "type": "send_message",
    "quick_reply": { "name": "Bienvenida" },
    "template": {
      "name": "recordatorio",
      "language": "es_MX"
    }
  }
  ```
</CodeGroup>

Each side's media is independent: the primary's in `file_uuid`, the template
header's in `template.header.file_uuid`; a quick reply's media is configured in
the quick reply itself.

In a list, this object goes in the `actions` array of a `POST /conversation/actions` — see [Assembling an action list](/en/action-groups/overview#assembling-an-action-list).

## Executable example

A `send_message` on a conversation identified by phone and channel. Each action
sends **one content type**; a primary (text, media, or quick reply) can also
carry a **fallback template** for when the 24h window is closed.

### Request

<CodeGroup>
  ```bash Text theme={null}
  curl -X POST "https://app.1to1.ai/api/v1/public/{slug}/conversation/actions" \
    -H "Authorization: Bearer sk_1to1_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "conversation": {
        "phone": "+5215512345678",
        "channel": "ch_7A9K2M4Q"
      },
      "actions": [
        {
          "type": "send_message",
          "body": "Hi 👋, how can I help you?"
        }
      ]
    }'
  ```

  ```bash Media theme={null}
  curl -X POST "https://app.1to1.ai/api/v1/public/{slug}/conversation/actions" \
    -H "Authorization: Bearer sk_1to1_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "conversation": {
        "phone": "+5215512345678",
        "channel": "ch_7A9K2M4Q"
      },
      "actions": [
        {
          "type": "send_message",
          "file_uuid": "7b8a1c2d-3e4f-5678-90ab-cdef12345678",
          "body": "Your receipt 📄"
        }
      ]
    }'
  ```

  ```bash Quick reply theme={null}
  curl -X POST "https://app.1to1.ai/api/v1/public/{slug}/conversation/actions" \
    -H "Authorization: Bearer sk_1to1_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "conversation": {
        "phone": "+5215512345678",
        "channel": "ch_7A9K2M4Q"
      },
      "actions": [
        {
          "type": "send_message",
          "quick_reply": { "name": "Bienvenida" }
        }
      ]
    }'
  ```

  ```bash Template theme={null}
  curl -X POST "https://app.1to1.ai/api/v1/public/{slug}/conversation/actions" \
    -H "Authorization: Bearer sk_1to1_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "conversation": {
        "phone": "+5215512345678",
        "channel": "ch_7A9K2M4Q"
      },
      "actions": [
        {
          "type": "send_message",
          "template": {
            "name": "confirmacion_cita",
            "language": "es_MX",
            "body_variables": [{ "index": 1, "value": "Ana" }]
          }
        }
      ]
    }'
  ```

  ```bash Text + fallback template theme={null}
  curl -X POST "https://app.1to1.ai/api/v1/public/{slug}/conversation/actions" \
    -H "Authorization: Bearer sk_1to1_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "conversation": {
        "phone": "+5215512345678",
        "channel": "ch_7A9K2M4Q"
      },
      "actions": [
        {
          "type": "send_message",
          "body": "Hi 👋",
          "template": {
            "name": "recordatorio",
            "language": "es_MX"
          }
        }
      ]
    }'
  ```

  ```bash Quick reply + fallback template theme={null}
  curl -X POST "https://app.1to1.ai/api/v1/public/{slug}/conversation/actions" \
    -H "Authorization: Bearer sk_1to1_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "conversation": {
        "phone": "+5215512345678",
        "channel": "ch_7A9K2M4Q"
      },
      "actions": [
        {
          "type": "send_message",
          "quick_reply": { "name": "Bienvenida" },
          "template": {
            "name": "recordatorio",
            "language": "es_MX"
          }
        }
      ]
    }'
  ```
</CodeGroup>

### Response

`202 Accepted` — the group was accepted and runs in the **background**. The
per-action result does not travel in the response (query it later — see [How it runs](/en/action-groups/overview#how-it-runs)).

```json theme={null}
{
  "status": "processing",
  "actions_accepted": 1
}
```

<ResponseField name="status" type="string">
  Always `processing`: confirms the group was accepted and is running.
</ResponseField>

<ResponseField name="actions_accepted" type="integer">
  How many actions in the array were **admitted** for execution — not how many
  succeeded.
</ResponseField>
