Categories
Manage the species and breed categories used to classify pets.
Authorizations
AuthorizationstringRequired
Pass your API key as a Bearer token in the Authorization header.
Responses
200
An array of categories.
application/json
namestringRequiredExample:
The category name (e.g. Dog, Cat, Rabbit).
DogdescriptionstringOptionalExample:
A short description of the category.
Domestic dogs of all breeds.idinteger · int64RequiredExample:
Unique identifier assigned on creation.
1401
Missing or invalid API key.
application/json
get/categories
curl -L https://petstore.example.com/v1/categories \
-H 'Authorization: Bearer YOUR_API_KEY'
[
{
"id": 1,
"name": "Dog",
"description": "Domestic dogs of all breeds."
},
{
"id": 2,
"name": "Cat",
"description": "Domestic cats of all breeds."
}
]Authorizations
AuthorizationstringRequired
Pass your API key as a Bearer token in the Authorization header.
Body
namestringRequiredExample:
The category name (e.g. Dog, Cat, Rabbit).
DogdescriptionstringOptionalExample:
A short description of the category.
Domestic dogs of all breeds.Responses
201
Category created successfully.
application/json
namestringRequiredExample:
The category name (e.g. Dog, Cat, Rabbit).
DogdescriptionstringOptionalExample:
A short description of the category.
Domestic dogs of all breeds.idinteger · int64RequiredExample:
Unique identifier assigned on creation.
1400
The request body is missing required fields or contains invalid values.
application/json
401
Missing or invalid API key.
application/json
post/categories
curl -L -X POST https://petstore.example.com/v1/categories \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"name": "Rabbit", "description": "Domestic rabbits of all breeds."}'
{
"name": "Dog",
"description": "Domestic dogs of all breeds.",
"id": 1
}Last updated