> For the complete documentation index, see [llms.txt](https://doc.twake.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.twake.app/developers-api/api-reference/message/post-request.md).

# POST Request

#### Before starting, make sure you added **`message_save`** into **`write privileges`**. See the [Application access and privileges](/developers-api/get-started.md#application-access-and-privileges) section.

## POST message

<mark style="color:green;">`POST`</mark> `https://api.twake.app/api/v1/messages/save`

#### Headers

| Name          | Type   | Description                               |
| ------------- | ------ | ----------------------------------------- |
| Authorization | string | `Basic base64(public_id:private_api_key)` |
| Content-Type  | string | `application/json`                        |

#### Request Body

| Name      | Type   | Description                                            |
| --------- | ------ | ------------------------------------------------------ |
| message   | object | `Require channel_id and content, see the Body section` |
| group\_id | string | `See the group_id and channel_id section`              |

{% tabs %}
{% tab title="200 If request is successful, the response should be something like this." %}

```
{
    "object": {
        "id": "--", // Message Id
        "channel_id": "--", // Channel
        "parent_message_id": "--", // Thread id
        "sender": null, // User who send the message
        "application_id": "--", // Application who send the message
        "edited": false, 
        "pinned": null,
        "hidden_data": null,
        "reactions": [],
        "modification_date": 1598518289, // Last modification date
        "creation_date": 1598518289, // Creation date
        "content": "Hello !", // Object (see Twacode) or string
    }
}
```

{% endtab %}
{% endtabs %}

### Body example:&#x20;

```
{
	"group_id": "--",
	"message": {
		"channel_id": "--",
		"content": "Hello, this is my first message !",
		"_once_ephemeral_message": false // Set true if you want this message ephemeral
	}
}
```


---

# 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://doc.twake.app/developers-api/api-reference/message/post-request.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.
