---
title: "Get indexed document text"
method: GET
path: "/api/v2/projects/{slug}/documents/{document_id}/"
tags: ["Projects"]
---

# Get indexed document text

`GET /api/v2/projects/{slug}/documents/{document_id}/`

## Request

- Base URL: `https://app.biel.ai`
- URL: `https://app.biel.ai/api/v2/projects/{slug}/documents/{document_id}/`
- Auth: one of:
  - API key in header `Authorization`
  - none

Read a document's complete indexed text without contacting the original
source site. First search with `source_types=all` and copy a result's
`document_id`. This returns text chunks in reading order with available
page or worksheet references, not a live page or an original binary file.

Responses contain up to `limit` chunks (default 20, maximum 20). When
`next_cursor` is not null, repeat the request using that cursor and the
same `document_id` and `limit`. Continue until `next_cursor` is null.
References and cursors are scoped to the project and its active index.
After an index refresh or a 404, search again for a current reference.

Existing project access, allowed-domain, trial and interaction-limit
checks apply. Each successful read counts as a search interaction and
does not create a chat. Older repository or OpenAPI indexes and older
uploaded files with backticks in their names may require a recrawl (409).

Each successful pagination request counts separately toward your team's interaction allowance.
With extra usage enabled, interactions beyond that allowance cost **$0.05** each. See
[extra usage](/administration/subscription#extra-usage).

**Required permission:** `search` (private projects only).

## Path parameters

- `slug` string, required
- `document_id` string, required

## Query parameters

- `cursor` string
- `limit` integer
- `url` string

## Response `200`

Indexed document text and a continuation cursor, if more chunks remain.

- IndexedDocument
  - `document_id` string, required: The document reference supplied in the request.
  - `title` string, required: Indexed document title or filename.
  - `source_type` 'page' | 'file' | 'repository' | 'openapi', required
  - `url` string, uri, nullable, required: Source page URL, or null for file, repository and OpenAPI sources.
  - `file_path` string, required: Repository-relative file path when available, otherwise blank.
  - `total_chunks` integer, required: Total indexed chunks in the document, across all response pages.
  - `chunks` IndexedDocumentChunk[], required: This response's indexed text chunks, in reading order.
    - `content` string, required: Text stored in this indexed chunk.
    - `chunk_index` integer, required: Zero-based chunk position within the source page.
    - `page` integer, nullable, required: Document page or slide number when available, otherwise null.
    - `sheet` string, required: Worksheet name when available, otherwise blank.
  - `next_cursor` string, nullable, required: Opaque continuation cursor. Repeat with the same document_id and limit until this value is null.

## Other responses

- `400`: Invalid cursor, changed pagination limit, or invalid query parameters. Parameter validation errors are keyed by field name.
- `403`: Project access, permission, domain, trial or interaction-limit check failed.
- `404`: Project or document unavailable, including stale references and references from another project. Search again for a current document ID.
- `409`: Recrawl this source to enable complete document retrieval, then search again.
- `500`: Document retrieval is temporarily unavailable. Retry later.

---

[API](https://skmtc.dev/biel/apis/biel-ai-api.md) · [All operations](https://skmtc.dev/biel/apis/biel-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/biel/apis/biel-ai-api/revisions/ac7034d82696?raw)
