---
title: "Get Optimize Batch"
method: GET
path: "/api/platform/v1/messages/optimize/batches/{id}"
tags: ["assets"]
---

# Get Optimize Batch

`GET /api/platform/v1/messages/optimize/batches/{id}`

## Request

- Base URL: `https://docs.amdahl.ai`
- URL: `https://docs.amdahl.ai/api/platform/v1/messages/optimize/batches/{id}`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Read one optimize batch you submitted: how many items are queued, running, done and failed, its place in the queue, an estimated time to finish, and a page of items, each with the same result a single optimize returns once it has run. Read when polling a batch_id; page with limit and cursor, and filter items by status to collect only the finished ones.

## Path parameters

- `id` string, uuid, required: The batch_id the batch submit returned.

## Query parameters

- `limit` integer: Items per page, up to 100.
- `cursor` string: The next_cursor of the previous page. Omit for the first page.
- `status` 'queued' | 'running' | 'done' | 'failed': Return only items in this state. Omit for every item, in submitted order.

## Response `200`

OK

- object
  - `data` object, required
    - `batch_id` string, required
    - `status` 'queued' | 'running' | 'completed', required
    - `created_at` string
    - `completed_at` string, nullable
    - `counts` object, required: total, queued, running, done, failed.
    - `queue_position` integer: An estimate: queued items, in any workspace, expected to start before this batch's next one. 0 when none of its items is waiting.
    - `eta` object, nullable: An estimate, null once nothing is left to run: seconds, estimate (always true), items_ahead, median_run_seconds, slots.
    - `webhook` object
    - `items` unknown[], required: index, item_id, status, and result: the single-optimize result, null until settled.
      - unknown
    - `next_cursor` string, nullable

## Other responses

- `400`: Invalid input - failed schema validation
- `401`: Authentication required
- `403`: Forbidden - missing scope or role
- `404`: Not found
- `500`: Internal server error

---

[API](https://skmtc.dev/amdahl/apis/amdahl-platform-api.md) · [All operations](https://skmtc.dev/amdahl/apis/amdahl-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/amdahl/apis/amdahl-platform-api/revisions/d4eee33e2472?raw)
