> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.athenaintel.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.athenaintel.com/_mcp/server.

# Get Batch Execution Status

GET https://api.athenaintel.com/api/v0/aop/batches/{batch_id}

Aggregate lifecycle status of every run launched under a batch handle from `POST /aop/execute-batch`: counts per canonical run status, an `is_complete` flag, and a cursor-paged list of runs. Poll this once per batch instead of `GET /threads/{thread_id}/status` per thread; fetch a run's messages from the thread status endpoint only once it is terminal. This read never loads transcripts.

Reference: https://docs.athenaintel.com/api-reference/aop/get-batch-status

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Path parameters

- `batch_id` (string, required) — Batch handle returned by execute-batch

### Query parameters

- `status` (string, optional, default: terminal) — Which runs to list: `terminal` (completed/failed/canceled), `active` (everything else) or `all`. Counts always cover the whole batch.
- `cursor` (string, optional, nullable) — `next_cursor` from the previous page
- `limit` (integer, optional, default: 200) — Maximum runs to return in this page

## Response

### 200

Batch status

- `batch_id` (string, required) — The batch handle that was checked
- `counts` (AOPBatchStatusCountsOut, required) — Runs per canonical status
- `is_complete` (boolean, required) — True when every run in the batch has finished
- `runs` (list of AOPBatchRunStatusOut, required) — One page of runs matching the `status` filter, ordered by cursor
- `terminal` (integer, required) — Runs that have finished (completed + failed + canceled)
- `total` (integer, required) — Runs launched into the batch so far
- `next_cursor` (string, optional, nullable) — Opaque cursor for the next page of `runs`; null when this page is the last one. Pass it as `cursor` on the next call.

## Errors

### 400 Bad Request Error

Invalid status filter or cursor

- `map from string to any`

### 401 Unauthorized Error

Unauthorized

- `message` (string, required)

### 404 Not Found Error

The batch id is not one of the caller's batches

- `map from string to any`

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### AOPBatchStatusCountsOut

Run counts of a batch by canonical run status.

- `canceled` (integer, optional, default: 0)
- `completed` (integer, optional, default: 0)
- `failed` (integer, optional, default: 0)
- `needs_input` (integer, optional, default: 0)
- `queued` (integer, optional, default: 0)
- `running` (integer, optional, default: 0)
- `scheduled` (integer, optional, default: 0)

### AOPBatchRunStatusOut

Lifecycle status of one run in a batch (no messages).

- `is_terminal` (boolean, required) — True once the run is completed, failed or canceled
- `status` (string, required) — Canonical run status: scheduled, queued, running, needs_input, completed, failed or canceled
- `thread_id` (string, required) — Thread ID; use `GET /threads/{thread_id}/status` for the result
- `aop_asset_id` (string, optional, nullable) — ID of the AOP asset the run executes
- `client_ref` (string, optional, nullable) — Caller-supplied correlation key from the launch request
- `completed_at` (string, optional, nullable) — ISO timestamp when the run reached a terminal state
- `created_at` (datetime, optional, nullable) — When the run was queued
- `error` (string, optional, nullable) — Error message when the run failed

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "batch_id": "batch_1f3c1b9e-7f7d-4c2c-9d5e-2b1f0a9c8d7e",
  "counts": {
    "canceled": 1,
    "completed": 240,
    "failed": 7,
    "needs_input": 0,
    "queued": 0,
    "running": 2,
    "scheduled": 0
  },
  "is_complete": false,
  "runs": [
    {
      "is_terminal": true,
      "status": "completed",
      "thread_id": "thread_12345-6789-abcd-efgh",
      "aop_asset_id": "asset_9249292-d118-42d3-95b4-00eccfe0754f",
      "client_ref": "row-1",
      "completed_at": "2024-01-15T10:45:00+00:00",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "terminal": 248,
  "total": 250,
  "next_cursor": "asset_thread_12345-6789-abcd-efgh"
}
```

**SDK Code**

```python
import requests

url = "https://api.athenaintel.com/api/v0/aop/batches/batch_id"

headers = {"X-API-KEY": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.athenaintel.com/api/v0/aop/batches/batch_id';
const options = {method: 'GET', headers: {'X-API-KEY': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.athenaintel.com/api/v0/aop/batches/batch_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-KEY", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.athenaintel.com/api/v0/aop/batches/batch_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.athenaintel.com/api/v0/aop/batches/batch_id")
  .header("X-API-KEY", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.athenaintel.com/api/v0/aop/batches/batch_id', [
  'headers' => [
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.athenaintel.com/api/v0/aop/batches/batch_id");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-KEY", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-KEY": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.athenaintel.com/api/v0/aop/batches/batch_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```