Video Comments
Operations dealing with comments to a video. Comments are organized in threads: adding a comment in response to the video starts a thread, adding a reply to a comment adds it to its root comment thread.
List comments on user's videos
PeerTube >= 6.2
Parameters
searchstringqueryPlain text search, applied to various parts of the model depending on endpoint
searchAccountstringqueryFilter comments by searching on the account
searchVideostringqueryFilter comments by searching on the video
videoIdintegerqueryLimit results on this specific video
videoChannelIdintegerqueryLimit results on this specific video channel
autoTagOneOfstring | Array<string>queryPeerTube >= 6.2 filter on comments that contain one of these automatic tags
isHeldForReviewbooleanqueryonly display comments that are held for review
includeCollaborationsbooleanqueryPeerTube >= 8.0 Include objects from collaborated channels
Response
successful operation
Authorization
OAuth2oauth2Authenticating via OAuth requires the following steps:
- Have an activated account
- Generate an access token for that account at
/api/v1/users/token. - Make requests with the Authorization: Bearer <token> header
- Profit, depending on the role assigned to the account
Note that the access token is valid for 1 day and is given along with a refresh token valid for 2 weeks.
List threads of a video
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
startinteger>= 0queryOffset used to paginate results
countinteger[1, 100]15queryNumber of items to return
sortstring-createdAt-totalRepliesquerySort comments by criteria
x-peertube-video-passwordstringheaderRequired on password protected video
Response
successful operation
Create a thread
Body
texttext<markdown>requiredParameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
Response
successful operation
video does not exist
Authorization
OAuth2oauth2Authenticating via OAuth requires the following steps:
- Have an activated account
- Generate an access token for that account at
/api/v1/users/token. - Make requests with the Authorization: Bearer <token> header
- Profit, depending on the role assigned to the account
Note that the access token is valid for 1 day and is given along with a refresh token valid for 2 weeks.
Get a thread
Since PeerTube 8.3 the returned tree is truncated: only the first replies of each comment are included, and only down to maxDepth nesting levels. Use GET /api/v1/videos/{id}/comments/{commentId}/replies to fetch the replies that are missing, comparing children and totalChildren of each node of the tree.
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
threadIdintegerrequiredpathThe thread id (root comment id)
maxDepthinteger[1, 10]5queryNumber of nesting levels to include below the requested comment.
Bounded by repliesPerLevel and count, see the note on repliesPerLevel
repliesPerLevelinteger[1, 30]10queryNumber of direct replies to include for each comment of the tree. Does not apply to the first level of GET /api/v1/videos/{id}/comments/{commentId}/replies, which is paginated using start and count.
A tree can make the server walk through count * (repliesPerLevel ^ maxDepth - 1) / (repliesPerLevel - 1) comments, which grows exponentially. Combinations above 2000000 are rejected A deep tree has to be narrow and a wide tree has to be shallow.
x-peertube-video-passwordstringheaderRequired on password protected video
Response
successful operation
List replies of a comment
PeerTube >= 8.3 List the direct replies of a comment, each of them nested up to maxDepth levels. Used to unfold the parts of a thread that GET /api/v1/videos/{id}/comment-threads/{threadId} truncated.
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
The comment id
startinteger>= 0queryOffset used to paginate results
countinteger[1, 100]15queryNumber of items to return
sortstringcreatedAt-createdAtcreatedAtquerySort the direct replies of the comment. Deeper levels of the tree are always sorted the same way.
Defaults to createdAt so the replies are appended to the thread tree in the order it was built
maxDepthinteger[1, 10]5queryNumber of nesting levels to include below the requested comment.
Bounded by repliesPerLevel and count, see the note on repliesPerLevel
repliesPerLevelinteger[1, 30]10queryNumber of direct replies to include for each comment of the tree. Does not apply to the first level of GET /api/v1/videos/{id}/comments/{commentId}/replies, which is paginated using start and count.
A tree can make the server walk through count * (repliesPerLevel ^ maxDepth - 1) / (repliesPerLevel - 1) comments, which grows exponentially. Combinations above 2000000 are rejected A deep tree has to be narrow and a wide tree has to be shallow.
x-peertube-video-passwordstringheaderRequired on password protected video
Response
successful operation
List instance comments
Parameters
searchstringqueryPlain text search, applied to various parts of the model depending on endpoint
searchAccountstringqueryFilter comments by searching on the account
searchVideostringqueryFilter comments by searching on the video
videoIdintegerqueryLimit results on this specific video
videoChannelIdintegerqueryLimit results on this specific video channel
autoTagOneOfstring | Array<string>queryPeerTube >= 6.2 filter on comments that contain one of these automatic tags
isLocalbooleanqueryPeerTube >= 4.0 Display only local or remote objects
onLocalVideobooleanqueryDisplay only objects of local or remote videos
includeMutedbooleanqueryPeerTube >= 8.2 Include comments from muted accounts
Response
successful operation
Authorization
OAuth2oauth2Authenticating via OAuth requires the following steps:
- Have an activated account
- Generate an access token for that account at
/api/v1/users/token. - Make requests with the Authorization: Bearer <token> header
- Profit, depending on the role assigned to the account
Note that the access token is valid for 1 day and is given along with a refresh token valid for 2 weeks.
Scopes: admin, moderator
Reply to a thread of a video
Body
texttext<markdown>requiredParameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
The comment id
x-peertube-video-passwordstringheaderRequired on password protected video
Response
successful operation
thread or video does not exist
Authorization
OAuth2oauth2Authenticating via OAuth requires the following steps:
- Have an activated account
- Generate an access token for that account at
/api/v1/users/token. - Make requests with the Authorization: Bearer <token> header
- Profit, depending on the role assigned to the account
Note that the access token is valid for 1 day and is given along with a refresh token valid for 2 weeks.
Delete a comment or a reply
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
The comment id
Response
successful operation
cannot remove comment of another user
comment or video does not exist
comment is already deleted
Authorization
OAuth2oauth2Authenticating via OAuth requires the following steps:
- Have an activated account
- Generate an access token for that account at
/api/v1/users/token. - Make requests with the Authorization: Bearer <token> header
- Profit, depending on the role assigned to the account
Note that the access token is valid for 1 day and is given along with a refresh token valid for 2 weeks.
Approve a comment
PeerTube >= 6.2 Approve a comment that requires a review
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
The comment id
Response
successful operation
Authorization
OAuth2oauth2Authenticating via OAuth requires the following steps:
- Have an activated account
- Generate an access token for that account at
/api/v1/users/token. - Make requests with the Authorization: Bearer <token> header
- Profit, depending on the role assigned to the account
Note that the access token is valid for 1 day and is given along with a refresh token valid for 2 weeks.
