---
title: Get batch
url: https://anyrow.ai/docs/api/batches/retrieve
canonical_url: https://anyrow.ai/docs/api/batches/retrieve
---

# Get batch

`GET /v1/projects/{project_id}/batches/{batch_id}`

Authentication: `Authorization: ApiKey {your_api_key}`.

Requires `tables:read`.

## Path parameters

- `project_id` (string, required)
- `batch_id` (string, required)

## Returns

200 `application/json`.

- `created_at` (integer, required): At least 0.
- `updated_at` (integer, required): At least 0.
- `id` (string, required)
- `project_id` (string, required)
- `table_id` (string, required, nullable)
- `actor_type` (string, required): One of `user`, `api_key`.
- `actor_id` (string, required)
- `schema_json` (object, required)
  - `columns` (array of objects, required): 1 to 50 items.
    - `description` (string, optional, nullable): Up to 256 characters.
    - `instruction` (string, optional, nullable): Up to 512 characters.
    - `name` (string, required): 1 to 64 characters. Matches `^[\w\s.-]+$`.
    - `type` (string, required): One of `array`, `boolean`, `currency`, `date`, `email`, `enum`, `multi_select`, `number`, `string`, `text`, `url`. Defaults to `string`.
  - `instruction` (string, optional, nullable): Up to 512 characters.
  - `strictness` (string, required): One of `strict`, `balanced`, `flexible`. Defaults to `strict`.
- `insert_mode` (string, required, nullable): One of `append`, `dedup`, `merge`, `replace`.
- `status` (string, required): One of `uploading`, `processing`, `merging`, `complete`, `partial`, `failed`.
- `file_count` (integer, required)
- `files_done` (integer, required)
- `current_file` (string, required, nullable)
- `csv_key` (string, required, nullable)
- `json_key` (string, required, nullable)
- `xlsx_key` (string, required, nullable)
- `total_rows` (integer, required, nullable)
- `confidence` (number, required, nullable)
- `duration_ms` (integer, required, nullable)
- `error` (string, required, nullable)
- `extractions` (array of objects, optional)
  - `created_at` (integer, required): At least 0.
  - `id` (string, required)
  - `batch_id` (string, required)
  - `table_id` (string, required, nullable)
  - `file_key` (string, required)
  - `file_name` (string, required)
  - `file_type` (string, required, nullable): One of `text_pdf`, `scanned`, `image`, `text`, `document`, `unknown`.
  - `file_checksum` (string, required, nullable)
  - `status` (string, required): One of `pending`, `processing`, `complete`, `failed`.
  - `rows_key` (string, required, nullable)
  - `row_count` (integer, required, nullable)
  - `confidence` (number, required, nullable)
  - `error` (string, required, nullable)

## Errors

- 404: `batch_not_found`, `not_found`
- 500: `captcha_unavailable`, `internal_server_error`

Errors every endpoint can return: [Errors](https://anyrow.ai/docs/api/errors.md).

## Request

```bash title="cURL"
curl 'https://api.anyrow.ai/v1/projects/{project_id}/batches/{batch_id}' \
  -H 'Authorization: ApiKey {your_api_key}'
```

```ts title="TypeScript"
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.retrieve({
  params: {
    project_id: "{project_id}",
    batch_id: "{batch_id}"
  },
})
```

```python title="Python"
import os

from anyrow import SDK, ClientConfig

anyrow = SDK(ClientConfig(
    base_url="https://api.anyrow.ai",
    bearer_token=os.environ["ANYROW_API_KEY"],
    auth_header_prefix="ApiKey ",
))

result = anyrow.batch.retrieve("{project_id}", "{batch_id}")
```

```go title="Go"
package main

import (
	"context"
	"fmt"
	"os"

	sdk "github.com/anyrow/sdk-go"
)

func main() {
	anyrow := sdk.NewClient(sdk.Config{
		BaseURL:     "https://api.anyrow.ai",
		BearerToken: os.Getenv("ANYROW_API_KEY"),
	})
	ctx := context.Background()

	result, err := anyrow.Batch.Retrieve(ctx, "{project_id}", "{batch_id}", nil)
	if err != nil {
		panic(err)
	}
	fmt.Println(result)
}
```

```rust title="Rust"
use anyrow::{Client, ClientConfig};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let anyrow = Client::new(ClientConfig {
        base_url: "https://api.anyrow.ai".to_string(),
        bearer_token: std::env::var("ANYROW_API_KEY").ok(),
        ..Default::default()
    });

    let result = anyrow.batch().retrieve("{project_id}", "{batch_id}", &Default::default()).await?;
    println!("{result:?}");
    Ok(())
}
```

```csharp title="C#"
using Anyrow;

var anyrow = new AnyrowClient(new ClientConfig
{
    BaseUrl = "https://api.anyrow.ai",
    ApiKey = Environment.GetEnvironmentVariable("ANYROW_API_KEY"),
});

var result = await anyrow.Batch.RetrieveAsync("{project_id}", "{batch_id}");
Console.WriteLine(result);
```

```java title="Java"
import ai.anyrow.AnyrowClient;

public class Example {
    public static void main(String[] args) throws Exception {
        AnyrowClient anyrow = AnyrowClient.builder()
            .baseUrl("https://api.anyrow.ai")
            .apiKey(System.getenv("ANYROW_API_KEY"))
            .build();

        var result = anyrow.batch().retrieve("{project_id}", "{batch_id}");
        System.out.println(result);
    }
}
```

## Response

```json title="200"
{
  "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"
    }
  ]
}
```

```json title="404"
{
  "error_key": "batch_not_found",
  "fields": {
    "key": [
      {
        "error_key": "string",
        "message": "string",
        "path": "string"
      }
    ]
  },
  "message": "string",
  "status": 404,
  "status_key": "string",
  "success": false,
  "vars": {
    "key": "string"
  }
}
```

```json title="500"
{
  "error_key": "captcha_unavailable",
  "fields": {
    "key": [
      {
        "error_key": "string",
        "message": "string",
        "path": "string"
      }
    ]
  },
  "message": "string",
  "status": 500,
  "status_key": "string",
  "success": false,
  "vars": {
    "key": "string"
  }
}
```
