Skip to main content
PUT
/
api
/
v1
/
books
/
update
/
{id}
curl -X PUT "https://api.example.com/api/v1/books/update/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "gender": "Fantasy",
    "author": "J.R.R. Tolkien",
    "image": "https://example.com/covers/lotr-updated.jpg",
    "title": "The Lord of the Rings",
    "subtitle": "The Fellowship of the Ring - Special Edition",
    "publisher": "Houghton Mifflin",
    "year": "1954",
    "pages": 450,
    "isbn": "978-0-618-00222-1"
  }'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "gender": "Fantasy",
  "author": "J.R.R. Tolkien",
  "image": "https://example.com/covers/lotr-updated.jpg",
  "title": "The Lord of the Rings",
  "subtitle": "The Fellowship of the Ring - Special Edition",
  "publisher": "Houghton Mifflin",
  "year": "1954",
  "pages": 450,
  "isbn": "978-0-618-00222-1"
}

Authentication

This endpoint requires a valid JWT token in the Authorization header.
Authorization: Bearer <your_jwt_token>

Path Parameters

id
string
required
The unique identifier (UUID) of the book to update.

Request Body

gender
string
required
The genre or category of the book (e.g., “Fantasy”, “Science Fiction”, “Mystery”).
author
string
required
The author’s name.
image
string
required
URL or path to the book’s cover image.
title
string
required
The main title of the book.
subtitle
string
The subtitle of the book.
publisher
string
required
The name of the publisher.
year
string
required
The publication year of the book.
pages
integer
required
The number of pages in the book.
isbn
string
required
The International Standard Book Number (ISBN).

Response

id
string
Unique identifier of the updated book.
gender
string
The genre or category of the book.
author
string
The author’s name.
image
string
URL or path to the book’s cover image.
title
string
The main title of the book.
subtitle
string
The subtitle of the book.
publisher
string
The name of the publisher.
year
string
The publication year of the book.
pages
integer
The number of pages in the book.
isbn
string
The International Standard Book Number (ISBN).
curl -X PUT "https://api.example.com/api/v1/books/update/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "gender": "Fantasy",
    "author": "J.R.R. Tolkien",
    "image": "https://example.com/covers/lotr-updated.jpg",
    "title": "The Lord of the Rings",
    "subtitle": "The Fellowship of the Ring - Special Edition",
    "publisher": "Houghton Mifflin",
    "year": "1954",
    "pages": 450,
    "isbn": "978-0-618-00222-1"
  }'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "gender": "Fantasy",
  "author": "J.R.R. Tolkien",
  "image": "https://example.com/covers/lotr-updated.jpg",
  "title": "The Lord of the Rings",
  "subtitle": "The Fellowship of the Ring - Special Edition",
  "publisher": "Houghton Mifflin",
  "year": "1954",
  "pages": 450,
  "isbn": "978-0-618-00222-1"
}

Status Codes

200
OK
Book updated successfully.
400
Bad Request
Invalid request body or validation errors (e.g., missing required fields, invalid data).
401
Unauthorized
Missing or invalid JWT token.
403
Forbidden
Valid token but insufficient permissions to update books.
404
Not Found
Book with the specified ID does not exist.

Build docs developers (and LLMs) love