---
title: "List the reference documents"
method: GET
path: "/ai-context/documents/"
tags: ["ai-context", "mcp-searchable-tool"]
---

# List the reference documents

`GET /ai-context/documents/`

## 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/`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

List the reference documents attached to the organization's business context, oldest first. Poll this while any document's status is `processing`; reading one takes roughly 10-60 seconds.

## Response `200`

Successful Response

- AiContextDocumentListSchema: The org's reference documents, with the cap so the UI can show it.
  - `documents` AiContextDocumentReadSchema[], required
    - `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
  - `max_context_chars` integer, required: How many characters of included summaries one prompt reads, oldest document first. Documents past that line report `in_prompt_budget: false`.
  - `max_documents` integer, required: How many documents this workspace may keep.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `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/4a6bd71e3f02?raw)
