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.
idstringRequiredproject_idstringRequiredtable_idstringRequirednullableactor_typestringRequired- Allowed values
userapi_key
actor_idstringRequiredschema_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
Requirestables:read
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.
Up to 8192 characters.
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}$
Up to 200 characters.
limitintegeroptionalMaximum number of items per page, in decimal digits. Defaults to 20, capped by the endpoint's maxLimit.
- Default
20
Between 1 and 100.
pageintegeroptional1-based page number for offset pagination, up to the endpoint's maxPage (x-comb); page further by cursor. A page that is no whole number from 1, in decimal digits, is a 400 invalid_page, and one past maxPage a 400 page_too_deep, with or without a cursor. Ignored when cursor is present.
Between 1 and 10000.
statusstringoptional- Allowed values
uploadingprocessingmergingcompletepartialfailed
Returns
200application/json
countintegerRequirednullableAt least 0.
hasMorebooleanRequiredlimitintegerRequiredAt least 1.
nextCursorstringRequirednullablepageintegerRequirednullableAt least 1.
batchesarray of objectsRequiredcreated_atintegerRequiredAt least 0.
updated_atintegerRequiredAt least 0.
idstringRequiredproject_idstringRequiredtable_idstringRequirednullableactor_typestringRequired- Allowed values
userapi_key
actor_idstringRequiredschema_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_countintegerRequiredfiles_doneintegerRequiredcurrent_filestringRequirednullablecsv_keystringRequirednullablejson_keystringRequirednullablexlsx_keystringRequirednullabletotal_rowsintegerRequirednullableconfidencenumberRequirednullableduration_msintegerRequirednullableerrorstringRequirednullable
curl 'https://api.anyrow.ai/v1/projects/{project_id}/batches' \ -H 'Authorization: ApiKey {your_api_key}'{ "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}
Requirestables:read
Path parameters
project_idstringRequiredbatch_idstringRequired
Returns
200application/json
created_atintegerRequiredAt least 0.
updated_atintegerRequiredAt least 0.
idstringRequiredproject_idstringRequiredtable_idstringRequirednullableactor_typestringRequired- Allowed values
userapi_key
actor_idstringRequiredschema_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_countintegerRequiredfiles_doneintegerRequiredcurrent_filestringRequirednullablecsv_keystringRequirednullablejson_keystringRequirednullablexlsx_keystringRequirednullabletotal_rowsintegerRequirednullableconfidencenumberRequirednullableduration_msintegerRequirednullableerrorstringRequirednullableextractionsarray of objectsoptionalcreated_atintegerRequiredAt least 0.
idstringRequiredbatch_idstringRequiredtable_idstringRequirednullablefile_keystringRequiredfile_namestringRequiredfile_typestringRequirednullable- Allowed values
text_pdfscannedimagetextdocumentunknown
file_checksumstringRequirednullablestatusstringRequired- Allowed values
pendingprocessingcompletefailed
rows_keystringRequirednullablerow_countintegerRequirednullableconfidencenumberRequirednullableerrorstringRequirednullable
Errors
- 404
batch_not_foundnot_found - 500
captcha_unavailableinternal_server_error
curl 'https://api.anyrow.ai/v1/projects/{project_id}/batches/{batch_id}' \ -H 'Authorization: ApiKey {your_api_key}'{ "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
Requirestables:read
Path parameters
project_idstringRequiredbatch_idstringRequired
Returns
200text/csv
Errors
- 400
batch_not_completecaptcha_failedcaptcha_requiredinvalid_input - 404
batch_not_foundbatch_result_emptynot_found - 500
batch_download_failedcaptcha_unavailableinternal_server_error
curl 'https://api.anyrow.ai/v1/projects/{project_id}/batches/{batch_id}/download/csv' \ -H 'Authorization: ApiKey {your_api_key}'stringDownload batch JSON
GET/v1/projects/{project_id}/batches/{batch_id}/download/json
Requirestables:read
Path parameters
project_idstringRequiredbatch_idstringRequired
Returns
200application/json
batchIdstringRequiredrowsarray of objectsRequiredtotalRowsintegerRequiredAt least 0.
Errors
- 400
batch_not_completecaptcha_failedcaptcha_requiredinvalid_input - 404
batch_not_foundbatch_result_emptynot_found - 500
batch_download_failedcaptcha_unavailableinternal_server_error
curl 'https://api.anyrow.ai/v1/projects/{project_id}/batches/{batch_id}/download/json' \ -H 'Authorization: ApiKey {your_api_key}'{ "batchId": "string", "rows": [ {} ], "totalRows": 0}Download batch XLSX
GET/v1/projects/{project_id}/batches/{batch_id}/download/xlsx
Requirestables:read
Path parameters
project_idstringRequiredbatch_idstringRequired
Returns
200application/octet-stream
Errors
- 400
batch_not_completecaptcha_failedcaptcha_requiredinvalid_input - 404
batch_not_foundbatch_result_emptynot_found - 500
batch_download_failedcaptcha_unavailableinternal_server_error
curl 'https://api.anyrow.ai/v1/projects/{project_id}/batches/{batch_id}/download/xlsx' \ -H 'Authorization: ApiKey {your_api_key}'{ "error_key": "batch_not_complete", "fields": { "key": [ { "error_key": "string", "message": "string", "path": "string" } ] }, "message": "string", "status": 400, "status_key": "string", "success": false, "vars": { "key": "string" }}