Archives a session: sets status to the terminal state terminated, populates archived_at with the archive time, and event history remains queryable.
Prerequisites
Endpoint and authentication configured. For details, see Overview and authentication.
Endpoint
POST /sessions/{session_id}/archive
Request example
Response example
Returns the full session object with status set to terminated and archived_at populated with the archive time.
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Session ID |
type | string | Always session |
status | string | Set to terminated (terminal state) after archiving |
agent | object | Agent configuration snapshot |
environment_id | string | The bound environment ID |
title / metadata | string / object | Session title and business metadata |
archived_at | string | Archive time, ISO 8601; this field is always non-null in responses from the archive endpoint |
created_at / updated_at | string | Creation/last update time |
request_id | string | Unique identifier for this request |