Moderation

Account Blocklist

Get block status of accounts/hosts

GET
https://peertube2.cpy.re/api/v1/blocklist/status

Parameters

accountsArray<string>query

Check if these accounts are blocked

hostsArray<string>query

Check if these hosts are blocked

Response

successful operation

Response fields application/json
accountsobject
Show child attributes
[key: string]object
Show child attributes
blockedByServerboolean
blockedByServerSubscriptionstring
blockedByUserboolean
hostsobject
Show child attributes
[key: string]object
Show child attributes
blockedByServerboolean
blockedByServerSubscriptionstring
blockedByUserboolean

List accounts blocked by my account

GET
https://peertube2.cpy.re/api/v1/users/me/blocklist/accounts

Get the list of accounts that the authenticated user has blocked

Parameters

startinteger>= 0query

Offset used to paginate results

countinteger[1, 100]15query

Number of items to return

sortstringquery

Sort column

searchstringquery

Search query string

Response

200OKobject

successful operation

Response fields application/json
totalinteger
Example
1
Show child attributes
byAccountActor & 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

blockedAccountActor & any
Show child attributes
idid>= 1
Example
42

Same fields as data.byAccount.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

Show child attributes
idid>= 1
Example
42

Same fields as data.byAccount.userId

namestring
urlstring<url>
createdAtstring<date-time>
401Unauthorized

authentication required

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: user

Block an account by my account

POST
https://peertube2.cpy.re/api/v1/users/me/blocklist/accounts

Add an account to the authenticated user's blocklist

Body

application/json
accountNamestringrequired

Account name to block (format: name@host)

Example
user@example.com

Response

204No Content

successful operation - account blocked

400Bad Request

invalid account name

401Unauthorized

authentication required

404Not Found

account 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: user

Unblock an account by my account

DELETE
https://peertube2.cpy.re/api/v1/users/me/blocklist/accounts/{accountName}

Remove an account from the authenticated user's blocklist

Parameters

accountNamestringrequiredpath

Account name to unblock (format: name@host)

Response

204No Content

successful operation - account unblocked

400Bad Request

invalid account name

401Unauthorized

authentication required

404Not Found

account 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: user

List servers blocked by my account

GET
https://peertube2.cpy.re/api/v1/users/me/blocklist/servers

Get the list of servers that the authenticated user has blocked

Parameters

startinteger>= 0query

Offset used to paginate results

countinteger[1, 100]15query

Number of items to return

sortstringquery

Sort column

searchstringquery

Search query string

Response

200OKobject

successful operation

Response fields application/json
totalinteger
Example
1
Show child attributes
byAccountActor & 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

blockedServerobject
Show child attributes
hoststring<hostname>
Show child attributes
idid>= 1
Example
42

Same fields as data.byAccount.userId

namestring
urlstring<url>
createdAtstring<date-time>
401Unauthorized

authentication required

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: user

Block a server by my account

POST
https://peertube2.cpy.re/api/v1/users/me/blocklist/servers

Add a server to the authenticated user's blocklist

Body

application/json
hoststringrequired

Server host to block

Example
example.com

Response

204No Content

successful operation - server blocked

400Bad Request

invalid server host

401Unauthorized

authentication required

404Not Found

server 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: user

Unblock a server by my account

DELETE
https://peertube2.cpy.re/api/v1/users/me/blocklist/servers/{host}

Remove a server from the authenticated user's blocklist

Parameters

hoststringrequiredpath

Server host to unblock

Response

204No Content

successful operation - server unblocked

400Bad Request

invalid server host

401Unauthorized

authentication required

404Not Found

server 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: user