---
id: DeleteBook
name: Delete book
version: 1.0.0
badges:
  - content: Catalog Management
    backgroundColor: green
    textColor: green
summary: Deletes an existing book from the Catalog.
owners:
  - catalog-experience-team
schemaPath: schema.json
operation:
  method: DELETE
  path: /api/v1/books/{id}
  statusCodes: ["204", "404"]
sidebar:
  badge: "DELETE"
---

`DeleteBook` soft-deletes an existing book listing in [[service|catalog-api]] (`DELETE /catalog/api/v1/books/{id}`) and returns `204 No Content`. It does not permanently erase the database row or delete the book's cover image from blob storage.

## Overview

| Property                           | Value                                                                                                                                              |
| :--------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Bounded Context**                | Catalog                                                                                                                                            |
| **Owner Service**                  | [[service\|catalog-api]]                                                                                                                           |
| **Protocol / Format**              | HTTP `DELETE`, path parameter only, empty response (`204 No Content`)                                                                              |
| **Gateway Endpoint**               | `DELETE /catalog/api/v1/books/{id}` (service path `/api/v1/books/{id}`)                                                                            |
| **Authentication & Authorization** | Microsoft Entra ID JWT — `business_user` policy (role `business_user` or `admin` and scopes `catalog_read`, `catalog_write`)                       |
| **Idempotency / Concurrency**      | Not idempotent across retries; repeating a completed delete returns `404 Not Found`; no `x-request-id` header is enforced                          |
| **Rate Limit / Caching**           | Global concurrency (`100`) and fixed-window (`30 req/min`) limiters plus per-user token bucket; invalidates book, summary, list, and search caches |
| **Contract Version**               | `1.0.0` (`ApiVersions.V1`)                                                                                                                         |

## Request & Response Contract

### Path Parameters

| Name | Type              | Required | Constraints | Description                                  |
| :--- | :---------------- | :------- | :---------- | :------------------------------------------- |
| `id` | `string` (`uuid`) | Yes      | Valid UUID  | Unique identifier of the book to soft-delete |

## Behavior & Side Effects

- **Soft delete:** Marks the [[entity|book]] as deleted (`is_deleted = true`), hiding it from standard catalog reads and subsequent `DELETE` calls.
- **Cover image retention:** Any cover image stored in `catalog-blob` remains in blob storage after a book is soft-deleted.
- **Cache invalidation:** Clears cached book details (`book:{id}`), book summary (`book:summary:{id}`), and invalidates `books:list` and `books:search` cache tags.
- **Vector index queueing:** Database triggers enqueue the book ID for asynchronous Qdrant vector index reconciliation by [[service|catalog-ingestion]].

## Error Responses

| Status / Code               | Condition                                                                                       | Client Recovery Action                                                    |
| :-------------------------- | :---------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------ |
| `400 Bad Request`           | `{id}` is not a valid UUID                                                                      | Fix the path parameter; do not retry unchanged                            |
| `401 Unauthorized`          | Missing, expired, or invalid Entra ID JWT                                                       | Acquire a valid Entra ID access token and retry                           |
| `403 Forbidden`             | Token lacks role `business_user` or `admin`, or lacks scopes `catalog_read` and `catalog_write` | Request the required Entra ID app role and scopes                         |
| `404 Not Found`             | No active book exists with the supplied `{id}`                                                  | Verify the UUID; treat as already deleted only if your workflow allows it |
| `429 Too Many Requests`     | Rate limit quota exceeded (`Retry-After` header included)                                       | Wait for the `Retry-After` interval before retrying                       |
| `500 Internal Server Error` | Unhandled server or database failure (`traceId` included)                                       | Inspect service logs using `traceId`                                      |

## Related Documentation

- [[service|catalog-api]] — Service overview, routing, and authorization policies.
- [[entity|book]] — Book entity model.
- [[command|CreateBook]] — Create a new book listing.
- [[command|UpdateBook]] — Replace book details and manage cover images.

<NodeGraph />

<SchemaViewer file="schema.json" title="Delete book schema" maxHeight="500" search="true" />


 ## Raw Schema:schema.json

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"title": "DeleteBook",
	"description": "Path identifier for the book to delete.",
	"type": "string",
	"format": "uuid"
}
