Skip to content
On this page

Update an existing pet.

Update an existing pet by Id.

PUT/petUpdate an existing pet.
curl -X PUT 'https://petstore3.swagger.io/api/v3/pet' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}'
Example response · 200
{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}

#Authentication

petstore_authwrite:petsread:pets

#Request body required

Update an existent pet in the store

application/json application/xml application/x-www-form-urlencoded · Type: Pet

idinteger (int64)
namestringrequired
categoryCategory
photoUrlsarray of stringrequired
tagsarray of Tag
statusstring

pet status in the store

Allowed values: "available", "pending", "sold"

{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}

#Responses

Successful operation

application/json application/xml · Type: Pet

idinteger (int64)
namestringrequired
categoryCategory
photoUrlsarray of stringrequired
tagsarray of Tag
statusstring

pet status in the store

Allowed values: "available", "pending", "sold"

{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}