Swagger Petstore - OpenAPI 3.0
PUT/pet

Replace an existing pet

Replaces an existing pet record in the store. Include the pet identifier when available, along with name and photoUrls, and use status to set the pet's store state.

6 body fields

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

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

5 status codes
200Returns the updated pet object with its identifier, name, category, image 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 with the supplied identifier.
422Returned when the pet data fails schema validation.
defaultReturned when an unexpected error occurs.

Error handling

name and photoUrls are required, and status must be one of available, pending, or sold. An invalid pet identifier returns a 400, a missing pet returns a 404, and other validation failures return a 422.