Categories API
Product categorization system for organizing products into logical groups.
List Categories
Get a paginated list of categories with optional search functionality.
GET https://responserift.dev/api/categories?limit=10&offset=0&q=tech
Query Parameters
limit
- Number of results (default: 100)offset
- Number of results to skip (default: 0)q
- Search in name and description fields (case-insensitive)
Response
{
"total": 8,
"limit": 10,
"offset": 0,
"results": [
{
"id": 1,
"name": "Tech Gadgets",
"description": "Electronic devices and smart technology"
},
{
"id": 2,
"name": "Home & Garden",
"description": "Products for home improvement and outdoor living"
}
]
}
Get Category
Retrieve a specific category by ID.
GET https://responserift.dev/api/categories/1
Create Category
Create a new product category. All fields are required.
POST https://responserift.dev/api/categories
Content-Type: application/json
{
"name": "Sports & Fitness",
"description": "Equipment and gear for sports and fitness activities"
}
Required fields: name, description
Validation: Both fields must be non-empty strings
Update Category
Update an existing category. Only provided fields will be updated.
PUT https://responserift.dev/api/categories/1
Content-Type: application/json
{ "description": "Updated description for tech gadgets" }
Delete Category
Remove a category from the system.
DELETE https://responserift.dev/api/categories/1
Category Structure
Fields
id
- Unique category identifiername
- Category name (e.g., "Tech Gadgets", "Home & Garden")description
- Detailed description of the category
Usage with Products
Categories are used to organize products and can be used as filters in product queries.
Filter Products by Category
GET https://responserift.dev/api/products?category=Tech%20Gadgets&limit=5
Note: Category names in product filters are case-insensitive and should match exactly.
Warning: All mutations are in-memory only and reset on server restart.