---
title: "Batch Delete Collections Api"
method: POST
path: "/api/kb/collections/batch-delete"
tags: ["kb"]
---

# Batch Delete Collections Api

`POST /api/kb/collections/batch-delete`

Delete multiple collections in one request.

For each name, runs the same pipeline as single delete (permissions, physical
trash, LanceDB, ``UploadedFile`` cleanup). Per-item failures are collected in
``failed``; they do not roll back earlier successful deletions in the batch.
LanceDB removal uses ``delete_collection`` with tenant-aware ``user_id`` and
``is_admin`` filtering. Returns ``deleted`` and ``failed`` name lists.

## Request body

- BatchDeleteCollectionsRequest — Request body for batch delete collections.
  - `collection_names` string[], required — List of collection names to delete

## Response `200`

Successful Response

- BatchDeleteCollectionsResponse — Response for batch delete collections.
  - `deleted` string[] — Collection names that were deleted successfully
  - `failed` BatchDeleteFailureItem[] — Collection names that failed to delete with reasons
    - `name` string, required — Collection name
    - `error` string, required — Error message

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/xorbitsai/apis/xagent.md) · [All operations](https://skmtc.net/xorbitsai/apis/xagent/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xorbitsai/xagent/revisions/33e4ba4936ad/schema)
