Chats

Edit chat message

Changed on
patch/api/v2/chats/{chat}/messages/{message}

Request

  • Base URL
    / (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    /api/v2/chats/{chat}/messages/{message}
  • Auth
    API key in header Coder-Session-Token

Path parameters

chatstring uuid required

Chat ID

messageinteger required

Message ID

Request body

mcp_server_idsstring[]

MCPServerIDs, when set, replaces the chat's MCP server selection before the replacement turn runs. When nil the current selection is preserved.

model_config_idstring uuid

ModelConfigID, when set, overrides the model used for the replacement user message and the assistant turn that follows. When nil the original message's model is preserved.

reasoning_effortstring

Response

OK

deleted_message_idsinteger[]

DeletedMessageIDs holds the IDs of previously visible messages the edit removed, including stale hook notices from the edited turn. Clients should drop them from local caches.

warningsstring[]

Changes