Skip to main content
POST /api/v1/cloud/sessions/{session_id}/threads/{thread_id}/archive Archives a child thread. Current CAS returns 409 when asked to archive the coordinator/main thread.

Path parameters

ParameterTypeDescription
session_idstringSession ID with the sess_ prefix
thread_idstringThread ID with the sthr_ prefix

Headers

HeaderRequiredDescription
AuthorizationYesBearer $QODER_PAT

Example request

curl -X POST "https://api.qoder.com/api/v1/cloud/sessions/sess_019f00000000000000000000000000aa/threads/sthr_019f00000000000000000000000002bb/archive" \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 200 OK Returns the Session Thread object.
{
  "id": "sthr_019ef2a07a06704fb899908c29eed779",
  "type": "session_thread",
  "session_id": "sess_019ef2a07a0670b3b68a84f0f3c5c98e",
  "parent_thread_id": "sthr_019ef2a07a06704fb899908c29eed778",
  "agent": {
    "id": "agent_019e390add9f7bac9b6cc806db46fcbd",
    "type": "agent",
    "version": 2,
    "name": "doc-test-agent",
    "description": "",
    "model": {"id": "ultimate", "effective_context_window": 200000},
    "system": "You are an expert software engineer.",
    "tools": [{"enabled_tools": ["Bash", "Read", "Write", "Edit", "Glob", "Grep"], "type": "agent_toolset_20260401"}],
    "skills": [],
    "mcp_servers": []
  },
  "status": "terminated",
  "stats": null,
  "archived_at": "2026-06-23T06:00:00.000Z",
  "created_at": "2026-06-23T05:53:19.774840Z",
  "updated_at": "2026-06-23T06:00:00.000Z"
}

Errors

HTTPTypeTrigger
401authentication_errorPAT invalid or expired
404not_found_errorSession or thread does not exist
409invalid_request_errorCoordinator/main thread cannot be archived, the thread is not in idle status, or another version/state conflict
HTTP 404 Not Found
{
  "type": "error",
  "request_id": "cb80235f-76a2-4ff3-9e28-5aa2da12dc14",
  "error": {
    "type": "not_found_error",
    "message": "Session thread 'sthr_fakefakefake_xxxxxxxxxxxxxxxx' was not found."
  },
  "request_id": "b5822072-f264-48da-9d61-6d48ffb07551"
}
HTTP 409 Conflict
{
  "type": "error",
  "request_id": "cb80235f-76a2-4ff3-9e28-5aa2da12dc14",
  "error": {
    "type": "invalid_request_error",
    "message": "Version or state conflict."
  }
}
The 409 response uses a single generic "Version or state conflict." message regardless of whether the conflict is caused by the coordinator role, a non-idle thread status, or another concurrency conflict. Disambiguate by inspecting the thread state via GET /api/v1/cloud/sessions/{session_id}/threads/{thread_id}. See Errors for the full error envelope.

Managed Agents

Learn the coordinator and child thread collaboration model.

List Session Threads

Inspect all threads in a session and their statuses.

Session Thread object

Full field reference for the Session Thread object.