---
title: "Delete a batch of objects with a given prefix"
method: POST
path: "/worker/objects/remove"
---

# Delete a batch of objects with a given prefix

`POST /worker/objects/remove`

Deletes all objects with the provided prefix from the local database. The objects are not removed from the network immediately. Instead, the autopilot prunes data from the network periodically.

## Request body

- object
  - `bucket` string — The name of the bucket the objects belong to
  - `prefix` string — The prefix of the objects to delete

## Response `200`

Successfully removed objects

## Other responses

- `400` — Missing prefix or bucket
- `404` — Object not found
- `500` — Internal server error

## Changes

- **2024-12-12** `be2f724d7cd4` — 1 breaking
  - removed the media type `text/plain` for the response with the status `200`
- **2024-12-12** `1a4b05c71ba9` — 1 breaking, 1 warning
  - added `#/components/schemas/BucketName` to the `bucket` request property `allOf` list
  - removed `#/components/schemas/Bucket` from the `bucket` request property `allOf` list
- **2024-12-09** `9bd8635d818c` — 2 breaking, 1 info
  - added `#/components/schemas/Bucket, subschema #2` to the `bucket` request property `allOf` list
  - the `bucket` request property type/format changed from `string`/`` to ``/``
  - removed the pattern `(?!(^xn--|.+-s3alias$))^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$` from the request property `bucket`
- **2024-12-09** `2700783521b0` — 1 info
  - endpoint added
- **2024-12-09** `f062c35d8f47` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/siafoundation/apis/renterd-api/changes/worker/objects/remove/post.md)

---

[API](https://skmtc.dev/siafoundation/apis/renterd-api.md) · [All operations](https://skmtc.dev/siafoundation/apis/renterd-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/siafoundation/renterd-api/revisions/593be511b682/schema)
