Update an existing pet
Update an existing pet by its ID.
PUT https://petstore3.swagger.io/api/v3/pet
Examples
- API Key
- OAuth 2.0
cURL
PUT "https://petstore3.swagger.io/api/v3/pet" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "api_key: <YOUR_API_KEY>" \
-d '{
"id": 210,
"name": "Krypto",
"status": "available"
}'
cURL
PUT "https://petstore3.swagger.io/api/v3/pet" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>" \
-d '{
"id": 210,
"name": "Krypto",
"status": "available"
}'
Responses
| Code | Description |
|---|---|
| 200 | Successful operation |
| 400 | Invalid input |
| 404 | Pet not found |
| 422 | Validation exception |
| default | Unexpected error |
Response example
200: Successful operation
Response
{
"id": 210,
"name": "Krypto",
"category": {
"id": 1,
"name": "Dogs"
},
"photoUrls": [
"string"
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"status": "available"
}
Parameters
Request body
| Name | Type | Description |
|---|---|---|
body | Pet object | Required. Pet object to update. |