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

Update a pet with form data

Updates a pet's name and status using query parameters. Supply petId in the path; optionally provide name and status as query parameters to change those fields. Returns the updated pet object.

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

3 parameters
petIdintegerrequired
The unique identifier of the pet to update.
namestringoptional
The new name for the pet. Omit to leave the name unchanged.
statusstringoptional
The new status for the pet: available, pending, or sold. Omit to leave the status unchanged.

3 status codes
200Returns the updated pet object with the new name and status applied.
idintegeroptional
namestringrequired
categoryobjectoptional
photoUrlsarray<string>required
tagsarray<object>optional
statusstringoptional
pet status in the store
Allowed:availablependingsold
400Returned when `petId` is not a valid integer or `status` is not one of the accepted values.
defaultUnexpected error

Error handling

petId must be a valid integer — non-numeric values return a 400. status, if supplied, must be one of available, pending, or sold; other values are rejected with a 400.