Swagger Petstore - OpenAPI 3.0
PUT/pet

Replace an existing pet

Replaces an existing pet record in the store. Supply the pet id, name, and photoUrls in the request, and use status to set its store state. The response contains the updated pet record.

6 body fields

Complete pet details used to replace an existing store record; name and photoUrls are required.

idintegeroptional
The unique integer identifier of the pet to replace.
namestringrequired
The pet's name.
categoryobjectoptional
The category object assigned to the pet, including its identifier and name.
photoUrlsarray<string>required
Array of URLs for images of the pet.
tagsarray<object>optional
Array of tag objects assigned to the pet, including each tag's identifier and name.
statusstringoptional
pet status in the store
Allowed:availablependingsold

5 status codes
200Returns the updated pet object with its identifier, name, category, photo URLs, tags, and store status.
idintegeroptional
namestringrequired
categoryobjectoptional
photoUrlsarray<string>required
tagsarray<object>optional
statusstringoptional
pet status in the store
Allowed:availablependingsold
400Returned when the supplied pet identifier is invalid.
404Returned when no pet exists for the supplied identifier.
422Returned when the pet data fails validation.
defaultUnexpected error

Error handling

Omitting name or photoUrls returns a 422. status must be one of: available, pending, or sold. An invalid id returns a 400, and a pet that cannot be found returns a 404.