Skip to main content
POST
qa_file

Authorizations

X-API-Key
string
header
required

Headers

prefer
string | null
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 qa-file.

path names an uploaded source file — the same addressing as read-file; a workspace-internal derivative path is refused with invalid_request. component scopes the question to one public component by name (a pdf section or a workbook tab — the names file-metadata lists). For a PDF it may also name one of the figures file-metadata lists (figure p3-1: vision over that picture alone) or a page (page 3: vision over the whole rendered page).

path
string
required
query
string
required
Required string length: 1 - 4096
component
string | null
include_citations
boolean
default:true
output_schema
Output Schema · object | null

A JSON Schema (Draft 2020-12, object root, local non-recursive $ref only, no pattern, patternProperties or unevaluated*) the answer must follow. When set, the agent writes answer as JSON text conforming to it, the run checks that and asks the agent to correct a mismatch, and the result carries the parsed value in structured_answer. A field the source does not state comes back null, whatever type the schema gives it. Explanation goes to reasoning where the result has one, and evidences are unchanged. If the answer still misses the schema, the run succeeds with answer as written and structured_answer null. Omit for a prose answer.

Response

Successful Response

Response body for qa-file.

engine reports what answered: recursive_llm for prose, vision for an image, and agent when the file has several parts and a QA agent worked across them. Citations always name the uploaded file, never anything internal.

job_id is the durable job row created for this run; poll or retrieve it via GET /v1/jobs/{job_id} to get the stored answer after the fact.

unavailable is always empty since table files moved to query-tables (which reports unqueryable selections there); the field is retained for wire compatibility.

answer
string
required
citations
Evidence · object[]
required
engine
enum<string>
required
Available options:
recursive_llm,
vision,
agent
confidence
enum<string> | null

The engine's self-graded confidence in the answer — how well the file content it read supports it, on the shared six-level scale (certain / very_high / high / medium / low / speculative). Null when the engine could not grade (a timeout's partial answer, a legacy run).

Available options:
certain,
very_high,
high,
medium,
low,
speculative
job_id
string<uuid> | null
structured_answer
any | null

answer parsed as JSON, set only when the request carried output_schema and the answer validates against it; a field the source does not state is null whatever type the schema gives it. Null on every run without a schema, and on a run whose answer still missed the schema after its corrections, where answer holds the text as written.

timed_out
boolean
default:false
unavailable
UnavailableTable · object[]