My API
PUT/pet

Update an existing pet

Updates an existing pet by replacing all its fields. Supply name and photoUrls — these are required on every request as this is a full replacement. status must be one of available, pending, or sold if provided. Returns the updated pet object.

6 body fields

Pet object to replace. name and photoUrls are required.

idintegeroptional
The unique identifier of the pet to update.
namestringrequired
The name of the pet.
categoryobjectoptional
A category object containing an id and name for the pet's category.
photoUrlsarray<string>required
An array of URLs pointing to images of the pet. At least one URL is
tagsarray<object>optional
An array of tag objects, each with an id and name, for categorising the pet.
statusstringoptional
pet status in the store
Allowed:availablependingsold

5 status codes
200Returns the updated pet object with all current field values.
idintegeroptional
namestringrequired
categoryobjectoptional
photoUrlsarray<string>required
tagsarray<object>optional
statusstringoptional
pet status in the store
Allowed:availablependingsold
400Returned when a required field is missing or the request body is malformed.
404Returned when no pet exists with the given `id`.
422Returned when the request body fails validation, such as an invalid enum value for status.
defaultUnexpected error

Error handling

A 404 is returned if no pet exists with the given id. Omitting name or photoUrls returns a 400. A 422 is returned when the request body fails validation — ensure all required fields are present and properly formatted.