Skip to main content
POST
/
document
/
agent
/
jobs
Enqueue an async document agent job
curl --request POST \
  --url https://apigcp.trynia.ai/v2/document/agent/jobs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "source_id": "<string>",
  "source_ids": [
    "<string>"
  ],
  "json_schema": {},
  "model": "claude-opus-4-6-1m",
  "thinking_enabled": true,
  "thinking_budget": 10000,
  "stream": false
}
'
{
  "job_id": "<string>",
  "status": "<string>",
  "created_at": "<string>",
  "message": "<string>"
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Body

application/json

Request for the v2 document/agent endpoint.

query
string
required

Question to ask about the document(s)

Required string length: 1 - 10000
source_id
string | null

Data source ID of a single indexed document

source_ids
string[] | null

List of data source IDs for multi-document queries (max 10)

Maximum array length: 10
json_schema
Json Schema · object

JSON Schema for structured output

model
string
default:claude-opus-4-6-1m

Model to use (claude-opus-4-6-1m, claude-opus-4-6, claude-sonnet-4-5-20250929, etc.)

thinking_enabled
boolean
default:true

Enable extended thinking

thinking_budget
integer
default:10000

Token budget for thinking (ignored for adaptive models like Opus 4.6)

Required range: 1000 <= x <= 50000
stream
boolean
default:false

Stream response as SSE events

Response

Successful Response

Returned by POST /document/agent/jobs.

job_id
string
required

Workflow run id — pass to GET/stream/cancel endpoints

status
string
required

Initial status — usually 'queued'

created_at
string
required
message
string
required