---
title: "Move a library to trash"
method: POST
path: "/api/libraries/{library_id}/trash"
tags: ["libraries"]
---

# Move a library to trash

`POST /api/libraries/{library_id}/trash`

Moves the library and all its contents into the trash. The library becomes inaccessible by default and can be fully restored within 90 days by calling `restore_library`. After 90 days the library's assets are gradually purged in the background; until the library row itself is removed, restore still works but recovers only the assets not yet purged.

Idempotent — a second call on an already-trashed library no-ops. To trash individual assets without trashing the whole library, use `trash_assets` instead.

## Path parameters

- `library_id` string, required — Library ID (with `lib_` prefix) of the library to trash.

## Response `200`

Successful Response

- DeletionResponse — Empty acknowledgment returned when an operation succeeds.

## Other responses

- `401` — Missing, invalid, or expired credentials.
- `403` — The credentials are valid but not authorized for this operation — for example an API key whose action or library scope excludes it, or a credential type this operation does not accept.
- `404` — Not found
- `422` — Validation Error
- `429` — Rate limit exceeded. Retry after the interval in the `Retry-After` header.

## Changes

- **2026-08-08** `815e0302a988` — 1 breaking, 1 info
  - response property `detail` list-of-types was widened by adding types `string` to media type `application/json` of response `422`
  - the response property `detail` became required for the status `422`
- **2026-08-05** `c3e15c78f2da` — 4 info
  - added the media type `application/json` for the response with the status `404`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
  - added the non-success response with the status `429`
- **2026-05-18** `9af798cdc7db` — 1 breaking, 1 info
  - removed the success response with the status `204`
  - added the success response with the status `200`
- **2026-05-18** `fbb16c77784c` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/gumnut-ai/apis/gumnut-api/changes/api/libraries/:library_id/trash/post.md)

---

[API](https://skmtc.dev/gumnut-ai/apis/gumnut-api.md) · [All operations](https://skmtc.dev/gumnut-ai/apis/gumnut-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gumnut-ai/gumnut-api/revisions/2c3aca3a6e6d/schema)
