> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerodrift.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a Batch

> Permanently delete an ended or failed batch, its files and its record.

Permanently deletes a batch that has ended or failed: its input, results and report files, and its record. This can't be undone. Cancel a running batch first. Needs a full-access API key.

Files are deleted automatically 14 days after a batch ends (`files_deleted_at`). Use this to remove them sooner, or to remove the batch record too.

## Path Parameters

**batch\_id** `string` *required*

The batch to delete.

```bash cURL theme={null}
curl -X DELETE https://api.zerodrift.ai/api/v3/batches/BATCH_ID \
  -H "x-api-key: YOUR_API_KEY"
```

```json 200 OK theme={null}
{
  "api_version": "v3",
  "batch_id": "batch_e511e74dd1ea49ba8c5f4293a68427be",
  "deleted": true
}
```

## Errors

| Status | Code | Meaning |
| - | - | - |
| `404` | `batch_not_found` | No batch with this ID is yours. |
| `409` | `batch_not_deletable` | The batch is still running (cancel it first), or its results or report are still being built (retry shortly). |
| `500` | `batch_delete_failed` | Some files couldn't be removed. The batch is kept; retry the delete. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.