> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/datasets/manage/manage-datasets/manage-batches.md).

# Dataset Batches

Batches are groups of images and labels that you can track across your annotation dashboard.

## About

Once you [upload your data](https://docs.roboflow.com/datasets/create-and-upload/adding-data.md) into Roboflow, that data you uploaded turns into a batch. Batches are a group of images that you can track throughout the dataset process in Roboflow.

You can view all batches on the Annotate page of your project.

<figure><img src="https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-604d87e6816990d465ab6573758a48cf50ba9282%2Fimage%20(346).png?alt=media" alt=""><figcaption><p>The view in the Annotate page. Note: The review column is not be available for Public users.</p></figcaption></figure>

Once images are uploaded, they are in the Unassigned column.

You can assign a batch for someone to annotate, sending it to the Annotating column. You can also assign a selection of images in a batch. In this case, any unassigned images are moved into a new batch in Unassigned.

Once images in a batch are annotated, they are sent to Review (for users with Review Mode available) or to the Dataset column.

If batches are in the Review column, some or all are either approved or rejected. Approved batches will go into the Dataset column. Rejected batches are sent back to the Annotating column

### Merging Batches

You can combine several batches into one from the Annotate page. This is useful when single-image approvals have split a correction set into many small batches.

Click the three dots next to a batch name and click "Merge Batches" to open the merge dialog. Search for and select two or more batches, then click the merge button. The selected batch with the most images survives and receives all the images from the others. The emptied batches disappear from the board.

Merging is only available on a batch that has at least one other compatible batch. Batches from different source videos cannot be merged together, and managed review queues cannot be merged.

### Moving Images Into a Batch

You can move images that are already in your Project into one batch, from whichever batches hold them. This is useful when an upload script re-uploads existing images: deduplication leaves them in their old batch, and you can regroup them into the batch they belong in afterwards.

Each request takes exactly one way to pick the images and exactly one target batch:

* Images: a list of image IDs (1 to 1,000, no repeats), or a tag, which picks every image in the Project that carries it.
* Target batch: a batch ID, which must be an existing batch in the Project, or a batch name of up to 200 characters, which picks the batch with that name and creates it when there is none.

There is no other way to pick images (ex: a search query, a source batch, or a file name), and a request with any other input is refused.

Only images in the Unassigned column move. Images in an annotation job, in the Dataset, or already in the target batch stay where they are and are counted as skipped, and so are IDs that match no image in the Project. One request moves at most 1,000 images. A tag carried by more than 1,000 images in the Project, or by more than 20,000 images in the Workspace, is refused before any image moves, so move those images by ID in smaller selections. A request that would move nothing (ex: every image is already in the target batch) is refused.

Videos move the same way. A batch holds either images or videos, so a request that would move images and videos together, or into a batch of the other kind, is refused. A batch name picks the batch with that name that holds the same kind.

The [HTTP API](#http-api), the [Python SDK](#python-sdk), and the [CLI](#cli) move images this way.

### Deleting a Batch

{% hint style="danger" %}
Deletions are permanent and irreversible. Roboflow cannot recover deleted batches.
{% endhint %}

You can only delete a batch in the Unassigned column. If the batch you want to delete is in the Annotating, Review or Dataset column, you will have to click `Move to unassigned` before clicking `Delete Job`.

You can delete batches by clicking on the three dots next to the batch name and clicking "Delete Batch".

<figure><img src="https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-01bd8772fefc8e63d3a62aa430aaa45b31471f53%2Fimage%20(347).png?alt=media" alt="" width="279"><figcaption></figcaption></figure>

## HTTP API

### List Batches

List the batches that your uploaded images are grouped into. Use a batch ID to [create an annotation job](https://docs.roboflow.com/datasets/annotate/annotate/team-collaboration.md#create-a-new-annotation-job) from the batch.

{% openapi src="/files/lmKngX1AN2k0ze4RztN9" path="/{workspace}/{project}/batches" method="get" %}
[image-batches.yaml](https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-57f5021e0dfd3492207752c2ec2e26f07ed88228%2Fimage-batches.yaml?alt=media)
{% endopenapi %}

### Get a Batch

{% openapi src="/files/lmKngX1AN2k0ze4RztN9" path="/{workspace}/{project}/batches/{batchId}" method="get" %}
[image-batches.yaml](https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-57f5021e0dfd3492207752c2ec2e26f07ed88228%2Fimage-batches.yaml?alt=media)
{% endopenapi %}

### Move Images Into a Batch

Moves images into a batch as described in [Moving Images Into a Batch](#moving-images-into-a-batch). A [scoped API key](https://docs.roboflow.com/reference/authentication/authentication/scoped-api-keys) needs the `batch:update` scope.

{% openapi src="/files/GnGbCmELArP87kntOm9x" path="/{workspace}/{project}/annotation-batches/move" method="post" %}
[move-images-to-batch.yaml](https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-1ed6d83e5459c090150f67cc772eae3493518ecb%2Fmove-images-to-batch.yaml?alt=media)
{% endopenapi %}

## Python SDK

`Project.move_images_to_batch` takes exactly one of `image_ids` or `tag`, and exactly one of `batch_name` or `batch_id`. It returns the same object as the HTTP API. This method requires `roboflow` version 1.7.4 or later.

```python
import roboflow

project = roboflow.Roboflow(api_key="YOUR_API_KEY").workspace().project("PROJECT_ID")
project.move_images_to_batch(batch_name="serial-0042", tag="serial-0042")
project.move_images_to_batch(batch_id="BATCH_ID", image_ids=["IMAGE_ID_1", "IMAGE_ID_2"])
```

## CLI

Use `roboflow annotation batch move` from the [Roboflow CLI](https://docs.roboflow.com/reference/platform/cli). Pick the images with `--image-id` (repeat it for each image) or `--tag`, and the target with `--batch-name` or `--batch-id`. Add `--json` for the HTTP API response object. The command requires `roboflow` version 1.7.4 or later.

```bash
roboflow annotation batch move -p PROJECT_ID --batch-name serial-0042 --tag serial-0042
roboflow annotation batch move -p PROJECT_ID --batch-id BATCH_ID --image-id IMAGE_ID_1 --image-id IMAGE_ID_2
```

## MCP Server

Connect your AI agent to the [MCP Server](https://docs.roboflow.com/agents/mcp-server) and it can reorganize batches with these tools:

<table data-search="false"><thead><tr><th width="290">Tool</th><th>Description</th></tr></thead><tbody><tr><td><code>annotation_batches_list</code></td><td>List upload batches in a project.</td></tr><tr><td><code>annotation_batches_get</code></td><td>Get details about one upload batch.</td></tr><tr><td><code>annotation_batches_create</code></td><td>Move selected images from one batch into a new batch.</td></tr><tr><td><code>annotation_batches_merge</code></td><td>Move all images from source batches into a target batch.</td></tr><tr><td><code>annotation_batches_delete</code></td><td>Delete a batch and move its images to unassigned.</td></tr></tbody></table>
