---
title: "Post into a thread — markdown renders natively per platform [write]"
method: POST
path: "/channels/threads/{id}/messages"
tags: ["channels"]
---

# Post into a thread — markdown renders natively per platform \[write\]

`POST /channels/threads/{id}/messages`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/channels/threads/{id}/messages`
- Auth: HTTP bearer

File parts use owned Files API assets and require capabilities.files. Long replies are split into complete platform-sized messages. Supply idempotency_key to avoid duplicate sends on retry; an uncertain or partial send must be inspected before choosing a new key. done and failed are mutually exclusive.

## Path parameters

- `id` string, required

## Request body

- PostChannelMessage
  - `parts` ChannelMessagePart[], required
    - union
      - object
        - `type` 'file', required
        - `file_id` string, required: A visible, unexpired Files API upload or session output; requires capabilities.files.
      - object
        - `type` 'text', required
        - `text` string, required
      - object
        - `type` 'markdown', required
        - `text` string, required
      - object
        - `type` 'raw', required
        - `platform` string, required
        - `payload` string, required: Platform-native payload, JSON-encoded
  - `email` object: SES-only headers. The authorized thread owns the recipient; this object cannot change To.
    - `subject` string
    - `reply_to` string, email
  - `idempotency_key` string: Durable replay key scoped to the persisted owner, connection and thread, independent of bearer token scope. Same-content replays return the accepted receipt even after disconnect; changed content or an unconfirmed send returns 409 without resending.
  - `done` boolean: Resolves the working marker as successful; cannot be true with failed
  - `failed` boolean: Resolves the working marker as failed; cannot be true with done

## Response `201`

Created

- object
  - `message_id` string
  - `thread_id` string

## Other responses

- `default`: Error — { error: { code, message } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 1 info
  - added the optional property `error/request_id` to the response with the `default` status

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/channels/threads/:id/messages/post.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/0d435187cd55?raw)
