---
title: "Post message"
method: POST
path: "/message"
---

# Post message

`POST /message`

Send a message to the agent. For messages of type 'user', the agent's status must be 'stable' for the operation to complete successfully. Otherwise, this endpoint will return an error.

## Request body

- MessageRequestBody
  - `$schema` string, uri — A URL to the JSON Schema for this object.
  - `content` string, required — Message content
  - `type` 'raw' | 'user', required

## Response `200`

OK

- MessageResponseBody
  - `$schema` string, uri — A URL to the JSON Schema for this object.
  - `ok` boolean, required — Indicates whether the message was sent successfully. For messages of type 'user', success means detecting that the agent began executing the task described. For messages of type 'raw', success means the keystrokes were sent to the terminal.

## Other responses

- `default` — Error

## Changes

- **2025-10-13** `e6147f7bdb93` — 1 breaking
  - the response property `errors` became nullable for the status `default`

[Change history](https://skmtc.dev/coder/apis/agentapi/changes/message/post.md)

---

[API](https://skmtc.dev/coder/apis/agentapi.md) · [All operations](https://skmtc.dev/coder/apis/agentapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/coder/agentapi/revisions/b33e590af299/schema)
