Prerequisites
- Valid API key with category read permissions
Request
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | number | No | Maximum number of categories to return (default: 20, max: 100) |
offset | number | No | Number of categories to skip for pagination (default: 0) |
status | string | No | Filter by status: “active”, “inactive”, “all” (default: “active”) |
name | string | No | Filter by category name (partial match) |
sort | string | No | Sort order: “createdAt:desc”, “createdAt:asc”, “name:asc”, “name:desc” (default: “createdAt:desc”) |
Response
Response Fields
| Field | Type | Description |
|---|---|---|
data | array | Array of category objects |
pagination | object | Pagination information |
Category Object
| Field | Type | Description |
|---|---|---|
id | string | Unique category identifier |
name | string | Category name |
description | string | Category description |
status | string | Category status |
metadata | object | Additional metadata |
createdAt | string | ISO 8601 timestamp of creation |
updatedAt | string | ISO 8601 timestamp of last update |
statistics | object | Category statistics |
subcategories | array | Array of subcategory objects |
Pagination Object
| Field | Type | Description |
|---|---|---|
limit | number | Current page size |
offset | number | Current offset |
total | number | Total number of categories matching criteria |
hasNext | boolean | Whether more items are available |
hasPrevious | boolean | Whether previous items exist |
Examples
List All Categories
List Active Categories Only
Search Categories by Name
Sort Categories by Name
Error Responses
| Status Code | Description |
|---|---|
400 | Invalid query parameters |
401 | Unauthorized - invalid API key |
403 | Insufficient permissions |
500 | Internal server error |
Pagination Best Practices
- Use
limitto control page size (recommended: 20-50 items) - Use
offsetto navigate through pages - Check
hasNextbefore requesting the next page - Consider filtering for better performance on large datasets