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

Update a pet with form data

Updates a pet record using form-style query values. Use petId to select the pet and provide name or status when you want to change those values. The response contains the updated pet representation.

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

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

3 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 update input is invalid.
defaultReturned when an unexpected error occurs.

Error handling

A 400 is returned when the supplied update input is invalid. petId must identify the pet to update, and status must contain a valid pet status value when supplied.