PHPeerTube - A PHP‑based federated video platform, inspired by PeerTube.

Copyright (C) 2025 Lucentinian Works Co Ltd

API example

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.

Request

PUT /moderator/videos/{id}/status

Path Parameters

Request Body (application/json)

Example cURL Requests

Set status to published

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

Set status to rejected with a reason

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.

Example Success Response (Status: 200 OK)

HTTP/1.1 200 OK
Content-Type: application/json

{
    "message": "Video status updated successfully."
}

Example Error Responses

400 Bad Request

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."
}

401 Unauthorized

HTTP/1.1 401 Unauthorized
Content-Type: application/json

{
    "error": "Unauthorized: Missing or invalid token."
}

403 Forbidden

HTTP/1.1 403 Forbidden
Content-Type: application/json

{
    "error": "Forbidden: Only administrators or moderators can manage video statuses."
}

404 Not Found

HTTP/1.1 404 Not Found
Content-Type: application/json

{
    "error": "Failed to update video status or video not found."
}