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

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可选可能的值:
响应
post
/pets
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}

最后更新于