View Categories

Update an existing pet.

< 1 min read

PUT/pet

Code Samples #

  • 💻 cURL
  • 📄 JavaScript
  • 🐍 Python
  • 🐘 PHP
  • 🔷 C#
  • Java
Copy
curl --request PUT \
  --url '/api/v3/pet' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "id": 10,
    "name": "doggie",
    "category": {
        "id": 1,
        "name": "Dogs"
    },
    "photoUrls": [
        "string"
    ],
    "tags": [
        {
            "id": 1,
            "name": "string"
        }
    ],
    "status": "available"
}'

Update an existing pet by Id.

Request Body #

Content type: application/jsonrequired

FieldTypeRequiredDescription
idinteger (int64)Optional
namestringRequired
categoryobjectOptional
category.idinteger (int64)Optional
category.namestringOptional
photoUrlsarray of stringRequired
tagsarray of objectOptional
statusstringOptionalpet status in the store Allowed: available, pending, sold
📋
Example request
Copy
{
    "id": 10,
    "name": "doggie",
    "category": {
        "id": 1,
        "name": "Dogs"
    },
    "photoUrls": [
        "string"
    ],
    "tags": [
        {
            "id": 1,
            "name": "string"
        }
    ],
    "status": "available"
}

Responses #

200 — Successful operation #

FieldTypeRequiredDescription
idinteger (int64)Optional
namestringRequired
categoryobjectOptional
category.idinteger (int64)Optional
category.namestringOptional
photoUrlsarray of stringRequired
tagsarray of objectOptional
statusstringOptionalpet status in the store Allowed: available, pending, sold
📋
Example 200 response
Copy
{
    "id": 10,
    "name": "doggie",
    "category": {
        "id": 1,
        "name": "Dogs"
    },
    "photoUrls": [
        "string"
    ],
    "tags": [
        {
            "id": 1,
            "name": "string"
        }
    ],
    "status": "available"
}

400 — Invalid ID supplied #

404 — Pet not found #

422 — Validation exception #

default — Unexpected error #

Response #

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

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.