Skip to content

API reference

Batches

A batch is one extraction run over one or more files: its status, rows and downloads.

The Batch object

  • created_atintegerRequired

    At least 0.

  • updated_atintegerRequired

    At least 0.

  • idstringRequired
  • project_idstringRequired
  • table_idstringRequirednullable
  • actor_typestringRequired
    Allowed values
    userapi_key
  • actor_idstringRequired
  • schema_jsonobjectRequired
The Batch objectjson
{  "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

  • cursorstringoptional

    Opaque 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.

  • orderstringoptional

    Sort 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.

  • limitintegeroptional

    Maximum number of items per page, in decimal digits. Defaults to 20, capped by the endpoint's maxLimit.

    Default
    20

    Between 1 and 100.

  • pageintegeroptional

    1-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

  • countintegerRequirednullable

    At least 0.

  • hasMorebooleanRequired
  • limitintegerRequired

    At least 1.

  • nextCursorstringRequirednullable
  • pageintegerRequirednullable

    At least 1.

  • batchesarray of objectsRequired

Errors

  • 404not_found
  • 500captcha_unavailableinternal_server_error
Errors every endpoint can return
Requestbash
curl 'https://api.anyrow.ai/v1/projects/{project_id}/batches' \  -H 'Authorization: ApiKey {your_api_key}'
Responsejson
{  "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_idstringRequired
  • batch_idstringRequired

Returns

200application/json

  • created_atintegerRequired

    At least 0.

  • updated_atintegerRequired

    At least 0.

  • idstringRequired
  • project_idstringRequired
  • table_idstringRequirednullable
  • actor_typestringRequired
    Allowed values
    userapi_key
  • actor_idstringRequired
  • schema_jsonobjectRequired
  • insert_modestringRequirednullable
    Allowed values
    appenddedupmergereplace
  • statusstringRequired
    Allowed values
    uploadingprocessingmergingcompletepartialfailed
  • file_countintegerRequired
  • files_doneintegerRequired
  • current_filestringRequirednullable
  • csv_keystringRequirednullable
  • json_keystringRequirednullable
  • xlsx_keystringRequirednullable
  • total_rowsintegerRequirednullable
  • confidencenumberRequirednullable
  • duration_msintegerRequirednullable
  • errorstringRequirednullable
  • extractionsarray of objectsoptional

Errors

  • 404batch_not_foundnot_found
  • 500captcha_unavailableinternal_server_error
Errors every endpoint can return
Requestbash
curl 'https://api.anyrow.ai/v1/projects/{project_id}/batches/{batch_id}' \  -H 'Authorization: ApiKey {your_api_key}'
Responsejson
{  "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_idstringRequired
  • batch_idstringRequired

Returns

200text/csv

Errors

  • 400batch_not_completecaptcha_failedcaptcha_requiredinvalid_input
  • 404batch_not_foundbatch_result_emptynot_found
  • 500batch_download_failedcaptcha_unavailableinternal_server_error
Errors every endpoint can return
Requestbash
curl 'https://api.anyrow.ai/v1/projects/{project_id}/batches/{batch_id}/download/csv' \  -H 'Authorization: ApiKey {your_api_key}'
Responsetext
string

Download batch JSON

GET/v1/projects/{project_id}/batches/{batch_id}/download/json

Requirestables:read

Path parameters

  • project_idstringRequired
  • batch_idstringRequired

Returns

200application/json

  • batchIdstringRequired
  • rowsarray of objectsRequired
  • totalRowsintegerRequired

    At least 0.

Errors

  • 400batch_not_completecaptcha_failedcaptcha_requiredinvalid_input
  • 404batch_not_foundbatch_result_emptynot_found
  • 500batch_download_failedcaptcha_unavailableinternal_server_error
Errors every endpoint can return
Requestbash
curl 'https://api.anyrow.ai/v1/projects/{project_id}/batches/{batch_id}/download/json' \  -H 'Authorization: ApiKey {your_api_key}'
Responsejson
{  "batchId": "string",  "rows": [    {}  ],  "totalRows": 0}

Download batch XLSX

GET/v1/projects/{project_id}/batches/{batch_id}/download/xlsx

Requirestables:read

Path parameters

  • project_idstringRequired
  • batch_idstringRequired

Returns

200application/octet-stream

Errors

  • 400batch_not_completecaptcha_failedcaptcha_requiredinvalid_input
  • 404batch_not_foundbatch_result_emptynot_found
  • 500batch_download_failedcaptcha_unavailableinternal_server_error
Errors every endpoint can return
Requestbash
curl 'https://api.anyrow.ai/v1/projects/{project_id}/batches/{batch_id}/download/xlsx' \  -H 'Authorization: ApiKey {your_api_key}'
Responsejson
{  "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"  }}