Categories
Update Category
Update an existing category
PUT
Updates an existing category’s details. This endpoint requires admin authentication.
Request
Path Parameters
The unique MongoDB ObjectId of the category to update
Headers
Bearer token with admin privilegesExample:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Must be set to
application/jsonBody Parameters
The new display name of the category. If provided, the slug will be automatically regenerated.
The new description of the category. Can be set to an empty string to clear the description.
Response
Success message
The updated category object
Error Responses
Error message describing what went wrong
404 - Category Not Found
Returned when no category exists with the specified ID.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
- All body parameters are optional - you can update just the name, just the description, or both
- If you update the
name, theslugwill be automatically regenerated - To clear the description, pass an empty string
- The
categoryIdparameter must be a valid MongoDB ObjectId