Edit chat queued message
PATCH
CoderSessionTokenheader
Coder-Session-Token<token>chat*stringChat ID
Format
uuidqueuedMessage*integerQueued message ID
Edit chat queued message request
application/json- body
content?array<>Content replaces the queued content. An empty array is rejected.
editing?booleanEditing begins (true) or ends (false) an edit of the message. A chat has at most one message under edit; beginning another ends the first. While the chat is paused, beginning an edit on another message returns 409. Ending the edit of a paused chat's head sends it.
model_config_id?stringModelConfigID and ReasoningEffort require Content; sending either without it returns 400. Omitted values keep the stored ones.
Format
uuidreasoning_effort?stringNo Content
The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X PATCH \ "$CODER_URL/api/v2/chats/{chat}/queue/{queuedMessage}" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "content": [ { "content": "string", "end_line": 0, "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", "file_name": "string", "skill_name": "string", "skill_source": "personal", "start_line": 0, "text": "string", "type": "text", "workspace_file_media_type": "string", "workspace_file_name": "string", "workspace_file_path": "string", "workspace_file_size": 0, "workspace_file_workspace_id": "74c05446-1c56-4543-82a9-03f2bf73b2ab" } ], "editing": true, "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205"}'const { CODER_URL, CODER_SESSION_TOKEN } = process.env;const url = `${CODER_URL}/api/v2/chats/{chat}/queue/{queuedMessage}`;const response = await fetch(url, { method: "PATCH", headers: { "Coder-Session-Token": CODER_SESSION_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ content: [ { content: "string", end_line: 0, file_id: "8a0cfb4f-ddc9-436d-91bb-75133c583767", file_name: "string", skill_name: "string", skill_source: "personal", start_line: 0, text: "string", type: "text", workspace_file_media_type: "string", workspace_file_name: "string", workspace_file_path: "string", workspace_file_size: 0, workspace_file_workspace_id: "74c05446-1c56-4543-82a9-03f2bf73b2ab", }, ], editing: true, model_config_id: "f5fb4d91-62ca-4377-9ee6-5d43ba00d205", }),});console.log(response.status, await response.text());import osimport requestsurl = os.environ["CODER_URL"] + "/api/v2/chats/{chat}/queue/{queuedMessage}"token = os.environ["CODER_SESSION_TOKEN"]response = requests.patch( url, headers={ "Coder-Session-Token": token, }, json={ "content": [ { "content": "string", "end_line": 0, "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", "file_name": "string", "skill_name": "string", "skill_source": "personal", "start_line": 0, "text": "string", "type": "text", "workspace_file_media_type": "string", "workspace_file_name": "string", "workspace_file_path": "string", "workspace_file_size": 0, "workspace_file_workspace_id": "74c05446-1c56-4543-82a9-03f2bf73b2ab", }, ], "editing": True, "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205", },)print(response.status_code, response.text)package mainimport ( "fmt" "io" "net/http" "os" "strings")func main() { body := strings.NewReader(`{ "content": [ { "content": "string", "end_line": 0, "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", "file_name": "string", "skill_name": "string", "skill_source": "personal", "start_line": 0, "text": "string", "type": "text", "workspace_file_media_type": "string", "workspace_file_name": "string", "workspace_file_path": "string", "workspace_file_size": 0, "workspace_file_workspace_id": "74c05446-1c56-4543-82a9-03f2bf73b2ab" } ], "editing": true, "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205"}`) url := os.Getenv("CODER_URL") + "/api/v2/chats/{chat}/queue/{queuedMessage}" token := os.Getenv("CODER_SESSION_TOKEN") req, err := http.NewRequest(http.MethodPatch, url, body) if err != nil { panic(err) } req.Header.Set("Coder-Session-Token", token) req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, err := io.ReadAll(resp.Body) if err != nil { panic(err) } fmt.Println(resp.Status, string(out))}Example Response204
Empty