Archive an idle child Thread in a Forward Session.
POST /api/v1/forward/sessions/{session_id}/threads/{thread_id}/archive
Only a Thread with role=child and status=idle can be archived. The coordinator Thread cannot be archived.
Request headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer <PAT or SAT> |
| Idempotency-Key | No | Identifies one logical archive attempt. Use a unique value for each new logical attempt. |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| session_id | string | Yes | Session ID with the sess_ prefix. |
| thread_id | string | Yes | Thread ID with the sthr_ prefix. |
Example request
Example response
HTTP 200 OK
HTTP 200 OK. The response is a Thread object.
Errors
| HTTP | Type | Code | Condition |
|---|---|---|---|
| 401 | authentication_error | authentication_required | The PAT or SAT is invalid or expired. |
| 404 | not_found | session_not_found | The Session does not exist or is not visible to the caller. |
| 404 | not_found_error | thread_not_found | The Thread does not exist or does not belong to the Session. |
| 409 | conflict_error | coordinator_thread_not_archivable | The request tried to archive the coordinator Thread. |
| 409 | conflict_error | thread_not_idle | The child Thread is not currently idle. |
| 502 | api_error | runtime_unavailable | The runtime service is unavailable or state reconciliation failed after an archive conflict. |
Notes
- The same
Idempotency-Keyreplays a cached non-5xx response. After a cached409 thread_not_idle, use a new key if the Thread state has changed and you want to retry. - Retry an ambiguous
502 runtime_unavailablewith the same key. - Confirm the final state with the get Thread endpoint. Do not rely only on a
session.thread_status_terminatedEvent.