Swagger Petstore - OpenAPI 3.0
POST/pet/{petId}

Update a pet with form data

Updates selected details of a pet using form-style query parameters. Supply petId and provide name, status, or both to change the corresponding pet details. The response contains the updated pet record.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 parameters
petIdintegerrequired
The unique integer identifier of the pet to update.
namestringoptional
The replacement name for the pet.
statusstringoptional
The replacement store status for the pet.

3 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 pet identifier or supplied update input is invalid.
defaultUnexpected error

Error handling

The petId value must identify the pet to update. name and status are optional update values, and invalid input returns a 400.