API reference
Batches
A batch is one extraction run over one or more files: its status, rows and downloads.
The Batch objectLink to section
created_atintegerRequiredAt least 0.
updated_atintegerRequiredAt least 0.
idstringRequired1 to 48 characters.
project_idstringRequired1 to 48 characters.
table_idstringRequirednullable1 to 48 characters.
actor_typestringRequired- Allowed values
userapi_key
actor_idstringRequiredUp to 36 characters.
schema_jsonobjectRequiredcolumnsarray of objectsRequired1 to 50 items.
descriptionstringoptionalnullableUp to 256 characters.
instructionstringoptionalnullableUp to 512 characters.
namestringRequired- Matches
^[\w\s.-]+$
1 to 64 characters.
typestringRequired- Allowed values
arraybooleancurrencydateemailenummulti_selectnumberstringtexturl- Default
string
instructionstringoptionalnullableUp to 512 characters.
strictnessstringRequired- Allowed values
strictbalancedflexible- Default
strict
{ "created_at": 1711468800000, "updated_at": 1711468800000, "id": "batch_01h5a3g8k9m2n4p6q8r0t2v4x6", "project_id": "string", "table_id": "string", "actor_type": "user", "actor_id": "string", "schema_json": { "columns": [ { "description": "string", "instruction": "string", "name": "string", "type": "string" } ], "instruction": "string", "strictness": "strict" }, "insert_mode": "append", "status": "uploading", "file_count": 42, "files_done": 42, "current_file": "string", "csv_key": "string", "json_key": "string", "xlsx_key": "string", "total_rows": 42, "confidence": 0.5, "duration_ms": 42, "error": "string", "extractions": [ { "created_at": 1711468800000, "id": "extr_01h5a3g8k9m2n4p6q8r0t2v4x6", "batch_id": "string", "table_id": "string", "file_key": "string", "file_name": "string", "file_type": "text_pdf", "file_checksum": "string", "status": "pending", "rows_key": "string", "row_count": 42, "confidence": 0.5, "error": "string" } ]}List batches
GET/v1/projects/{project_id}/batches
Path parameters
project_idstringRequired
Query parameters
cursorstringoptionalOpaque cursor for forward pagination. Pass the nextCursor from the previous response with the same order. Takes precedence over page when both are sent.
pageintegeroptional1-based page number for offset pagination. Ignored when cursor is present.
At least 1.
orderstringoptionalSort keys, comma-separated, each
field[.asc|.desc][.nullsfirst|.nullslast]; at most 3. Sortable: created_at, status, total_rows. Default: created_at.desc. Nulls sort last ascending and first descending unless stated.- Matches
^(?:created_at|status|total_rows)(?:\.(?:asc|desc))?(?:\.(?:nullsfirst|nullslast))?(?:,(?:created_at|status|total_rows)(?:\.(?:asc|desc))?(?:\.(?:nullsfirst|nullslast))?){0,2}$
limitintegeroptionalMaximum number of items per page. Defaults to 20, capped by the endpoint's maxLimit.
- Default
20
Between 1 and 100.
statusstringoptional- Allowed values
uploadingprocessingmergingcompletepartialfailed
Returns
200application/json
countintegerRequiredAt least 0.
hasMorebooleanRequiredlimitintegerRequiredAt least 1.
nextCursorstringRequirednullablepageintegerRequirednullableAt least 1.
batchesarray of objectsRequiredcreated_atintegerRequiredAt least 0.
updated_atintegerRequiredAt least 0.
idstringRequired1 to 48 characters.
project_idstringRequired1 to 48 characters.
table_idstringRequirednullable1 to 48 characters.
actor_typestringRequired- Allowed values
userapi_key
actor_idstringRequiredUp to 36 characters.
schema_jsonobjectRequiredcolumnsarray of objectsRequired1 to 50 items.
descriptionstringoptionalnullableUp to 256 characters.
instructionstringoptionalnullableUp to 512 characters.
namestringRequired- Matches
^[\w\s.-]+$
1 to 64 characters.
typestringRequired- Allowed values
arraybooleancurrencydateemailenummulti_selectnumberstringtexturl- Default
string
instructionstringoptionalnullableUp to 512 characters.
strictnessstringRequired- Allowed values
strictbalancedflexible- Default
strict
insert_modestringRequirednullable- Allowed values
appenddedupmergereplace
statusstringRequired- Allowed values
uploadingprocessingmergingcompletepartialfailed
file_countintegerRequiredAt least 1.
files_doneintegerRequiredAt least 0.
current_filestringRequirednullableUp to 255 characters.
csv_keystringRequirednullableUp to 512 characters.
json_keystringRequirednullableUp to 512 characters.
xlsx_keystringRequirednullableUp to 512 characters.
total_rowsintegerRequirednullableAt least 0.
confidencenumberRequirednullableduration_msintegerRequirednullableAt least 0.
errorstringRequirednullableUp to 2048 characters.
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({ baseURL: "https://api.anyrow.ai", headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.batch.list({ params: { project_id: "{project_id}" },}){ "count": 0, "hasMore": true, "limit": 1, "nextCursor": "string", "page": 1, "batches": [ { "created_at": 1711468800000, "updated_at": 1711468800000, "id": "batch_01h5a3g8k9m2n4p6q8r0t2v4x6", "project_id": "string", "table_id": "string", "actor_type": "user", "actor_id": "string", "schema_json": { "columns": [ { "description": "string", "instruction": "string", "name": "string", "type": "string" } ], "instruction": "string", "strictness": "strict" }, "insert_mode": "append", "status": "uploading", "file_count": 42, "files_done": 42, "current_file": "string", "csv_key": "string", "json_key": "string", "xlsx_key": "string", "total_rows": 42, "confidence": 0.5, "duration_ms": 42, "error": "string" } ]}Get batch
GET/v1/projects/{project_id}/batches/{batch_id}
Path parameters
project_idstringRequiredbatch_idstringRequired
Returns
200application/json
created_atintegerRequiredAt least 0.
updated_atintegerRequiredAt least 0.
idstringRequired1 to 48 characters.
project_idstringRequired1 to 48 characters.
table_idstringRequirednullable1 to 48 characters.
actor_typestringRequired- Allowed values
userapi_key
actor_idstringRequiredUp to 36 characters.
schema_jsonobjectRequiredcolumnsarray of objectsRequired1 to 50 items.
descriptionstringoptionalnullableUp to 256 characters.
instructionstringoptionalnullableUp to 512 characters.
namestringRequired- Matches
^[\w\s.-]+$
1 to 64 characters.
typestringRequired- Allowed values
arraybooleancurrencydateemailenummulti_selectnumberstringtexturl- Default
string
instructionstringoptionalnullableUp to 512 characters.
strictnessstringRequired- Allowed values
strictbalancedflexible- Default
strict
insert_modestringRequirednullable- Allowed values
appenddedupmergereplace
statusstringRequired- Allowed values
uploadingprocessingmergingcompletepartialfailed
file_countintegerRequiredAt least 1.
files_doneintegerRequiredAt least 0.
current_filestringRequirednullableUp to 255 characters.
csv_keystringRequirednullableUp to 512 characters.
json_keystringRequirednullableUp to 512 characters.
xlsx_keystringRequirednullableUp to 512 characters.
total_rowsintegerRequirednullableAt least 0.
confidencenumberRequirednullableduration_msintegerRequirednullableAt least 0.
errorstringRequirednullableUp to 2048 characters.
extractionsarray of objectsoptionalcreated_atintegerRequiredAt least 0.
idstringRequired1 to 48 characters.
batch_idstringRequired1 to 48 characters.
table_idstringRequirednullable1 to 48 characters.
file_keystringRequiredUp to 512 characters.
file_namestringRequiredUp to 255 characters.
file_typestringRequirednullable- Allowed values
text_pdfscannedimagetextdocumentunknown
file_checksumstringRequirednullableUp to 64 characters.
statusstringRequired- Allowed values
pendingprocessingcompletefailed
rows_keystringRequirednullableUp to 512 characters.
row_countintegerRequirednullableAt least 0.
confidencenumberRequirednullableerrorstringRequirednullableUp to 2048 characters.
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({ baseURL: "https://api.anyrow.ai", headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.batch.get({ params: { project_id: "{project_id}", batch_id: "{batch_id}" },}){ "created_at": 1711468800000, "updated_at": 1711468800000, "id": "batch_01h5a3g8k9m2n4p6q8r0t2v4x6", "project_id": "string", "table_id": "string", "actor_type": "user", "actor_id": "string", "schema_json": { "columns": [ { "description": "string", "instruction": "string", "name": "string", "type": "string" } ], "instruction": "string", "strictness": "strict" }, "insert_mode": "append", "status": "uploading", "file_count": 42, "files_done": 42, "current_file": "string", "csv_key": "string", "json_key": "string", "xlsx_key": "string", "total_rows": 42, "confidence": 0.5, "duration_ms": 42, "error": "string", "extractions": [ { "created_at": 1711468800000, "id": "extr_01h5a3g8k9m2n4p6q8r0t2v4x6", "batch_id": "string", "table_id": "string", "file_key": "string", "file_name": "string", "file_type": "text_pdf", "file_checksum": "string", "status": "pending", "rows_key": "string", "row_count": 42, "confidence": 0.5, "error": "string" } ]}Download batch CSV
GET/v1/projects/{project_id}/batches/{batch_id}/download/csv
Path parameters
project_idstringRequiredbatch_idstringRequired
Returns
No response body; the request succeeds or returns an error.
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({ baseURL: "https://api.anyrow.ai", headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.batch.download.csv({ params: { project_id: "{project_id}", batch_id: "{batch_id}" },})Download batch JSON
GET/v1/projects/{project_id}/batches/{batch_id}/download/json
Path parameters
project_idstringRequiredbatch_idstringRequired
Returns
No response body; the request succeeds or returns an error.
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({ baseURL: "https://api.anyrow.ai", headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.batch.download.json({ params: { project_id: "{project_id}", batch_id: "{batch_id}" },})Download batch XLSX
GET/v1/projects/{project_id}/batches/{batch_id}/download/xlsx
Path parameters
project_idstringRequiredbatch_idstringRequired
Returns
No response body; the request succeeds or returns an error.
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({ baseURL: "https://api.anyrow.ai", headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.batch.download.xlsx({ params: { project_id: "{project_id}", batch_id: "{batch_id}" },})