Swagger Petstore - OpenAPI 3.0
PUT/pet

Update an existing pet

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

6 body fields

Pet object with updated values. id, name, and photoUrls are required.

idintegeroptional
The pet's unique identifier. Must identify an existing pet.
namestringrequired
The pet's name.
categoryobjectoptional
A category object containing an `id` and `name` for classification.
photoUrlsarray<string>required
Array of URLs pointing to pet photos. Must contain at least one URL.
tagsarray<object>optional
Array of tag objects, each with an `id` and `name` for labeling.
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 `id`, `name`, or `photoUrls` is missing or malformed.
404Returned when no pet exists with the supplied `id`.
422Returned when the request body fails schema validation, such as an invalid `status` value or incorrect data type.
defaultUnexpected error

Error handling

A 404 is returned if no pet exists with the supplied id. Omitting name or photoUrls returns a 400. A 422 is returned when the request body fails validation — ensure photoUrls is a non-empty array and status, if supplied, is one of the accepted values.