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

# Delete a book

> Permanently deletes a book from the BookHub marketplace.

Returns `204 No Content` on success, with an empty response body.

## Important notes

- Only `INACTIVE` books can be deleted
- This operation cannot be undone
- Active books must be deactivated before deletion




## OpenAPI

````yaml DELETE /books/{bookId}
openapi: 3.0.3
info:
  title: BookHub Publisher API
  description: >
    BookHub's Publisher API enables programmatic management of book inventory on
    the BookHub marketplace. 

    This API uses path-based versioning (v2) and requires authentication via
    JWTs.


    > The interactive "Try it" playground is backed by a mock server: requests
    return documented example responses and don't persist. Enter any value in
    the Authorization field to try a request; for write endpoints, fill the
    required fields shown.
  version: 2.0.1
  contact:
    name: BookHub API Support
    email: api-support@bookhub.com
    url: https://docs.bookhub.com
servers:
  - url: https://bookhub-mock.onrender.com
    description: >-
      Interactive mock — returns live example responses (no real data or
      persistence)
  - url: https://api.bookhub.com/api/v2
    description: Production server - Version 2
  - url: https://api.bookhub.com/api/v1
    description: Production server - Version 1 (legacy)
security:
  - BearerAuth: []
tags:
  - name: Books
    description: Operations for managing book catalog
paths:
  /books/{bookId}:
    description: Endpoint for retrieving or managing a specific book.
    delete:
      tags:
        - Books
      summary: Delete a book
      description: |
        Permanently deletes a book from the BookHub marketplace.

        Returns `204 No Content` on success, with an empty response body.

        ## Important notes

        - Only `INACTIVE` books can be deleted
        - This operation cannot be undone
        - Active books must be deactivated before deletion
      operationId: deleteBook
      parameters:
        - name: bookId
          in: path
          required: true
          description: Unique identifier of the book to delete
          schema:
            type: string
          example: 123e4567-e89b-41d4-a716-426614174000
        - $ref: '#/components/parameters/RequestId'
      responses:
        '204':
          description: Book deleted successfully. No content returned.
        '400':
          description: Bad request (e.g., book is not INACTIVE)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: error
                message: Cannot delete book
                errors:
                  - field: status
                    error: INVALID_STATUS_TRANSITION
                    description: 'Book must be INACTIVE to delete. Current status: ACTIVE'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '429':
          $ref: '#/components/responses/RateLimitError'
components:
  parameters:
    RequestId:
      name: X-Request-ID
      in: header
      description: Request tracking identifier
      required: false
      schema:
        type: string
  schemas:
    ErrorResponse:
      type: object
      description: >
        Error response returned when an API request fails.

        Note: `validation_context` and `provided_value` use snake_case rather
        than camelCase — 

        this is a known inconsistency that will be addressed in a future
        version.
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
          description: Status indicator
        message:
          type: string
          description: Human-readable error message
          example: Validation failed
        errors:
          type: array
          description: Detailed error information for each failed field
          items:
            type: object
            properties:
              field:
                type: string
                description: Field that caused the error
                example: isbn
              error:
                type: string
                description: Error type
                example: INVALID_FORMAT
              description:
                type: string
                description: Detailed error explanation
                example: ISBN must match the pattern for ISBN-10 or ISBN-13
              validation_context:
                type: object
                description: Additional context about the validation failure
                properties:
                  rule:
                    type: string
                    example: pattern_match
                  constraint:
                    type: object
                    example:
                      pattern: ^[0-9]{13}$
                  provided_value:
                    type: string
                    example: invalid-isbn
  responses:
    UnauthorizedError:
      description: Unauthorized access
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Authentication failed
            errors:
              - field: Authorization
                error: INVALID_TOKEN
                description: >-
                  The JWT is missing, malformed, or expired. Obtain a new token
                  and retry.
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Book not found
            errors:
              - field: bookId
                error: NOT_FOUND
                description: >-
                  No book exists with bookId
                  123e4567-e89b-41d4-a716-426614174000
    RateLimitError:
      description: |
        Rate limit exceeded. Retry after the window resets — see the
        `X-RateLimit-Reset` header for the Unix timestamp when the current
        window closes, and `X-RateLimit-Remaining` for requests left in it.
      headers:
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Maximum requests allowed per minute
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Requests remaining in current window
        X-RateLimit-Reset:
          schema:
            type: integer
            format: unix-timestamp
          description: Unix timestamp when rate limit resets
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: >-
              Rate limit exceeded. Retry after the window resets (see
              X-RateLimit-Reset header).
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT obtained from the authentication endpoint

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.