---
title: Update an existing pet.
slug: montsetesting/update-an-existing-pet
createdAt: 2026-10-06T04:09:55.211Z
---

{
  "id": "MKBEieWIA5bQUdweIkoVw",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "/api/v3/pet",
    "servers": [
      {
        "url": "/api/v3/pet"
      }
    ],
    "name": "Update an existing pet.",
    "description": "Update an existing pet by Id.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "application/xml"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Update an existent pet in the store",
          "customType": "Pet",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "integer<int64>",
              "description": "",
              "example": 10,
              "format": "int64"
            },
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "doggie"
            },
            {
              "name": "category",
              "kind": "optional",
              "type": "object",
              "description": "",
              "modelRef": "#/components/schemas/Category",
              "customType": "Category",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "integer<int64>",
                  "description": "",
                  "example": 1,
                  "format": "int64"
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "description": "",
                  "example": "Dogs"
                }
              ]
            },
            {
              "name": "photoUrls",
              "kind": "required",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "tags",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/Tag",
              "customType": "Tag[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "integer<int64>",
                  "description": "",
                  "format": "int64"
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                }
              ]
            },
            {
              "name": "status",
              "kind": "optional",
              "type": "string<available | pending | sold>",
              "description": "pet status in the store",
              "enum": [
                "available",
                "pending",
                "sold"
              ]
            }
          ],
          "modelRef": "#/components/schemas/Pet",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "petstore_auth",
          "name": "petstore_auth",
          "kind": "optional",
          "type": "oauth2",
          "oauth2Flows": {
            "implicit": {
              "authorizationUrl": "https://petstore3.swagger.io/oauth/authorize",
              "scopes": {
                "write:pets": "modify pets in your account",
                "read:pets": "read your pets"
              }
            }
          },
          "requiredScopes": [
            "write:pets",
            "read:pets"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Pet",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "",
                "example": 10,
                "format": "int64"
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "doggie"
              },
              {
                "name": "category",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/Category",
                "customType": "Category",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "",
                    "example": 1,
                    "format": "int64"
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "Dogs"
                  }
                ]
              },
              {
                "name": "photoUrls",
                "kind": "required",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "tags",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Tag",
                "customType": "Tag[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "",
                    "format": "int64"
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  }
                ]
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string<available | pending | sold>",
                "description": "pet status in the store",
                "enum": [
                  "available",
                  "pending",
                  "sold"
                ]
              }
            ],
            "modelRef": "#/components/schemas/Pet",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid ID supplied",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Pet not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "422",
        "description": "Validation exception",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Unexpected error",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url /api/v3/pet \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"name\": \"doggie\",\n     \"photoUrls\": []\n     }'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"name\": \"doggie\",\n   \"photoUrls\": []\n});\n\nvar requestOptions = {\n   method: 'PUT',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"/api/v3/pet\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/api/v3/pet\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Put.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"name\": \"doggie\",\n   \"photoUrls\": []\n})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/api/v3/pet\"\n\npayload = json.dumps({\n   \"name\": \"doggie\",\n   \"photoUrls\": []\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful operation\n{\n  \"id\": 10,\n  \"name\": \"doggie\",\n  \"category\": {\n    \"id\": 1,\n    \"name\": \"Dogs\"\n  },\n  \"photoUrls\": [\n    \"\"\n  ],\n  \"tags\": [\n    {\n      \"id\": \"\",\n      \"name\": \"\"\n    }\n  ],\n  \"status\": \"\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid ID supplied\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Pet not found\n"
        },
        {
          "id": "response-3-422",
          "language": "422",
          "code": "// Validation exception\n"
        },
        {
          "id": "response-4-default",
          "language": "default",
          "code": "// Unexpected error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}