Skip to content

Delete Pet

The Delete Pet endpoint is used to remove an existing pet record from the Petstore system.

This operation deletes the pet associated with the specified pet ID. Once deleted, the resource may no longer be available for retrieval or update operations.

Endpoint

DELETE /pet/{petId}

Base URL

https://petstore.swagger.io/v2/pet/{petId}

Path Parameters

Parameter Type Required Description
petId integer Yes Unique identifier of the pet to be deleted

Request Headers

Header Required Description
api_key No API key used for authorized requests

Sample Request

curl -X DELETE "https://petstore.swagger.io/v2/pet/101" \
-H "api_key: special-key"
import requests

url = "https://petstore.swagger.io/v2/pet/101"

headers = {
    "api_key": "special-key"
}

response = requests.delete(url, headers=headers)

print(response.status_code)
print(response.text)
fetch("https://petstore.swagger.io/v2/pet/101", {
  method: "DELETE",
  headers: {
    "api_key": "special-key"
  }
})
.then(response => response.json())
.then(data => console.log(data));

Successful Response

{
  "code": 200,
  "type": "unknown",
  "message": "101"
}
<ApiResponse>
  <code>200</code>
  <type>unknown</type>
  <message>101</message>
</ApiResponse>

Response Codes

Status Code Description
200 Pet deleted successfully
400 Invalid pet ID supplied
404 Pet not found

Error Response Example

{
  "code": 404,
  "type": "error",
  "message": "Pet not found"
}

Notes

  • The petId parameter must reference an existing pet record.
  • Deleting a non-existing pet may return a 404 response.
  • Some environments may require API key authentication before performing delete operations.
  • Deleted records may not be recoverable depending on the system implementation.