Categories
Create Category
Create a new category
POST
Creates a new category in the system. This endpoint requires admin authentication.
Request
Headers
Bearer token with admin privilegesExample:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Must be set to
application/jsonBody Parameters
The display name of the category. Must be unique. The slug will be automatically generated from this name.
Optional description of the category
Response
Success message
The newly created category object
Error Responses
Error message describing what went wrong
400 - Category Already Exists
Returned when a category with the same name already exists.401 - Unauthorized
Returned when the authentication token is missing or invalid.403 - Forbidden
Returned when the authenticated user is not an admin.500 - Internal Server Error
Example Request
Notes
- The
slugfield is automatically generated from thenamefield by converting to lowercase and replacing spaces/special characters with hyphens - Category names must be unique across the system
- The auto-generated slug must also be unique