For the complete documentation index, see llms.txt. This page is also available as Markdown.

Animals

Browse and manage individual animals available for adoption.

List all animals

get
/pets

Returns a paginated list of all animals in the store. Use limit to control page size and status to filter by availability.

授权
Authorizationstring必填

Pass your API key as a Bearer token in the Authorization header.

查询参数
limitinteger · 最小值: 1 · 最大值: 100可选

Maximum number of animals to return. Defaults to 20, max 100.

Default: 20
statusstring · enum可选

Filter by availability status.

可能的值:
响应
200

A paginated list of animals.

application/json
namestring必填

The animal's name.

Example: Fluffy
categoryIdinteger · int64必填

The ID of the category this animal belongs to.

Example: 1
statusstring · enum可选可能的值:
idinteger · int64必填

Unique identifier assigned on creation.

Example: 1
get/pets
curl -L https://petstore.example.com/v1/pets \
  -H 'Authorization: Bearer YOUR_API_KEY'
[
  {
    "id": 1,
    "name": "Fluffy",
    "categoryId": 1,
    "status": "available"
  },
  {
    "id": 2,
    "name": "Whiskers",
    "categoryId": 2,
    "status": "pending"
  }
]

Add an animal

post
/pets

Adds a new animal to the store. The name and categoryId fields are required.

授权
Authorizationstring必填

Pass your API key as a Bearer token in the Authorization header.

请求体
namestring必填

The animal's name.

Example: Fluffy
categoryIdinteger · int64必填

The ID of the category this animal belongs to.

Example: 1
statusstring · enum可选可能的值:
响应
201

Animal added successfully.

application/json
namestring必填

The animal's name.

Example: Fluffy
categoryIdinteger · int64必填

The ID of the category this animal belongs to.

Example: 1
statusstring · enum可选可能的值:
idinteger · int64必填

Unique identifier assigned on creation.

Example: 1
post/pets
curl -L -X POST https://petstore.example.com/v1/pets \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Goldie", "categoryId": 3, "status": "available"}'
{
  "name": "Fluffy",
  "categoryId": 1,
  "status": "available",
  "id": 1
}
Deprecated

Get an animal

get
/pets/{petId}
此操作已弃用,将于 2030-12-05 停止使用。

Returns details for a single animal by ID.

授权
Authorizationstring必填

Pass your API key as a Bearer token in the Authorization header.

路径参数
petIdinteger · int64必填

The ID of the animal to retrieve.

响应
200

The requested animal.

application/json
namestring必填

The animal's name.

Example: Fluffy
categoryIdinteger · int64必填

The ID of the category this animal belongs to.

Example: 1
statusstring · enum可选可能的值:
idinteger · int64必填

Unique identifier assigned on creation.

Example: 1
get/pets/{petId}
curl -L https://petstore.example.com/v1/pets/1 \
  -H 'Authorization: Bearer YOUR_API_KEY'
{
  "name": "Fluffy",
  "categoryId": 1,
  "status": "available",
  "id": 1
}

最后更新于