Users
Using some features of PeerTube require authentication, for which User provide different levels of permission as well as associated user information. Each user has a corresponding local Account for federation.
List users
Parameters
searchstringqueryPlain text search that will match with user usernames or emails
blockedbooleanqueryFilter results down to (un)banned users
Filter results down to users with a specific role
startinteger>= 0queryOffset used to paginate results
countinteger[1, 100]15queryNumber of items to return
sortstring-id-username-createdAtquerySort users by criteria
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
Create a user
Body
If the smtp server is configured, you can leave the password empty and an email will be sent asking the user to set it first.
immutable name of the user, used to find or mention its actor
chocobozzzemailstring<email>requiredThe user email
videoQuotaintegerThe user video quota in bytes
-1videoQuotaDailyintegerThe user daily video quota in bytes
-1channelNameusernameChannelimmutable name of the channel, used to interact with its actor
framasoft_videoscurrentPasswordcurrentPasswordRequired to create an administrator, see password confirmation
Response
user created
insufficient authority to create an admin or moderator
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
Get a user
Parameters
Entity id
withStatsbooleanqueryinclude statistics about the user (only available as a moderator/admin)
Response
As an admin/moderator, you can request a response augmented with statistics about the user's
moderation relations and videos usage, by using the withStats parameter.
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.
Update a user
Body
emailemailThe updated email of the user
emailVerifiedbooleanSet the email as verified
videoQuotaintegerThe updated video quota of the user in bytes
videoQuotaDailyintegerThe updated daily video quota of the user in bytes
pluginAuthstring | nullThe auth plugin to use to authenticate the user
peertube-plugin-auth-saml2passwordpassword<password>currentPasswordcurrentPasswordRequired to give the administrator role, or to change the password, email or auth plugin of an administrator, see password confirmation
Parameters
Entity 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.
Delete a user
Parameters
Entity 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.
Scopes: admin
Block a user
Prevent a user from logging in and interacting with the instance
Body
reasonstringOptional reason for blocking the user
Parameters
Entity id
Response
successful operation
invalid user id
insufficient permissions to block users
user not found
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
Unblock a user
Allow a previously blocked user to login and interact with the instance
Parameters
Entity id
Response
successful operation
invalid user id
insufficient permissions to unblock users
user not found
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
Ask to reset password
An email containing a reset password link
Body
emailstringrequiredUser email
Response
successful operation
Reset password
Body
verificationStringstring<url>requiredpasswordstringrequiredParameters
Entity id
Response
successful operation
invalid verification string
user not found
Request two factor auth
Request two factor authentication for a user
Body
currentPasswordstringPassword of the currently authenticated user
Parameters
Entity id
Response
successful operation
invalid password
user not found
too many password checks for this user
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.
Confirm two factor auth
Confirm a two factor authentication request
Body
requestTokenstringrequiredToken to identify the two factor request
otpTokenstringrequiredOTP token generated by the app
Parameters
Entity id
Response
successful operation
invalid request token or OTP token
user not found
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.
Disable two factor auth
Disable two factor authentication of a user
Body
currentPasswordstringPassword of the currently authenticated user. Users of an id and pass auth plugin must use the password they log in with
Parameters
Entity id
Response
successful operation
invalid password
user not found
too many password checks for this user
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.
