Chats
patch/api/v2/chats/{chat}

Request

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

Path parameters

chatstring uuid required

Chat ID

Request body

archivedboolean
labelsobject
pin_orderinteger

PinOrder controls the chat's pinned state and position.

  • nil: no change to pin state.
  • 0: unpin the chat.
  • 0 (chat is unpinned): pin the chat, appending it to the end of the pinned list. The specific value is ignored; the server assigns the next available position.

  • 0 (chat is already pinned): move the chat to the requested position, shifting neighbors as needed. The value is clamped to [1, pinned_count].

plan_mode'plan'
project_idstring uuid

ProjectID moves a root chat, and with it its subagent chats.

  • nil: no change.
  • uuid.Nil: remove the chat from its project.
  • other: move the chat into that project. The chat's owner must own the project or have it shared with them, and the project must be in the chat's organization. The server returns 409 while the chat or a subagent chat is not idle.
readboolean

Read moves the owner's read cursor, which drives HasUnread.

  • nil: no change.
  • true: mark every existing message as read.
  • false: clear the cursor so the chat reads as unread again.

The cursor is owner-scoped, so only the chat owner may set this. Opening a chat's stream marks it read, so marking the chat the owner is currently viewing as unread does not persist.

titlestring

Title, when set, is stored as the user title even when its text is unchanged, so a generated title never replaces it afterwards. It is validated like CreateChatRequest.Title.

workspace_idstring uuid

Response

No Content

Changes