Copyright (C) 2025 Lucentinian Works Co Ltd
This document provides curl examples for managing video categories using the moderator/administrator API.
All moderator/administrator endpoints require authentication. Replace YOUR_AUTH_TOKEN with a valid JWT.
curl -X GET \
http://localhost/moderator/categories \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
curl -X POST \
http://localhost/moderator/categories \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
-d '{
"name": "New Category Name",
"slug": "new-category-slug",
"isApproved": true
}'
curl -X GET \
http://localhost/moderator/categories/1 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
curl -X PUT \
http://localhost/moderator/categories/1 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
-d '{
"name": "Updated Category Name",
"slug": "updated-category-slug",
"isApproved": false
}'
curl -X PATCH \
http://localhost/moderator/categories/1/approve \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
curl -X DELETE \
http://localhost/moderator/categories/1 \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
This endpoint allows moderators/administrators to approve or reject a category assigned to a specific video.
curl -X PATCH \
http://localhost/moderator/videos/123/categories/456/status \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
-d '{"status": "approved"}'
curl -X PATCH \
http://localhost/moderator/videos/123/categories/456/status \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
-d '{"status": "rejected"}'