---
title: "Get a reference document"
method: GET
path: "/ai-context/documents/{document_id}/"
tags: ["ai-context"]
---

# Get a reference document

`GET /ai-context/documents/{document_id}/`

## Request

- Base URL: `https://api.getoneprofile.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.getoneprofile.ai/ai-context/documents/{document_id}/`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Read one reference document's current state and summary.

## Path parameters

- `document_id` string, uuid, required

## Response `200`

Successful Response

- AiContextDocumentReadSchema: One reference document: what it is, how far it got, and what prompts read.
  - `content_type` string, required
  - `created_at` string, date-time, required
  - `drive_file_id` string, nullable, required
  - `drive_web_view_link` string, nullable, required: Where to open the original in Google Drive, for linked documents.
  - `error` string, nullable, required: Why the document could not be read, written for the reader.
  - `filename` string, required
  - `id` string, uuid, required
  - `in_prompt_budget` boolean: Whether this document's summary actually fits the prompt budget alongside the documents before it. Computed on the list; a single read reports true.
  - `included_in_context` boolean, required: Whether this document's summary joins the business context.
  - `size_bytes` integer, required
  - `source` 'upload' | 'google_drive', required: Where a reference document came from.
  - `status` 'pending' | 'processing' | 'ready' | 'failed', required: How far a reference document has got through extraction and summarizing. Unlike a generation job, ``PENDING`` IS observed here: the row commits first and its workflow starts after that commit, so a reader can catch the gap. The two terminal states are absorbing.
  - `steps` AiStep[]: What the last read did, one step per piece of work once it is done: the document read, the summary written. Grows while the document is `processing`; starts empty again when it is read again.
    - `action` string, required: What kind of move this was, e.g. `read_table`, `plan`, `write_column`.
    - `detail` string: The step's input: the instruction, the column it read, the query it ran.
    - `duration_ms` integer, nullable: Wall clock for the work this step describes, never an estimate.
    - `observation` string: One line on what came back. The half that makes a step worth reading.
    - `outcome` string: `completed`, `failed`, `refused` or `stopped`. Clients must tolerate new tokens.
    - `thought` string, nullable: The model's stated reasoning for choosing this step. Set by the agent loop; the assistant surfaces leave it null, and the renderer simply omits the rung.
  - `summary` string, nullable, required: The markdown summary that stands in for this document in AI prompts.
  - `summary_edited` boolean, required: True once somebody saved over the written summary by hand.
  - `summary_generated_at` string, date-time, nullable, required
  - `title` string, required
  - `updated_at` string, date-time, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Document not found
- `422`: Invalid request made to the API.
- `500`: Internal server error.
- `502`: Bad gateway error.
- `503`: Service unavailable.

---

[API](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile.md) · [All operations](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/llms.txt) · [OpenAPI document](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/revisions/dc5ac3c84444?raw)
