Pets
Update a pet
Update an existing pet from a complete Pet payload.
Updates an existing pet by the ID carried in its Pet body. This example uses JSON; the contract also accepts XML and form-encoded bodies.
Update an existing pet by ID.
PUT
/petOAuth 2.0 bearer token with `write:pets` and `read:pets` scopes.
ID of the pet to update.
Pet name.
Optional `Category` object.
Photo URLs.
Optional array of `Tag` objects.
One of `available`, `pending`, or `sold`.
Response
{200}Successful operation
{400}Invalid ID supplied
{404}Pet not found
{422}Validation exception
cURL
curl --request PUT \
--url https://petstore3.swagger.io/api/v3/pet \
--header 'Authorization: Bearer example_access_token' \
--header 'Content-Type: application/json' \
--data '{
"id": 10,
"name": "doggie",
"category": {
"id": 1,
"name": "Dogs"
},
"photoUrls": [
"https://example.com/images/doggie.jpg"
],
"tags": [
{
"id": 1,
"name": "friendly"
}
],
"status": "pending"
}'{
"id": 10,
"name": "doggie",
"category": { "id": 1, "name": "Dogs" },
"photoUrls": ["https://example.com/images/doggie.jpg"],
"tags": [{ "id": 1, "name": "friendly" }],
"status": "pending"
}The contract also defines a default Unexpected error response without a fixed status or body schema.