Archive a Dream that has finished.
POST /api/v1/forward/dreams/{id}/archive
Only Dreams in the completed, failed, or canceled state can be archived. Calling this endpoint again for an already archived Dream returns the current object idempotently.
Archiving does not delete the Dream. Archived records are excluded from list results by default; use include_archived=true to retrieve them.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT or admin SAT>. |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Dream ID with the drm_ prefix. |
Example request
Example response
HTTP 200 OK
Response fields
| Field | Type | Description |
|---|---|---|
| Return value | object | The archived Dream object, with a non-null archived_at. |
Errors
| HTTP | Type | Trigger |
|---|---|---|
400 | invalid_request_error | Invalid id, non-empty request body, or the Dream has not reached a terminal state. error.code can be invalid_dream_id, invalid_request_body, or dream_not_archivable. |
401 | authentication_error | Authentication is missing, invalid, or expired. |
403 | permission_error | The token cannot manage Dreams. Identity SAT is not supported by this endpoint. |
404 | not_found_error | The Dream does not exist or is not visible to the caller. error.code is dream_not_found. |
429 | rate_limit_error | The request rate limit has been reached. |
500/502/503 | api_error | The service or an internal dependency is temporarily unavailable. |

