Skip to main content
PUT
/
authors
/
{id}
Update Author
curl --request PUT \
  --url https://api.example.com/authors/{id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "age": 123
}
'
{
  "200": {},
  "401": {},
  "404": {},
  "id": 123,
  "name": "<string>",
  "age": 123
}
Performs a full update of an existing author. All fields must be provided.

Authentication

This endpoint requires HTTP Basic Authentication.

Path Parameters

id
long
required
The unique identifier of the author to update

Request Body

name
string
required
The name of the author
age
integer
The age of the author

Response

id
long
The unique identifier of the updated author
name
string
The name of the author
age
integer
The age of the author

Status Codes

200
OK
Author successfully updated
404
Not Found
Author with the specified ID does not exist
401
Unauthorized
Authentication credentials are missing or invalid

Example Request

curl -X PUT http://localhost:8080/authors/1 \
  -u username:password \
  -H "Content-Type: application/json" \
  -d '{
    "name": "J.K. Rowling",
    "age": 59
  }'

Example Response

{
  "id": 1,
  "name": "J.K. Rowling",
  "age": 59
}

Partial Updates

For partial updates where you only want to update specific fields, use the PATCH /authors/ endpoint instead.

Build docs developers (and LLMs) love