WritedocsWritedocs

Get a pet by ID

GET/pets/{petId}

Returns one pet, by the ID it was given when it was created.

Path Parameters

petIdstringrequired

The pet’s unique ID

Response

A pet

namestring
tagstring
idstring

Pet not found

errorstring
Request
curl -X GET "https://api.example.com/pets/<petId>" \
  -H "X-API-Key: <X-API-Key>"
Response
{
  "name": "Rex",
  "tag": "dog",
  "id": "abc123"
}