---
title: "Clear every saved artifact from the current principal's library."
method: DELETE
path: "/api/library"
tags: ["Library"]
---

# Clear every saved artifact from the current principal's library.

`DELETE /api/library`

## Request

- Base URL: `https://huggingbay.xyz`
- URL: `https://huggingbay.xyz/api/library`
- Auth: HTTP bearer

Bulk clear endpoint for account UIs and agent clients. It only removes rows scoped to the authenticated bearer token principal.

**Inputs.** No path or query fields are required. No request body is required.

**Outputs.** See each status below for its media type, schema and headers. A missing record or unavailable capability is not a successful empty result.

**Errors.** API JSON failures use the documented response schema. Read code, message and next; retry only when the response allows it. Auth, invalid input and missing records need a caller change.

**Rate limits.** Write and protocol operations can have separate route-specific limits. Read Retry-After and retry_after_s when present; do not infer a write allowance from the public read budget.

**Example setup.** Set HUGGING_BAY_TOKEN to a credential with the role or scope stated by this operation. Reader tokens do not grant publisher or operator rights. This example is not executed by documentation checks. Review the operation and obtain any required user consent before sending it.

## Response `200`

Library clear result

- AccountClearResponse
  - `schemaVersion` 'hugging-bay.library-clear.v1' | 'hugging-bay.saved-searches-clear.v1', required
  - `cleared` number, required: Number of rows removed for the authenticated principal.
  - `remaining` number, required: Rows still scoped to the authenticated principal after the clear.

## Other responses

- `403`: Reader, publisher, or admin token required

---

[API](https://skmtc.dev/huggingbay/apis/hugging-bay-public-api.md) · [All operations](https://skmtc.dev/huggingbay/apis/hugging-bay-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/huggingbay/apis/hugging-bay-public-api/revisions/865eb0f1b6ef?raw)
