Chats

List chats

Code samples

# Example request using curl curl -X GET http://coder-server:8080/api/experimental/chats \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

GET /api/experimental/chats

Experimental: this endpoint is subject to change.

Parameters

NameInTypeRequiredDescription
qquerystringfalseSearch query. Supports archived:bool and diff_url: terms (quote URLs).
labelquerystringfalseFilter by label as key:value. Repeat for multiple (AND logic).

Example responses

200 Response

[ { "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "archived": true, "build_id": "bfb1f3fa-bf7b-43a5-9e0b-26cc050e44cb", "children": [ {} ], "client_type": "ui", "created_at": "2019-08-24T14:15:22Z", "diff_status": { "additions": 0, "approved": true, "author_avatar_url": "string", "author_login": "string", "base_branch": "string", "changed_files": 0, "changes_requested": true, "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "commits": 0, "deletions": 0, "head_branch": "string", "pr_number": 0, "pull_request_draft": true, "pull_request_state": "string", "pull_request_title": "string", "refreshed_at": "2019-08-24T14:15:22Z", "reviewer_count": 0, "stale_at": "2019-08-24T14:15:22Z", "url": "string" }, "files": [ { "created_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "mime_type": "string", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05" } ], "has_unread": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "labels": { "property1": "string", "property2": "string" }, "last_error": { "detail": "string", "kind": "generic", "message": "string", "provider": "string", "retryable": true, "status_code": 0 }, "last_injected_context": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c", "last_turn_summary": "string", "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "parent_chat_id": "c3609ee6-3b11-4a93-b9ae-e4fabcc99359", "pin_order": 0, "plan_mode": "plan", "root_chat_id": "2898031c-fdce-4e3e-8c53-4481dd42fcd7", "status": "waiting", "title": "string", "updated_at": "2019-08-24T14:15:22Z", "warnings": [ "string" ], "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" } ]

Responses

StatusMeaningDescriptionSchema
200OKOKarray of codersdk.Chat

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
[array item]arrayfalse
» agent_idstring(uuid)false
» archivedbooleanfalse
» build_idstring(uuid)false
» childrencodersdk.ChatfalseChildren holds child (subagent) chats nested under this root chat. Always initialized to an empty slice so the JSON field is present as []. Child chats cannot create their own subagents, so nesting depth is capped at 1 and this slice is always empty for child chats.
» client_typecodersdk.ChatClientTypefalse
» created_atstring(date-time)false
» diff_statuscodersdk.ChatDiffStatusfalse
»» additionsintegerfalse
»» approvedbooleanfalse
»» author_avatar_urlstringfalse
»» author_loginstringfalse
»» base_branchstringfalse
»» changed_filesintegerfalse
»» changes_requestedbooleanfalse
»» chat_idstring(uuid)false
»» commitsintegerfalse
»» deletionsintegerfalse
»» head_branchstringfalse
»» pr_numberintegerfalse
»» pull_request_draftbooleanfalse
»» pull_request_statestringfalse
»» pull_request_titlestringfalse
»» refreshed_atstring(date-time)false
»» reviewer_countintegerfalse
»» stale_atstring(date-time)false
»» urlstringfalse
» filesarrayfalse
»» created_atstring(date-time)false
»» idstring(uuid)false
»» mime_typestringfalse
»» namestringfalse
»» organization_idstring(uuid)false
»» owner_idstring(uuid)false
» has_unreadbooleanfalseHas unread is true when assistant messages exist beyond the owner's read cursor, which updates on stream connect and disconnect.
» idstring(uuid)false
» labelsobjectfalse
»» [any property]stringfalse
» last_errorcodersdk.ChatErrorfalse
»» detailstringfalseDetail is optional provider-specific context shown alongside the normalized error message when available.
»» kindcodersdk.ChatErrorKindfalseKind classifies the error for consistent client rendering.
»» messagestringfalseMessage is the normalized, user-facing error message.
»» providerstringfalseProvider identifies the upstream model provider when known.
»» retryablebooleanfalseRetryable reports whether the underlying error is transient.
»» status_codeintegerfalseStatus code is the best-effort upstream HTTP status code.
» last_injected_contextarrayfalseLast injected context holds the most recently persisted injected context parts (AGENTS.md files and skills). It is updated only when context changes, on first workspace attach or agent change.
»» argsarrayfalse
»» args_deltastringfalse
»» completed_atstring(date-time)falseCompleted at is the time a reasoning part finished streaming, so reasoning duration can be computed as completed_at minus created_at. For interrupted reasoning, this is the interruption time. Absent when reasoning timestamp data was not recorded (e.g. messages persisted before this feature was added).
»» contentstringfalseThe code content from the diff that was commented on.
»» context_file_agent_iduuid.NullUUIDfalseContext file agent ID is the workspace agent that provided this context file. Used to detect when the agent changes (e.g. workspace rebuilt) so instruction files can be re-persisted with fresh content.
»»» uuidstringfalse
»»» validbooleanfalseValid is true if UUID is not NULL
»» context_file_contentstringfalseContext file content holds the file content sent to the LLM. Internal only: stripped before API responses to keep payloads small. The backend reads it when building the prompt via partsToMessageParts.
»» context_file_directorystringfalseContext file directory is the working directory of the workspace agent. Internal only: same purpose as ContextFileOS.
»» context_file_osstringfalseContext file os is the operating system of the workspace agent. Internal only: used during prompt expansion so the LLM knows the OS even on turns where InsertSystem is not called.
»» context_file_pathstringfalseContext file path is the absolute path of a file loaded into the LLM context (e.g. an AGENTS.md instruction file).
»» context_file_skill_meta_filestringfalseContext file skill meta file is the basename of the skill meta file (e.g. "SKILL.md") at the time of persistence. Internal only: restored on subsequent turns so the read_skill tool uses the correct filename even when the agent configured a non-default value.
»» context_file_truncatedbooleanfalseContext file truncated indicates the file exceeded the 64KiB instruction file limit and was truncated.
»» created_atstring(date-time)falseCreated at is the timestamp this part carries. The semantics depend on the part type: for tool-call and tool-result parts it is the time the call was emitted or the result was produced (tool duration is the result's created_at minus the call's created_at); for reasoning parts it is the time reasoning started streaming.
»» dataarrayfalse
»» end_lineintegerfalse
»» file_iduuid.NullUUIDfalse
»»» uuidstringfalse
»»» validbooleanfalseValid is true if UUID is not NULL
»» file_namestringfalse
»» is_errorbooleanfalse
»» is_mediabooleanfalse
»» mcp_server_config_iduuid.NullUUIDfalse
»»» uuidstringfalse
»»» validbooleanfalseValid is true if UUID is not NULL
»» media_typestringfalse
»» namestringfalse
»» provider_executedbooleanfalseProvider executed indicates the tool call was executed by the provider (e.g. Anthropic computer use).
»» provider_metadataarrayfalseProvider metadata holds provider-specific response metadata (e.g. Anthropic cache control hints) as raw JSON. Internal only: stripped by db2sdk before API responses.
»» resultarrayfalse
»» result_deltastringfalse
»» result_resetbooleanfalse
»» signaturestringfalse
»» skill_descriptionstringfalseSkill description is the short description from the skill's SKILL.md frontmatter.
»» skill_dirstringfalseSkill dir is the absolute path to the skill directory inside the workspace filesystem. Internal only: used by read_skill/read_skill_file tools to locate skill files.
»» skill_namestringfalseSkill name is the kebab-case name of a discovered skill from the workspace's .agents/skills/ directory.
»» source_idstringfalse
»» start_lineintegerfalse
»» textstringfalse
»» titlestringfalse
»» tool_call_idstringfalse
»» tool_namestringfalse
»» typecodersdk.ChatMessagePartTypefalse
»» urlstringfalse
» last_model_config_idstring(uuid)false
» last_turn_summarystringfalse
» mcp_server_idsarrayfalse
» organization_idstring(uuid)false
» owner_idstring(uuid)false
» parent_chat_idstring(uuid)false
» pin_orderintegerfalse
» plan_modecodersdk.ChatPlanModefalse
» root_chat_idstring(uuid)false
» statuscodersdk.ChatStatusfalse
» titlestringfalse
» updated_atstring(date-time)false
» warningsarrayfalse
» workspace_idstring(uuid)false

Enumerated Values

PropertyValue(s)
client_typeapi, ui
kindauth, config, generic, overloaded, rate_limit, startup_timeout, timeout, usage_limit
typecontext-file, file, file-reference, reasoning, skill, source, text, tool-call, tool-result
plan_modeplan
statuscompleted, error, paused, pending, requires_action, running, waiting

To perform this operation, you must be authenticated. Learn more.

Create chat

Code samples

# Example request using curl curl -X POST http://coder-server:8080/api/experimental/chats \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

POST /api/experimental/chats

Experimental: this endpoint is subject to change.

Body parameter

{ "client_type": "ui", "content": [ { "content": "string", "end_line": 0, "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", "file_name": "string", "start_line": 0, "text": "string", "type": "text" } ], "labels": { "property1": "string", "property2": "string" }, "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "plan_mode": "plan", "system_prompt": "string", "unsafe_dynamic_tools": [ { "description": "string", "input_schema": [ 0 ], "name": "string" } ], "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" }

Parameters

NameInTypeRequiredDescription
bodybodycodersdk.CreateChatRequesttrueCreate chat request

Example responses

201 Response

{ "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "archived": true, "build_id": "bfb1f3fa-bf7b-43a5-9e0b-26cc050e44cb", "children": [ { "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "archived": true, "build_id": "bfb1f3fa-bf7b-43a5-9e0b-26cc050e44cb", "children": [], "client_type": "ui", "created_at": "2019-08-24T14:15:22Z", "diff_status": { "additions": 0, "approved": true, "author_avatar_url": "string", "author_login": "string", "base_branch": "string", "changed_files": 0, "changes_requested": true, "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "commits": 0, "deletions": 0, "head_branch": "string", "pr_number": 0, "pull_request_draft": true, "pull_request_state": "string", "pull_request_title": "string", "refreshed_at": "2019-08-24T14:15:22Z", "reviewer_count": 0, "stale_at": "2019-08-24T14:15:22Z", "url": "string" }, "files": [ { "created_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "mime_type": "string", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05" } ], "has_unread": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "labels": { "property1": "string", "property2": "string" }, "last_error": { "detail": "string", "kind": "generic", "message": "string", "provider": "string", "retryable": true, "status_code": 0 }, "last_injected_context": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c", "last_turn_summary": "string", "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "parent_chat_id": "c3609ee6-3b11-4a93-b9ae-e4fabcc99359", "pin_order": 0, "plan_mode": "plan", "root_chat_id": "2898031c-fdce-4e3e-8c53-4481dd42fcd7", "status": "waiting", "title": "string", "updated_at": "2019-08-24T14:15:22Z", "warnings": [ "string" ], "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" } ], "client_type": "ui", "created_at": "2019-08-24T14:15:22Z", "diff_status": { "additions": 0, "approved": true, "author_avatar_url": "string", "author_login": "string", "base_branch": "string", "changed_files": 0, "changes_requested": true, "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "commits": 0, "deletions": 0, "head_branch": "string", "pr_number": 0, "pull_request_draft": true, "pull_request_state": "string", "pull_request_title": "string", "refreshed_at": "2019-08-24T14:15:22Z", "reviewer_count": 0, "stale_at": "2019-08-24T14:15:22Z", "url": "string" }, "files": [ { "created_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "mime_type": "string", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05" } ], "has_unread": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "labels": { "property1": "string", "property2": "string" }, "last_error": { "detail": "string", "kind": "generic", "message": "string", "provider": "string", "retryable": true, "status_code": 0 }, "last_injected_context": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c", "last_turn_summary": "string", "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "parent_chat_id": "c3609ee6-3b11-4a93-b9ae-e4fabcc99359", "pin_order": 0, "plan_mode": "plan", "root_chat_id": "2898031c-fdce-4e3e-8c53-4481dd42fcd7", "status": "waiting", "title": "string", "updated_at": "2019-08-24T14:15:22Z", "warnings": [ "string" ], "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" }

Responses

StatusMeaningDescriptionSchema
201CreatedCreatedcodersdk.Chat

To perform this operation, you must be authenticated. Learn more.

Upload chat file

Code samples

# Example request using curl curl -X POST http://coder-server:8080/api/experimental/chats/files?organization=497f6eca-6276-4993-bfeb-53cbbbba6f08 \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

POST /api/experimental/chats/files

Experimental: this endpoint is subject to change.

Parameters

NameInTypeRequiredDescription
organizationquerystring(uuid)trueOrganization ID

Example responses

201 Response

{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" }

Responses

StatusMeaningDescriptionSchema
201CreatedCreatedcodersdk.UploadChatFileResponse

To perform this operation, you must be authenticated. Learn more.

Get chat file

Code samples

# Example request using curl curl -X GET http://coder-server:8080/api/experimental/chats/files/{file} \ -H 'Coder-Session-Token: API_KEY'

GET /api/experimental/chats/files/{file}

Experimental: this endpoint is subject to change.

Parameters

NameInTypeRequiredDescription
filepathstring(uuid)trueFile ID

Responses

StatusMeaningDescriptionSchema
200OKOK

To perform this operation, you must be authenticated. Learn more.

List chat models

Code samples

# Example request using curl curl -X GET http://coder-server:8080/api/experimental/chats/models \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

GET /api/experimental/chats/models

Experimental: this endpoint is subject to change.

Example responses

200 Response

{ "providers": [ { "available": true, "models": [ { "display_name": "string", "id": "string", "model": "string", "provider": "string" } ], "provider": "string", "unavailable_reason": "missing_api_key" } ] }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.ChatModelsResponse

To perform this operation, you must be authenticated. Learn more.

Watch chat events for a user via WebSockets

Code samples

# Example request using curl curl -X GET http://coder-server:8080/api/experimental/chats/watch \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

GET /api/experimental/chats/watch

Experimental: this endpoint is subject to change.

Example responses

200 Response

{ "chat": { "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "archived": true, "build_id": "bfb1f3fa-bf7b-43a5-9e0b-26cc050e44cb", "children": [ {} ], "client_type": "ui", "created_at": "2019-08-24T14:15:22Z", "diff_status": { "additions": 0, "approved": true, "author_avatar_url": "string", "author_login": "string", "base_branch": "string", "changed_files": 0, "changes_requested": true, "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "commits": 0, "deletions": 0, "head_branch": "string", "pr_number": 0, "pull_request_draft": true, "pull_request_state": "string", "pull_request_title": "string", "refreshed_at": "2019-08-24T14:15:22Z", "reviewer_count": 0, "stale_at": "2019-08-24T14:15:22Z", "url": "string" }, "files": [ { "created_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "mime_type": "string", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05" } ], "has_unread": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "labels": { "property1": "string", "property2": "string" }, "last_error": { "detail": "string", "kind": "generic", "message": "string", "provider": "string", "retryable": true, "status_code": 0 }, "last_injected_context": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c", "last_turn_summary": "string", "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "parent_chat_id": "c3609ee6-3b11-4a93-b9ae-e4fabcc99359", "pin_order": 0, "plan_mode": "plan", "root_chat_id": "2898031c-fdce-4e3e-8c53-4481dd42fcd7", "status": "waiting", "title": "string", "updated_at": "2019-08-24T14:15:22Z", "warnings": [ "string" ], "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" }, "kind": "status_change", "tool_calls": [ { "args": "string", "tool_call_id": "string", "tool_name": "string" } ] }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.ChatWatchEvent

To perform this operation, you must be authenticated. Learn more.

Get chat by ID

Code samples

# Example request using curl curl -X GET http://coder-server:8080/api/experimental/chats/{chat} \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

GET /api/experimental/chats/{chat}

Experimental: this endpoint is subject to change.

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID

Example responses

200 Response

{ "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "archived": true, "build_id": "bfb1f3fa-bf7b-43a5-9e0b-26cc050e44cb", "children": [ { "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "archived": true, "build_id": "bfb1f3fa-bf7b-43a5-9e0b-26cc050e44cb", "children": [], "client_type": "ui", "created_at": "2019-08-24T14:15:22Z", "diff_status": { "additions": 0, "approved": true, "author_avatar_url": "string", "author_login": "string", "base_branch": "string", "changed_files": 0, "changes_requested": true, "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "commits": 0, "deletions": 0, "head_branch": "string", "pr_number": 0, "pull_request_draft": true, "pull_request_state": "string", "pull_request_title": "string", "refreshed_at": "2019-08-24T14:15:22Z", "reviewer_count": 0, "stale_at": "2019-08-24T14:15:22Z", "url": "string" }, "files": [ { "created_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "mime_type": "string", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05" } ], "has_unread": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "labels": { "property1": "string", "property2": "string" }, "last_error": { "detail": "string", "kind": "generic", "message": "string", "provider": "string", "retryable": true, "status_code": 0 }, "last_injected_context": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c", "last_turn_summary": "string", "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "parent_chat_id": "c3609ee6-3b11-4a93-b9ae-e4fabcc99359", "pin_order": 0, "plan_mode": "plan", "root_chat_id": "2898031c-fdce-4e3e-8c53-4481dd42fcd7", "status": "waiting", "title": "string", "updated_at": "2019-08-24T14:15:22Z", "warnings": [ "string" ], "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" } ], "client_type": "ui", "created_at": "2019-08-24T14:15:22Z", "diff_status": { "additions": 0, "approved": true, "author_avatar_url": "string", "author_login": "string", "base_branch": "string", "changed_files": 0, "changes_requested": true, "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "commits": 0, "deletions": 0, "head_branch": "string", "pr_number": 0, "pull_request_draft": true, "pull_request_state": "string", "pull_request_title": "string", "refreshed_at": "2019-08-24T14:15:22Z", "reviewer_count": 0, "stale_at": "2019-08-24T14:15:22Z", "url": "string" }, "files": [ { "created_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "mime_type": "string", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05" } ], "has_unread": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "labels": { "property1": "string", "property2": "string" }, "last_error": { "detail": "string", "kind": "generic", "message": "string", "provider": "string", "retryable": true, "status_code": 0 }, "last_injected_context": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c", "last_turn_summary": "string", "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "parent_chat_id": "c3609ee6-3b11-4a93-b9ae-e4fabcc99359", "pin_order": 0, "plan_mode": "plan", "root_chat_id": "2898031c-fdce-4e3e-8c53-4481dd42fcd7", "status": "waiting", "title": "string", "updated_at": "2019-08-24T14:15:22Z", "warnings": [ "string" ], "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.Chat

To perform this operation, you must be authenticated. Learn more.

Update chat

Code samples

# Example request using curl curl -X PATCH http://coder-server:8080/api/experimental/chats/{chat} \ -H 'Content-Type: application/json' \ -H 'Coder-Session-Token: API_KEY'

PATCH /api/experimental/chats/{chat}

Experimental: this endpoint is subject to change.

Body parameter

{ "archived": true, "labels": { "property1": "string", "property2": "string" }, "pin_order": 0, "plan_mode": "plan", "title": "string", "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" }

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID
bodybodycodersdk.UpdateChatRequesttrueUpdate chat request

Responses

StatusMeaningDescriptionSchema
204No ContentNo Content

To perform this operation, you must be authenticated. Learn more.

Get chat diff contents

Code samples

# Example request using curl curl -X GET http://coder-server:8080/api/experimental/chats/{chat}/diff \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

GET /api/experimental/chats/{chat}/diff

Experimental: this endpoint is subject to change.

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID

Example responses

200 Response

{ "branch": "string", "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "diff": "string", "provider": "string", "pull_request_url": "string", "remote_origin": "string" }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.ChatDiffContents

To perform this operation, you must be authenticated. Learn more.

Interrupt chat

Code samples

# Example request using curl curl -X POST http://coder-server:8080/api/experimental/chats/{chat}/interrupt \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

POST /api/experimental/chats/{chat}/interrupt

Experimental: this endpoint is subject to change.

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID

Example responses

200 Response

{ "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "archived": true, "build_id": "bfb1f3fa-bf7b-43a5-9e0b-26cc050e44cb", "children": [ { "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "archived": true, "build_id": "bfb1f3fa-bf7b-43a5-9e0b-26cc050e44cb", "children": [], "client_type": "ui", "created_at": "2019-08-24T14:15:22Z", "diff_status": { "additions": 0, "approved": true, "author_avatar_url": "string", "author_login": "string", "base_branch": "string", "changed_files": 0, "changes_requested": true, "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "commits": 0, "deletions": 0, "head_branch": "string", "pr_number": 0, "pull_request_draft": true, "pull_request_state": "string", "pull_request_title": "string", "refreshed_at": "2019-08-24T14:15:22Z", "reviewer_count": 0, "stale_at": "2019-08-24T14:15:22Z", "url": "string" }, "files": [ { "created_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "mime_type": "string", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05" } ], "has_unread": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "labels": { "property1": "string", "property2": "string" }, "last_error": { "detail": "string", "kind": "generic", "message": "string", "provider": "string", "retryable": true, "status_code": 0 }, "last_injected_context": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c", "last_turn_summary": "string", "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "parent_chat_id": "c3609ee6-3b11-4a93-b9ae-e4fabcc99359", "pin_order": 0, "plan_mode": "plan", "root_chat_id": "2898031c-fdce-4e3e-8c53-4481dd42fcd7", "status": "waiting", "title": "string", "updated_at": "2019-08-24T14:15:22Z", "warnings": [ "string" ], "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" } ], "client_type": "ui", "created_at": "2019-08-24T14:15:22Z", "diff_status": { "additions": 0, "approved": true, "author_avatar_url": "string", "author_login": "string", "base_branch": "string", "changed_files": 0, "changes_requested": true, "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "commits": 0, "deletions": 0, "head_branch": "string", "pr_number": 0, "pull_request_draft": true, "pull_request_state": "string", "pull_request_title": "string", "refreshed_at": "2019-08-24T14:15:22Z", "reviewer_count": 0, "stale_at": "2019-08-24T14:15:22Z", "url": "string" }, "files": [ { "created_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "mime_type": "string", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05" } ], "has_unread": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "labels": { "property1": "string", "property2": "string" }, "last_error": { "detail": "string", "kind": "generic", "message": "string", "provider": "string", "retryable": true, "status_code": 0 }, "last_injected_context": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c", "last_turn_summary": "string", "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "parent_chat_id": "c3609ee6-3b11-4a93-b9ae-e4fabcc99359", "pin_order": 0, "plan_mode": "plan", "root_chat_id": "2898031c-fdce-4e3e-8c53-4481dd42fcd7", "status": "waiting", "title": "string", "updated_at": "2019-08-24T14:15:22Z", "warnings": [ "string" ], "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.Chat

To perform this operation, you must be authenticated. Learn more.

List chat messages

Code samples

# Example request using curl curl -X GET http://coder-server:8080/api/experimental/chats/{chat}/messages \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

GET /api/experimental/chats/{chat}/messages

Experimental: this endpoint is subject to change.

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID
before_idqueryintegerfalseReturn messages with id < before_id
after_idqueryintegerfalseReturn messages with id > after_id
limitqueryintegerfalsePage size, 1 to 200. Defaults to 50.

Example responses

200 Response

{ "has_more": true, "messages": [ { "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "content": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "created_at": "2019-08-24T14:15:22Z", "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4", "id": 0, "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205", "role": "system", "usage": { "cache_creation_tokens": 0, "cache_read_tokens": 0, "context_limit": 0, "input_tokens": 0, "output_tokens": 0, "reasoning_tokens": 0, "total_tokens": 0 } } ], "queued_messages": [ { "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "content": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "created_at": "2019-08-24T14:15:22Z", "id": 0, "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205" } ] }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.ChatMessagesResponse

To perform this operation, you must be authenticated. Learn more.

Send chat message

Code samples

# Example request using curl curl -X POST http://coder-server:8080/api/experimental/chats/{chat}/messages \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

POST /api/experimental/chats/{chat}/messages

Experimental: this endpoint is subject to change.

Body parameter

{ "busy_behavior": "queue", "content": [ { "content": "string", "end_line": 0, "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", "file_name": "string", "start_line": 0, "text": "string", "type": "text" } ], "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205", "plan_mode": "plan" }

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID
bodybodycodersdk.CreateChatMessageRequesttrueCreate chat message request

Example responses

200 Response

{ "message": { "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "content": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "created_at": "2019-08-24T14:15:22Z", "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4", "id": 0, "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205", "role": "system", "usage": { "cache_creation_tokens": 0, "cache_read_tokens": 0, "context_limit": 0, "input_tokens": 0, "output_tokens": 0, "reasoning_tokens": 0, "total_tokens": 0 } }, "queued": true, "queued_message": { "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "content": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "created_at": "2019-08-24T14:15:22Z", "id": 0, "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205" }, "warnings": [ "string" ] }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.CreateChatMessageResponse

To perform this operation, you must be authenticated. Learn more.

Edit chat message

Code samples

# Example request using curl curl -X PATCH http://coder-server:8080/api/experimental/chats/{chat}/messages/{message} \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

PATCH /api/experimental/chats/{chat}/messages/{message}

Experimental: this endpoint is subject to change.

Body parameter

{ "content": [ { "content": "string", "end_line": 0, "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", "file_name": "string", "start_line": 0, "text": "string", "type": "text" } ], "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205" }

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID
messagepathintegertrueMessage ID
bodybodycodersdk.EditChatMessageRequesttrueEdit chat message request

Example responses

200 Response

{ "message": { "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "content": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "created_at": "2019-08-24T14:15:22Z", "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4", "id": 0, "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205", "role": "system", "usage": { "cache_creation_tokens": 0, "cache_read_tokens": 0, "context_limit": 0, "input_tokens": 0, "output_tokens": 0, "reasoning_tokens": 0, "total_tokens": 0 } }, "warnings": [ "string" ] }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.EditChatMessageResponse

To perform this operation, you must be authenticated. Learn more.

List chat user prompts

Code samples

# Example request using curl curl -X GET http://coder-server:8080/api/experimental/chats/{chat}/prompts \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

GET /api/experimental/chats/{chat}/prompts

Experimental: this endpoint is subject to change.

Returns the user-authored prompts in a chat, newest first, with each prompt's text parts concatenated in the order they were authored. Used by the composer to power the up/down arrow prompt-history cycle without paging through every message in the chat.

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID
limitqueryintegerfalsePage size, 0 to 2000. 0 (the default) means the server-side default of 500.

Example responses

200 Response

{ "prompts": [ { "id": 0, "text": "string" } ] }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.ChatPromptsResponse

To perform this operation, you must be authenticated. Learn more.

Stream chat events via WebSockets

Code samples

# Example request using curl curl -X GET http://coder-server:8080/api/experimental/chats/{chat}/stream \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

GET /api/experimental/chats/{chat}/stream

Experimental: this endpoint is subject to change.

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID

Example responses

200 Response

{ "action_required": { "tool_calls": [ { "args": "string", "tool_call_id": "string", "tool_name": "string" } ] }, "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "error": { "detail": "string", "kind": "generic", "message": "string", "provider": "string", "retryable": true, "status_code": 0 }, "message": { "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "content": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "created_at": "2019-08-24T14:15:22Z", "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4", "id": 0, "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205", "role": "system", "usage": { "cache_creation_tokens": 0, "cache_read_tokens": 0, "context_limit": 0, "input_tokens": 0, "output_tokens": 0, "reasoning_tokens": 0, "total_tokens": 0 } }, "message_part": { "part": { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" }, "role": "system" }, "queued_messages": [ { "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "content": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "created_at": "2019-08-24T14:15:22Z", "id": 0, "model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205" } ], "retry": { "attempt": 0, "delay_ms": 0, "error": "string", "kind": "generic", "provider": "string", "retrying_at": "2019-08-24T14:15:22Z", "status_code": 0 }, "status": { "status": "waiting" }, "type": "message_part" }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.ChatStreamEvent

To perform this operation, you must be authenticated. Learn more.

Connect to chat workspace desktop via WebSockets

Code samples

# Example request using curl curl -X GET http://coder-server:8080/api/experimental/chats/{chat}/stream/desktop \ -H 'Coder-Session-Token: API_KEY'

GET /api/experimental/chats/{chat}/stream/desktop

Raw binary WebSocket stream of the chat workspace desktop. Experimental: this endpoint is subject to change.

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID

Responses

StatusMeaningDescriptionSchema
101Switching ProtocolsSwitching Protocols

To perform this operation, you must be authenticated. Learn more.

Watch chat workspace git state via WebSockets

Code samples

# Example request using curl curl -X GET http://coder-server:8080/api/experimental/chats/{chat}/stream/git \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

GET /api/experimental/chats/{chat}/stream/git

Experimental: this endpoint is subject to change.

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID

Example responses

200 Response

{ "message": "string", "repositories": [ { "branch": "string", "remote_origin": "string", "removed": true, "repo_root": "string", "unified_diff": "string" } ], "scanned_at": "2019-08-24T14:15:22Z", "type": "changes" }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.WorkspaceAgentGitServerMessage

To perform this operation, you must be authenticated. Learn more.

Regenerate chat title

Code samples

# Example request using curl curl -X POST http://coder-server:8080/api/experimental/chats/{chat}/title/regenerate \ -H 'Accept: application/json' \ -H 'Coder-Session-Token: API_KEY'

POST /api/experimental/chats/{chat}/title/regenerate

Experimental: this endpoint is subject to change.

Parameters

NameInTypeRequiredDescription
chatpathstring(uuid)trueChat ID

Example responses

200 Response

{ "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "archived": true, "build_id": "bfb1f3fa-bf7b-43a5-9e0b-26cc050e44cb", "children": [ { "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "archived": true, "build_id": "bfb1f3fa-bf7b-43a5-9e0b-26cc050e44cb", "children": [], "client_type": "ui", "created_at": "2019-08-24T14:15:22Z", "diff_status": { "additions": 0, "approved": true, "author_avatar_url": "string", "author_login": "string", "base_branch": "string", "changed_files": 0, "changes_requested": true, "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "commits": 0, "deletions": 0, "head_branch": "string", "pr_number": 0, "pull_request_draft": true, "pull_request_state": "string", "pull_request_title": "string", "refreshed_at": "2019-08-24T14:15:22Z", "reviewer_count": 0, "stale_at": "2019-08-24T14:15:22Z", "url": "string" }, "files": [ { "created_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "mime_type": "string", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05" } ], "has_unread": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "labels": { "property1": "string", "property2": "string" }, "last_error": { "detail": "string", "kind": "generic", "message": "string", "provider": "string", "retryable": true, "status_code": 0 }, "last_injected_context": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c", "last_turn_summary": "string", "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "parent_chat_id": "c3609ee6-3b11-4a93-b9ae-e4fabcc99359", "pin_order": 0, "plan_mode": "plan", "root_chat_id": "2898031c-fdce-4e3e-8c53-4481dd42fcd7", "status": "waiting", "title": "string", "updated_at": "2019-08-24T14:15:22Z", "warnings": [ "string" ], "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" } ], "client_type": "ui", "created_at": "2019-08-24T14:15:22Z", "diff_status": { "additions": 0, "approved": true, "author_avatar_url": "string", "author_login": "string", "base_branch": "string", "changed_files": 0, "changes_requested": true, "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "commits": 0, "deletions": 0, "head_branch": "string", "pr_number": 0, "pull_request_draft": true, "pull_request_state": "string", "pull_request_title": "string", "refreshed_at": "2019-08-24T14:15:22Z", "reviewer_count": 0, "stale_at": "2019-08-24T14:15:22Z", "url": "string" }, "files": [ { "created_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "mime_type": "string", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05" } ], "has_unread": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "labels": { "property1": "string", "property2": "string" }, "last_error": { "detail": "string", "kind": "generic", "message": "string", "provider": "string", "retryable": true, "status_code": 0 }, "last_injected_context": [ { "args": [ 0 ], "args_delta": "string", "completed_at": "2019-08-24T14:15:22Z", "content": "string", "context_file_agent_id": { "uuid": "string", "valid": true }, "context_file_content": "string", "context_file_directory": "string", "context_file_os": "string", "context_file_path": "string", "context_file_skill_meta_file": "string", "context_file_truncated": true, "created_at": "2019-08-24T14:15:22Z", "data": [ 0 ], "end_line": 0, "file_id": { "uuid": "string", "valid": true }, "file_name": "string", "is_error": true, "is_media": true, "mcp_server_config_id": { "uuid": "string", "valid": true }, "media_type": "string", "name": "string", "provider_executed": true, "provider_metadata": [ 0 ], "result": [ 0 ], "result_delta": "string", "result_reset": true, "signature": "string", "skill_description": "string", "skill_dir": "string", "skill_name": "string", "source_id": "string", "start_line": 0, "text": "string", "title": "string", "tool_call_id": "string", "tool_name": "string", "type": "text", "url": "string" } ], "last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c", "last_turn_summary": "string", "mcp_server_ids": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ], "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "parent_chat_id": "c3609ee6-3b11-4a93-b9ae-e4fabcc99359", "pin_order": 0, "plan_mode": "plan", "root_chat_id": "2898031c-fdce-4e3e-8c53-4481dd42fcd7", "status": "waiting", "title": "string", "updated_at": "2019-08-24T14:15:22Z", "warnings": [ "string" ], "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" }

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.Chat

To perform this operation, you must be authenticated. Learn more.