Start a document processing session
Content type multipart/form-data
Uploads a set of documents and starts reading them. It returns once the documents are stored and their pages rendered, before any of them have been read — results arrive at your webhook. Affordability is checked against the whole pipeline first, so a session you can't pay for never starts.
Request
curl -X POST "https://studioapi.kriyam.ai/models/docwise/v2" \
-H "X-API-Key: $KRIYAM_API_KEY" \
-F "files=@invoice.pdf" \
-F "capability=extract" \
-F "processing_mode=fast" \
--form-string 'extraction_schema={"type": "object", "properties": {"invoice_number": {"type": "string", "description": "The invoice number printed by the seller"}, "invoice_date": {"type": "string", "description": "Date of issue, as YYYY-MM-DD"}, "seller_gstin": {"type": "string", "description": "GSTIN of the seller, not the buyer"}, "total_amount": {"type": "number", "description": "Grand total payable including tax"}, "line_items": {"type": "array", "description": "One entry per billed line", "items": {"type": "object", "properties": {"description": {"type": "string", "description": "What was billed"}, "amount": {"type": "number", "description": "Line total before tax"}}}}}}'Response
Authentication
Send your key in the X-API-Key header. See Authentication.
Request
Body
| Name | Type | Required | Description |
|---|---|---|---|
files | file[] | Required | The documents — repeat the field once per file, up to 5. PDFs and images. |
capability | string | Required | A step to run, repeated once per step: |
processing_mode | string | Optional |
Default fastaccurate |
extraction_schema | object | Optional | The fields |
Response
200 OK
| Field | Type | Description |
|---|---|---|
session_id | uuid | The session. Everything else is read or reported by it. |
documents[] | object[] | The documents as stored, in the order you sent them. None of them have been read yet. |
documents[].id | uuid | One document within the session. |
documents[].original_filename | string | The filename you uploaded. |
documents[].sequence | integer | Its 1-based position in the session, which is how documents are ordered — files uploaded together share a timestamp, so that can't order them. |
documents[].status | string | Where this document has got to on its own. |
Errors
| Status | Code | When |
|---|---|---|
| 400 | — | No file was sent, more than 5 were, no step was requested, or a requested step is unknown or not currently available. Also when |
Every keyed call can also get401402403404429— see Errors.
