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

# Delete Items by ID

> Delete items by id within a namespace (up to 100 ids per request). Frees global quota.

## Overview

Delete one or more items by id within a namespace. Item ids are unique **per namespace**, not globally.

Missing ids are listed in `not_found_ids` without failing the request. Deleting items frees global item quota immediately.

## Path parameters

<ParamField path="namespace_name" type="string" required>
  Namespace to delete from.
</ParamField>

## Headers

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

## Body

<ParamField body="ids" type="array" required>
  Non-empty array of item id strings. Maximum **100** ids per request.
</ParamField>

<RequestExample>
  ```bash theme={null}
  curl -X POST "http://localhost:8080/namespaces/my-documents/items/delete" \
    -H "Content-Type: application/json" \
    -d '{
      "ids": ["doc-1", "doc-2"]
    }'
  ```
</RequestExample>

## Response fields

<ResponseField name="status" type="string">
  Request outcome. `"success"` when the delete request completed; `"failure"` on error.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable result or error description.
</ResponseField>

<ResponseField name="namespace_name" type="string">
  Namespace items were deleted from. Present on successful delete.
</ResponseField>

<ResponseField name="requested" type="number">
  Number of ids sent in the request. Present on successful delete.
</ResponseField>

<ResponseField name="deleted" type="number">
  Number of items actually removed. Present on successful delete.
</ResponseField>

<ResponseField name="not_found_ids" type="array">
  Ids that were not found in the namespace. Present on successful delete (may be empty).
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "status": "success",
    "message": "Delete by ids completed.",
    "namespace_name": "my-documents",
    "requested": 1,
    "deleted": 1,
    "not_found_ids": []
  }
  ```

  ```json 200 - Partial (some ids not found) theme={null}
  {
    "status": "success",
    "message": "Delete by ids completed.",
    "namespace_name": "my-documents",
    "requested": 2,
    "deleted": 1,
    "not_found_ids": ["doc-missing"]
  }
  ```

  ```json 200 - None found theme={null}
  {
    "status": "success",
    "message": "Delete by ids completed.",
    "namespace_name": "my-documents",
    "requested": 2,
    "deleted": 0,
    "not_found_ids": ["doc-missing", "another-missing"]
  }
  ```

  ```json 400 - Empty ids array theme={null}
  {
    "status": "failure",
    "message": "Bad Request: ids must be a non-empty array."
  }
  ```

  ```json 400 - Too many ids theme={null}
  {
    "status": "failure",
    "message": "Bad Request: at most 100 ids are allowed per delete request."
  }
  ```

  ```json 400 - Empty id string theme={null}
  {
    "status": "failure",
    "message": "Bad Request: each id must be a non-empty string."
  }
  ```

  ```json 404 - Namespace not found theme={null}
  {
    "status": "failure",
    "message": "Namespace 'my-documents' not found."
  }
  ```

  ```json 500 - Server Error theme={null}
  {
    "status": "failure",
    "message": "Internal Server Error deleting namespace documents."
  }
  ```
</ResponseExample>

## Important Notes

<Warning>
  * Works for both **text** and **vector** namespaces
  * Deleting items frees quota toward the global **100,000 item** limit
  * A **200** response with `deleted: 0` means none of the requested ids existed
</Warning>

## Related

* [Get items by ID](/on-prem/api-references/items/get)
* [CLI: moorcheh items-delete](/on-prem/cli/items/delete)
* [Python: documents.delete()](/on-prem/python-client/items/delete)
