---
title: /pets/{id}
slug: import-test-pdf/petsid
createdAt: 2025-10-28T12:51:46.062Z
---

{
  "id": "suaDJgxr4dviALLzYrril",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "http://petstore.swagger.io/api/pets/{id}",
    "description": "deletes a single pet based on the ID supplied",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "integer",
          "description": "ID of pet to delete"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "pet",
          "type": "object",
          "description": "Pet to add to the store 22",
          "schema": [],
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "code",
                  "kind": "required",
                  "type": "integer<int32>",
                  "description": "",
                  "example": 0
                },
                {
                  "name": "message",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "example": ""
                }
              ],
              "modelRef": "#/definitions/ErrorModel",
              "customType": "ErrorModel"
            },
            {
              "name": "object",
              "schema": []
            }
          ],
          "complexType": "anyOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "pet deleted",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "unexpected error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "unexpected error",
            "customType": "ErrorModel",
            "schema": [
              {
                "name": "code",
                "kind": "required",
                "type": "integer<int32>",
                "description": "",
                "example": 0
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": ""
              }
            ],
            "modelRef": "#/definitions/ErrorModel",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url http://petstore.swagger.io/api/pets/{id} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"code\": 0,\n     \"message\": \"\"\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   \"code\": 0,\n   \"message\": \"\"\n});\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"http://petstore.swagger.io/api/pets/{id}\", 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(\"http://petstore.swagger.io/api/pets/{id}\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"code\": 0,\n   \"message\": \"\"\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 = \"http://petstore.swagger.io/api/pets/{id}\"\n\npayload = json.dumps({\n   \"code\": 0,\n   \"message\": \"\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-204",
          "language": "204",
          "code": "// pet deleted\n"
        },
        {
          "id": "response-1-default",
          "language": "default",
          "code": "// unexpected error\n{\n  \"code\": \"\",\n  \"message\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-204"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}