# Post a message

> Posts as the app, in a channel it belongs to, and returns the message.

**POST** `/api/public/apps/v1/messages`

Needs the `chat:write` permission.

Posts as the app, in a channel it belongs to, and returns the message. Send an `id` to make retries safe: the same id never posts twice.

## Body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `channel` | uuid | yes |  |
| `text` | string | yes | Up to 8000 characters. |
| `parent_id` | uuid | no | Reply in this message's thread. |
| `id` | uuid | no | Makes the request idempotent. |
| `mentions` | array of uuid | no |  |

## Example

**curl**

```sh
curl -X POST "https://amedeus.app/api/public/apps/v1/messages" \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"channel":"52f4c823-8e7f-4349-bb98-1ac8683aad13","text":"…"}'
```

**JavaScript**

```js
const response = await fetch("https://amedeus.app/api/public/apps/v1/messages", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.TOKEN}`, "Content-Type": "application/json" },
  body: JSON.stringify({"channel":"52f4c823-8e7f-4349-bb98-1ac8683aad13","text":"…"}),
});
const result = await response.json(); // { ok: true, … } or { ok: false, error, message }
```

**Python**

```python

request = urllib.request.Request(
    "https://amedeus.app/api/public/apps/v1/messages",
    data=json.dumps({"channel":"52f4c823-8e7f-4349-bb98-1ac8683aad13","text":"…"}).encode(),
    headers={
        "Authorization": f"Bearer {os.environ['TOKEN']}",
        "Content-Type": "application/json",
        "User-Agent": "my-app/1.0",
    },
    method="POST",
)
with urllib.request.urlopen(request) as response:
    result = json.load(response)  # a 4xx or 5xx raises urllib.error.HTTPError
```

## Response

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `ok` | `true` | yes |  |
| `message` | [message](/api-reference/#the-message-object) | yes |  |

```json
{
  "ok": true,
  "message": {
    "id": "52f4c823-8e7f-4349-bb98-1ac8683aad13",
    "channel": "52f4c823-8e7f-4349-bb98-1ac8683aad13",
    "user": "52f4c823-8e7f-4349-bb98-1ac8683aad13",
    "text": "…",
    "parent_id": null,
    "mentions": [
      "52f4c823-8e7f-4349-bb98-1ac8683aad13"
    ],
    "reply_count": 0,
    "created_at": "2026-11-12T19:18:43.527829+00:00",
    "edited_at": null
  }
}
```

## Errors

Failures answer `{ "ok": false, "error": "<code>", "message": "…" }`; see [Errors](/reference/errors/).

- `400`: The request isn't valid.
- `401`: The token is missing, wrong or revoked.
- `403`: A missing scope (the message names it), or a channel the app isn't in.
- `429`: Slow down; `Retry-After` says for how many seconds.

