Moderation

Abuses

Abuses deal with reports of local or remote videos/comments/accounts alike.

List abuses

GET
https://peertube2.cpy.re/api/v1/abuses

Parameters

idintegerquery

only list the report with this id

predefinedReasonArray<string>violentOrAbusivehatefulOrAbusivespamOrMisleadingprivacyrightsserverRulesthumbnailscaptionsquery

predefined reason the listed reports should contain

searchstringquery

plain search that will match with video titles, reporter names and more

stateAbuseStateSet123query
searchReporterstringquery

only list reports of a specific reporter

searchReporteestringquery

only list reports of a specific reportee

searchVideostringquery

only list reports of a specific video

searchVideoChannelstringquery

only list reports of a specific video channel

videoIsstringdeletedblacklistedquery

only list deleted or blocklisted videos

filterstringvideocommentaccountquery

only list account, comment or video reports

startinteger>= 0query

Offset used to paginate results

countinteger[1, 100]15query

Number of items to return

sortstring-id-createdAt-statequery

Sort abuses by criteria

Response

200OKobject

successful operation

Response fields application/json
totalinteger
Example
1
Show child attributes
idid>= 1
Example
42
reasonstring
Example
The video is a spam
predefinedReasonsArray<string>violentOrAbusivehatefulOrAbusivespamOrMisleadingprivacyrightsserverRulesthumbnailscaptions
Example
[
  "spamOrMisleading"
]
reporterAccountActor & any
Show child attributes
idid>= 1
Example
42
urlstring<url>
nameusername

immutable name of the actor, used to find or mention it

Show child attributes

immutable name of the user, used to find or mention its actor

username
Example
chocobozzz
Show child attributes
pathstring | nulldeprecated

Deprecated in PeerTube v8.0, use fileUrl instead. Null if the file is stored in object storage: use the non-deprecated field instead.

fileUrlstring

PeerTube >= 7.1

widthinteger
heightinteger

PeerTube >= 7.3

createdAtstring<date-time>
updatedAtstring<date-time>
hoststring<hostname>

server on which the actor is resident

hostRedundancyAllowedboolean | null

whether this actor's host allows redundancy of its videos

followingCountinteger>= 0

number of actors subscribed to by this actor, as seen by this instance

followersCountinteger>= 0

number of followers of this actor, as seen by this instance

createdAtstring<date-time>
updatedAtstring<date-time>
userIdid | null

object id for the user tied to this account

Show child attributes
id>= 1
Example
42
displayNamestring

editable name of the account, displayed in its representations

descriptionstring | null

text or bio displayed on the account's profile

Show child attributes

The abuse state (Pending = 1, Rejected = 2, Accepted = 3)

labelstring
moderationCommentstring
Example
Decided to ban the server since it spams us regularly
videoobject
Show child attributes
idinteger
Example
9c9de5e8-0a1e-484a-b099-e80766180a6d
shortUUIDshortUUID

translation of a uuid v4 with a bigger alphabet to have a shorter uuid

Example
2y84q2MQUMWPbiEcxNXMgC
namestring
nsfwboolean
startAtstring<date-time>
endAtstring<date-time>
deletedboolean
blacklistedboolean
thumbnailPathstring | nulldeprecated

Deprecated in PeerTube v8.1, use thumbnails instead. Null if the file is stored in object storage: use the non-deprecated field instead.

PeerTube >= 8.1 Array of thumbnails for the video

Show child attributes
fileUrlstring
widthinteger
heightinteger
aspectRatiostring
Example
16:9
Show child attributes
idid>= 1
Example
42

Same fields as data.reporterAccount.userId

urlstring<url>
nameusername

immutable name of the actor, used to find or mention it

Show child attributes

immutable name of the user, used to find or mention its actor

username
Example
chocobozzz
Show child attributes
pathstring | nulldeprecated

Deprecated in PeerTube v8.0, use fileUrl instead. Null if the file is stored in object storage: use the non-deprecated field instead.

fileUrlstring

PeerTube >= 7.1

widthinteger
heightinteger

PeerTube >= 7.3

createdAtstring<date-time>
updatedAtstring<date-time>
hoststring<hostname>

server on which the actor is resident

hostRedundancyAllowedboolean | null

whether this actor's host allows redundancy of its videos

followingCountinteger>= 0

number of actors subscribed to by this actor, as seen by this instance

followersCountinteger>= 0

number of followers of this actor, as seen by this instance

createdAtstring<date-time>
updatedAtstring<date-time>
displayNamestring

editable name of the channel, displayed in its representations

Example
Videos of Framasoft
descriptionstring | null
Example
Videos made with <3 by Framasoft
supportstring | null

text shown by default on all videos of this channel, to tell the audience how to support it

Example
Please support our work on https://soutenir.framasoft.org/en/ <3
publicEmailstring<email> | null

Public email visible in podcast RSS feeds

isLocalboolean
updatedAtstring<date-time>
Show child attributes
pathstring | nulldeprecated

Deprecated in PeerTube v8.0, use fileUrl instead. Null if the file is stored in object storage: use the non-deprecated field instead.

fileUrlstring

PeerTube >= 7.1

widthinteger
heightinteger

PeerTube >= 7.3

createdAtstring<date-time>
updatedAtstring<date-time>
ownerAccountActor & any
Show child attributes
idid>= 1
Example
42

Same fields as data.reporterAccount.userId

urlstring<url>
nameusername

immutable name of the actor, used to find or mention it

Show child attributes

immutable name of the user, used to find or mention its actor

username
Example
chocobozzz
Show child attributes
pathstring | nulldeprecated

Deprecated in PeerTube v8.0, use fileUrl instead. Null if the file is stored in object storage: use the non-deprecated field instead.

fileUrlstring

PeerTube >= 7.1

widthinteger
heightinteger

PeerTube >= 7.3

createdAtstring<date-time>
updatedAtstring<date-time>
hoststring<hostname>

server on which the actor is resident

hostRedundancyAllowedboolean | null

whether this actor's host allows redundancy of its videos

followingCountinteger>= 0

number of actors subscribed to by this actor, as seen by this instance

followersCountinteger>= 0

number of followers of this actor, as seen by this instance

createdAtstring<date-time>
updatedAtstring<date-time>
userIdid | null

object id for the user tied to this account

Show child attributes
id>= 1
Example
42
displayNamestring

editable name of the account, displayed in its representations

descriptionstring | null

text or bio displayed on the account's profile

videosCountinteger

only included when withStats is true

viewsPerDayArray<object>

only included when withStats is true. Chronologically ordered, spans the whole statsDays range. Each point aggregates viewsGroupInterval worth of views, starting at date

Show child attributes
datestring<date-time>
viewsinteger
viewsGroupIntervalstringdayweekmonth

bucket size of viewsPerDay, only included when withStats is true

totalViewsinteger

lifetime views of all the channel videos, only included when withStats is true

createdAtstring<date-time>

Authorization

OAuth2oauth2

Authenticating 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

Report an abuse

POST
https://peertube2.cpy.re/api/v1/abuses

You cannot report a video that you own or on which you are a collaborator (video channel editor).

Body

application/json
reasonstringrequired

Reason why the user reports this video

predefinedReasonsArray<string>violentOrAbusivehatefulOrAbusivespamOrMisleadingprivacyrightsserverRulesthumbnailscaptions

Reason categories that help triage reports

videoobject
Show child attributes
idid

Video id to report

Show child attributes

object id for the video

id>= 1
Example
42
startAtinteger<seconds>>= 0

Timestamp in the video that marks the beginning of the report

endAtinteger<seconds>>= 0

Timestamp in the video that marks the ending of the report

commentobject
Show child attributes
idid

Comment id to report

Show child attributes
id>= 1
Example
42
videoUUIDstring<uuid>

UUID of the video of the comment, required to report a comment of an unlisted video

accountobject
Show child attributes
idinteger

Account id to report

Parameters

x-peertube-video-passwordstringheader

Required on password protected video

Response

200OKobject

successful operation

Response fields application/json
abuseobject
Show child attributes
idid>= 1
Example
42
400Bad Request

incorrect request parameters

403Forbidden

cannot report a video you own or that you collaborate on

Authorization

OAuth2oauth2

Authenticating 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.

Update an abuse

PUT
https://peertube2.cpy.re/api/v1/abuses/{abuseId}

Body

application/json

The abuse state (Pending = 1, Rejected = 2, Accepted = 3)

moderationCommentstring

Update the report comment visible only to the moderation team

Parameters

abuseIdid>= 1requiredpath

Abuse id

Response

204No Content

successful operation

404Not Found

abuse not found

Authorization

OAuth2oauth2

Authenticating 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

Delete an abuse

DELETE
https://peertube2.cpy.re/api/v1/abuses/{abuseId}

Parameters

abuseIdid>= 1requiredpath

Abuse id

Response

204No Content

successful operation

404Not Found

block not found

Authorization

OAuth2oauth2

Authenticating 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

List messages of an abuse

GET
https://peertube2.cpy.re/api/v1/abuses/{abuseId}/messages

Parameters

abuseIdid>= 1requiredpath

Abuse id

Response

200OKobject

successful operation

Response fields application/json
totalinteger
Example
1
Show child attributes
idid>= 1
Example
42
messagestring
byModeratorboolean
createdAtstring<date-time>
Show child attributes
idinteger
namestring
displayNamestring
urlstring<url>
hoststring<hostname>
Show child attributes
pathstring | nulldeprecated

Deprecated in PeerTube v8.0, use fileUrl instead. Null if the file is stored in object storage: use the non-deprecated field instead.

fileUrlstring

PeerTube >= 7.1

widthinteger
heightinteger

PeerTube >= 7.3

createdAtstring<date-time>
updatedAtstring<date-time>

Authorization

OAuth2oauth2

Authenticating 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.

Add message to an abuse

POST
https://peertube2.cpy.re/api/v1/abuses/{abuseId}/messages

Body

application/json
messagestringrequired

Message to send

Parameters

abuseIdid>= 1requiredpath

Abuse id

Response

200OK

successful operation

400Bad Request

incorrect request parameters

Authorization

OAuth2oauth2

Authenticating 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 an abuse message

DELETE
https://peertube2.cpy.re/api/v1/abuses/{abuseId}/messages/{abuseMessageId}

Parameters

abuseIdid>= 1requiredpath

Abuse id

abuseMessageIdid>= 1requiredpath

Abuse message id

Response

204No Content

successful operation

Authorization

OAuth2oauth2

Authenticating 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.