Petstore API Reference

Version: 1.0.0
Base URL: https://petstore.example.com

Endpoints

1. List All Pets

GET /pets

Lists all pets in the store.

Query Parameters

Name Type Required Description
limit integer No Maximum number of pets to return

Response (200 OK)

[
  {
    "id": "pet-001",
    "name": "Buddy",
    "tag": "dog"
  }
]

cURL Example

curl -X GET https://petstore.example.com/pets?limit=10

2. Create a Pet

POST /pets

Creates a new pet record.

Request Body (application/json)

Field Type Required Description
id string Yes Unique pet identifier
name string Yes Pet name
tag string No Optional tag/label

Response (201 Created)

{
  "id": "pet-001",
  "name": "Buddy",
  "tag": "dog"
}

cURL Example

curl -X POST https://petstore.example.com/pets \
  -H "Content-Type: application/json" \
  -d '{"id": "pet-001", "name": "Buddy", "tag": "dog"}'

3. Get Pet by ID

GET /pets/{petId}

Retrieves a specific pet by its ID.

Path Parameters

Name Type Required Description
petId string Yes The ID of the pet to retrieve

Response (200 OK)

{
  "id": "pet-001",
  "name": "Buddy",
  "tag": "dog"
}

cURL Example

curl -X GET https://petstore.example.com/pets/pet-001

Data Model: Pet

Field Type Required Description
id string Yes Unique identifier
name string Yes Pet name
tag string No Optional category tag