Update a pet
On this page
PATCH /pets/{petId}
Production: https://petstore.example.com/v1Sandbox: https://sandbox.petstore.example.com/v1Live demo on docvia.dev; accepts any token: /api/petstore/v1
Changes only the fields you send.
curl https://petstore.example.com/v1/pets/1042 \
--request PATCH \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "string",
"status": "available",
"tags": [
"string"
]
}' PATCH /api/petstore/v1/pets/1042
/api/petstore/v1
Kept in memory for this visit and used on every page of this API; never saved.
Path
Authorization
bearerAuth JWT bearer token in the Authorization header
A token from the dashboard's API keys page.
Path parameters
petId integer<int64> required
The pet's id.
>= 1
Request body
required
Body application/json
name string
min length 1max length 64
status string
One of available pending adopted archived
tags array<string>
unique items
Example
{
"name": "string",
"status": "available",
"tags": [
"string"
]
}Responses
The updated pet.
Response application/json
id integer<int64> required read-only
status string required
One of available pending adopted archived
createdAt string<date-time> required read-only
name string required
Display name.
min length 1max length 64
species string required
One of dog cat bird rabbit
birthDate string<date>
tags array<string>
microchip Microchip | null
Identification, when the pet has one.
Exactly one of
id string required
The 15-digit ISO 11784 number.
pattern ^[0-9]{15}$
vendor string
null
Example
{
"id": 1042,
"status": "available",
"createdAt": "2024-01-01T12:00:00Z",
"name": "Rex",
"species": "dog",
"birthDate": "2024-01-01",
"tags": [
"string"
],
"microchip": {
"id": "string",
"vendor": "string"
}
}No resource with that id.
Response application/json
code string required
message string required
Example
{
"code": "not_found",
"message": "No pet with id 1042."
}