PUT/pet

Update an existing pet

Replaces an existing pet record in the store. Supply name and photoUrls together with the pet data you want to store, and use status to set its store state. The response contains the updated pet representation.

6 body fields

Complete pet details for the replacement; name and photoUrls are required.

idintegeroptional

The numeric identifier of the pet to update.

namestringrequired

The pet's name.

categoryobjectoptional

The pet's category, including its numeric identifier and name.

photoUrlsarray<string>required

An array of URLs for images of the pet.

tagsarray<object>optional

An array of tags, each containing a numeric identifier and name.

statusstringoptional

pet status in the store

Allowed:availablependingsold

5 status codes
200Returns the updated pet object, including 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 pet identifier or submitted pet data is invalid.
404Returned when no pet exists with the supplied identifier.
422Returned when the pet fails validation.
defaultReturned when an unexpected error occurs.

Error handling

Omitting name or photoUrls returns a 400. The pet identifier must identify an existing pet, and invalid pet data returns a 422. status must be one of: available, pending, or sold.