Update chat
CoderSessionTokenCoder-Session-Token<token>chat*stringChat ID
uuidUpdate chat request
application/json- body
archived?booleanlabels?pin_order?integerPinOrder 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"PlanMode switches the chat's persistent plan mode. nil: no change, ptr to "plan": enable, ptr to "": clear.
"plan"project_id?stringProjectID 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.
uuidread?booleanRead 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.
title?stringTitle, 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_id?stringuuidNo Content
The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X PATCH \ "$CODER_URL/api/v2/chats/{chat}" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "archived": true, "labels": { "property1": "string", "property2": "string" }, "pin_order": 0}'