Skip to main content
Dreams

Archive a Dream

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

HeaderRequiredDescription
AuthorizationYesBearer <PAT or admin SAT>.

Path parameters

ParameterTypeRequiredDescription
idstringYesDream ID with the drm_ prefix.

Example request

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

Example response

HTTP 200 OK
{
  "id": "drm_019e86b4a8f070a3b6c5d4e3f2a1b0c9",
  "type": "dream",
  "status": "completed",
  "inputs": [{
    "type": "identity_template",
    "identity_id": "idn_019eabc123",
    "template_id": "tmpl_support"
  }],
  "outputs": [{
    "type": "memory_store",
    "memory_store_id": "memstore_019e86b4b10578059435632bb357c5ed",
    "files_touched": ["preferences.md"]
  }],
  "model": { "id": "auto" },
  "instructions": "Focus on long-term preferences confirmed by the user",
  "usage": {
    "input_tokens": 12500,
    "output_tokens": 3200,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 8000
  },
  "error": null,
  "created_at": "2026-09-15T03:00:00Z",
  "ended_at": "2026-09-15T03:03:42Z",
  "archived_at": "2026-09-15T06:00:00Z"
}

Response fields

FieldTypeDescription
Return valueobjectThe archived Dream object, with a non-null archived_at.

Errors

HTTPTypeTrigger
400invalid_request_errorInvalid 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.
401authentication_errorAuthentication is missing, invalid, or expired.
403permission_errorThe token cannot manage Dreams. Identity SAT is not supported by this endpoint.
404not_found_errorThe Dream does not exist or is not visible to the caller. error.code is dream_not_found.
429rate_limit_errorThe request rate limit has been reached.
500/502/503api_errorThe service or an internal dependency is temporarily unavailable.
Best Practices
API reference