Copyright (C) 2025 Lucentinian Works Co Ltd
To update the status of a video (e.g., from 'pending' to 'published' or 'rejected'), send a PUT request to the /moderator/videos/{id}/status endpoint. This API is accessible to administrators and moderators.
PUT /moderator/videos/{id}/status
id (integer, required): The ID of the video to update.status (string, required): The new status for the video. Valid values are "pending", "published", or "rejected".rejection_reason (string, optional): Mandatory if status is "rejected". A descriptive reason for rejecting the video.curl -i -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status": "published"}' \
http://phpeertube.ehehdada.com/moderator/videos/{video_id}/status
curl -i -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status": "rejected", "rejection_reason": "Content does not comply with community guidelines."}' \
http://phpeertube.ehehdada.com/moderator/videos/{video_id}/status
Replace {video_id} with the actual ID of the video.
HTTP/1.1 200 OK
Content-Type: application/json
{
"message": "Video status updated successfully."
}
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": "Invalid status specified."
}
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": "Rejection reason is mandatory when status is rejected."
}
HTTP/1.1 401 Unauthorized
Content-Type: application/json
{
"error": "Unauthorized: Missing or invalid token."
}
HTTP/1.1 403 Forbidden
Content-Type: application/json
{
"error": "Forbidden: Only administrators or moderators can manage video statuses."
}
HTTP/1.1 404 Not Found
Content-Type: application/json
{
"error": "Failed to update video status or video not found."
}