Skip to main content
POST /v1/dreams/{id}/archive Archives the specified Dream. Only terminal-state Dreams (completed, failed, canceled) can be archived. Calling archive on an already-archived Dream is idempotent. Returns the updated Dream object. Archived Dreams are excluded from list results by default unless include_archived=true is passed.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>

Path parameters

ParameterTypeDescription
idstringDream ID (drm_ prefix)

Example request

curl -s -X POST 'https://api.qoder.com/api/v1/cloud/dreams/drm_019e86b4a8f070a3b6c5d4e3f2a1b0c9/archive' \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 200 OK
{
  "id": "drm_019e86b4a8f070a3b6c5d4e3f2a1b0c9",
  "type": "dream",
  "status": "completed",
  "inputs": [{ "type": "memory_store", "memory_store_id": "memstore_019e5cdb9c3f71c3b6505eba937a40b4" }],
  "outputs": [{ "type": "memory_store", "memory_store_id": "memstore_019e86b4b10578059435632bb357c5ed", "files_touched": ["preferences.md"] }],
  "model": { "id": "auto" },
  "instructions": "",
  "session_id": "sess_019e86b4b10578059435632bb357c5ed",
  "usage": { "input_tokens": 12500, "output_tokens": 3200, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 8000 },
  "error": null,
  "created_at": "2026-06-15T10:00:00Z",
  "ended_at": "2026-06-15T10:03:42Z",
  "archived_at": "2026-06-15T12:00:00Z"
}

Errors

HTTPTypeTrigger
400invalid_request_errorDream is in pending or running state (cancel it first)
401authentication_errorMissing or invalid authentication token
404not_found_errorDream does not exist
See Error Reference for the full error envelope.