Skip to main content
POST
Rate limit tier: submission, 60 requests/min. See Rate limits. Answers a question about what a workflow’s documents say: contract terms, invoice details, anything that needs reading rather than a field lookup. Extraction answers “what is in this document”. This endpoint answers “what do these documents say about X”, across the whole workflow. Every answer carries the exact quotes it rests on. Each quote resolves to a page and a region in the source PDF, so you can show a customer where a number came from.

Requires a knowledge base

The workflow needs a knowledge node, which indexes its documents into a corpus. Without one, the endpoint returns 409 KNOWLEDGE_NOT_ENABLED. Add the node in Studio, or include it when you create the workflow. The corpus is workflow-scoped, not version-scoped. It accumulates the latest parse of every live file, across all runs and versions. A document parsed under an older workflow version stays answerable.

Errors

Follow-up questions

Pass a thread_id you mint yourself, starting with kb-, to ask in the context of earlier questions in that thread. Omit it and each question stands alone. Reuse the same id to continue a conversation.

Billing

The platform charges per question and meters the text the agent reads. A narrow question over a small corpus therefore costs a fraction of a broad sweep over a large one. A question the organization cannot pay for is refused up front.

Authorizations

Authorization
string
header
required

API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.

Path Parameters

workflow_id
string
required

Body

application/json
question
string
required

A question about the content of this workflow's documents.

Minimum string length: 1
Example:

"Which contracts renew before March and what notice do they need?"

thread_id
string | null

Optional conversation id, minted by you, to ask a follow-up in context. Must start with kb-. Reuse it to continue; omit it for a fresh question.

Maximum string length: 64
Pattern: ^kb-[A-Za-z0-9._-]+$
Example:

"kb-renewals-q3"

Response

Successful Response

answer
string
required
citations
AskCitationV3 · object[]
required
path
AskStepV3 · object[]
required

The route the agent took to the answer — auditable, not decorative.

steps_used
integer
required
thread_id
string | null

Present when the question was asked in a thread.