Skip to main content
POST
read_file

Authorizations

X-API-Key
string
header
required

Headers

Idempotency-Key
string | null

Replaying a request with the same key returns the original job with 200, never a second job. The key is kept with the job for replay and never cleared, so it must not contain personal data.

Maximum string length: 200

Path Parameters

workspace_id
string<uuid>
required

Workspace identifier.

Body

application/json

Request body for read-file.

path names an uploaded source file — the only namespace this tool serves. A workspace-internal derivative path is refused with invalid_request naming the uploaded file that owns it.

component scopes the read to one public component by name — a spreadsheet tab or a pdf section, as listed by file-metadata.

pages is 1-based and selects on the file's absolute page numbers; out-of-range pages are ignored (absent from pages_returned). Selected pages come back de-duplicated in document order, whatever order they were asked in. Spreadsheets have no pages — scope those with component instead.

path
string
required

The uploaded file's full path relative to the workspace root, exactly as it was uploaded and as listings and search results print it — e.g. evidence/doc-7f83/contract.pdf. Not a bare file name (a file's file_name), a folder, a file id, or a path that starts with the workspace id.

Required string length: 1 - 1024
component
string | null

One tab or section to read, named as file-metadata lists it; omitted: the whole file.

line_end
integer | null

Last line to return, inclusive and 1-based like line_start. Omitted: the last line.

Required range: x >= 1
line_start
integer | null

First line to return, 1-based, counted in the text this read would return without a line range (after component and page selection). Omitted: line 1.

Required range: x >= 1
max_chars
integer
default:200000

Character budget for the returned text; past it truncated is true.

Required range: 1 <= x <= 1000000
pages
integer[] | null

1-based page numbers to read; omitted: every page. Spreadsheets have no pages.

Response

Successful Response

Response body for read-file.

A file with several components (a spreadsheet's tabs, a pdf's sections) answers with their text concatenated in the file's own order, each part prefixed by a one-line header naming the component. components_returned lists what contributed to content; components_omitted lists components that were cut for size — the character budget ran out, or a part was too large to serve — or that have no text rendering at all (a query-only tab; ask it with qa-file) — so an absent component is always visible, never a silently missing tab. Unnamed components (a recording, a raw upload) are listed by kind. A table a PDF page holds comes as rows — one | a | b | line each under a header that joins the stacked column headings — the way grep and hybrid-search print it.

components_omitted
string[]
required
components_returned
string[]
required
content
string
required
file_id
string<uuid>
required
pages_returned
integer[]
required
path
string
required
truncated
boolean
required
job_id
string<uuid> | null

The external operation job; absent for commands inside a search job.

line_count
integer | null

How many lines the whole selected text has, when the request named a line range; None otherwise.

line_end
integer | null

Last line returned (inclusive) when the request named a line range; None otherwise or when line_start is past the end of the text.

line_start
integer | null

First line returned (1-based) when the request named a line range; None otherwise.

sql_tables
string[]

The run-sql names of the tables holding the rows of the long tables printed in the returned sections — count, total or rank those rows there rather than from the text.

table
GrepTable · object | null

When a line range starts inside a table, below its header row: that table's lines, title and header, so the rows read with their column names.