Categories
Manage the species and breed categories used to classify pets.
Returns all categories available for classifying pets (e.g. dog, cat, rabbit).
Pass your API key as a Bearer token in the Authorization header.
An array of categories.
The category name (e.g. Dog, Cat, Rabbit).
DogA short description of the category.
Domestic dogs of all breeds.Unique identifier assigned on creation.
1Missing or invalid API key.
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."
}
]Adds a new category for classifying pets.
Pass your API key as a Bearer token in the Authorization header.
The category name (e.g. Dog, Cat, Rabbit).
DogA short description of the category.
Domestic dogs of all breeds.Category created successfully.
The category name (e.g. Dog, Cat, Rabbit).
DogA short description of the category.
Domestic dogs of all breeds.Unique identifier assigned on creation.
1The request body is missing required fields or contains invalid values.
Missing or invalid API key.
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