> For the complete documentation index, see [llms.txt](https://docs.oneroute.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oneroute.io/whatsapp-api/endpoints/send-session-message.md).

# Send Session Message

## Send WhatsApp Session Message

<mark style="color:green;">`POST`</mark> `https://api.oneroute.io/api/public/conversation/text`

This API only works when you have received a Whatsapp message from the customer in the last 24 hours.

#### Headers

| Name   | Type   | Description                 |
| ------ | ------ | --------------------------- |
| apiKey | string | API Key for authentication. |

#### Request Body

| Name    | Type   | Description                                                                       |
| ------- | ------ | --------------------------------------------------------------------------------- |
| from    | string | Whatsapp number you are sending from. Must be connected to a channel on OneRoute. |
| to      | string | Whatsapp number to send the message to. Must be a valid Whatsapp number.          |
| message | string | The message to send to the customer.                                              |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": {
        "id": "c5cb6663-19fb-4551-abee-ddab2d7355d8",
        "content": "Hello :)",
        "contentType": "TEXT",
        "sender": {
            "name": "covid2020",
            "authUser": true,
            "lastActivity": "2021-06-03T14:37:24.684Z"
        },
        "externalId": "gBGHI0kFNWAgTwIJQFXbLV4JUIzD",
        "conversation_id": "65763b7f-b9a1-4370-b2ca-9cacfb0d65c2",
        "updatedAt": "2021-06-03T14:37:25.664Z",
        "createdAt": "2021-06-03T14:37:25.664Z",
        "subject": null,
        "imageUrl": null,
        "videoUrl": null,
        "documentUrl": null,
        "audioUrl": null,
        "quoted_message_id": null
    },
    "message": "Message sent to customer",
    "success": true
}
```

{% endtab %}

{% tab title="401 " %}

```
{
    "data": null,
    "message": "Invalid API Key",
    "success": false
}
```

{% endtab %}
{% endtabs %}

### Example Request Payload

```
{
    "from": "234XXXXXXXXXX",
    "message":"Session message",
    "to": "234XXXXXXXXX"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.oneroute.io/whatsapp-api/endpoints/send-session-message.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
