Skip to main content

Archive a session thread

Archive a child thread in a Forward session.

Request headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>
Idempotency-KeyNoOptional idempotency key for unsafe requests.

Path parameters

ParameterTypeRequiredDescription
session_idstringYesSession ID.
thread_idstringYesThread ID.

Example request

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/sessions/sess_xxx/threads/sthr_child_xxx/archive' \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 200 OK
{
  "id": "sthr_child_xxx",
  "type": "session_thread",
  "session_id": "sess_xxx",
  "parent_thread_id": "sthr_xxx",
  "template_id": "tmpl_worker",
  "name": "research",
  "role": "child",
  "status": "archived",
  "stop_reason": {
    "type": "archive"
  },
  "created_by_tool_use_id": "toolu_xxx",
  "archived_at": "2026-06-22T12:00:00Z",
  "created_at": "2026-06-22T11:00:00Z",
  "updated_at": "2026-06-22T12:00:00Z"
}

Response fields

Returns the archived Thread object.

Errors

HTTPTypeCodeTrigger
401authentication_errorauthentication_requiredPAT invalid or expired.
404not_found_errorsession_not_foundSession does not exist.
404not_found_errorthread_not_foundThread does not exist or does not belong to the Session.
409conflict_errorcoordinator_thread_not_archivableCaller attempted to archive the coordinator thread.
409conflict_errorthread_not_idleThread is not idle.

Notes

  • Only role=child and status=idle threads are archivable.
  • The response uses the filtered Forward Thread object.