Video
Operations dealing with listing, uploading, fetching or modifying videos.
Request video token
Request special tokens that expire quickly to use them in some context (like accessing private static files)
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
x-peertube-video-passwordstringheaderRequired on password protected video
Response
successful operation
incorrect parameters
video 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.
Create a studio task
Create a task to edit a video (cut, add intro/outro etc). By default the video is edited in place. Set saveAsNewVideo to keep it untouched and save the result in a new video.
Body
saveAsNewVideobooleanfalseKeep the source video untouched: duplicate it, and edit the duplicate. The duplicate is created private, in the same channel as the source video, with the source video metadata. The size of the source video counts towards the user quota.
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
Response
successful operation, when saveAsNewVideo is true. Returns the identifiers of the new video
successful operation, when the source video is edited in place
incorrect parameters
the user cannot manage this video, or saveAsNewVideo is true on a blocked video and the user cannot manage blocks
video not found
video is already being processed
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.
Duplicate a video
Create a copy of a local video, in the same channel.
The copy of a blocked video (that only moderators can duplicate) is blocked for the same reason.
Body
namestringName of the copy. Defaults to the name of the source video followed by "(Copy)"
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
Response
successful operation. Returns the identifiers of the new video
incorrect parameters
the user cannot manage this video, the video is not local, or the video is blocked and the user cannot manage blocks
video not found
video is already being processed
the user video quota is exceeded
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 videos
Parameters
startinteger>= 0queryOffset used to paginate results
countinteger[1, 100]15queryNumber of items to return
skipCountstringtruefalsefalsequeryif you don't need the total in the response
sortstringname-duration-createdAt-publishedAt-views-likes-comments-trending-hot-bestquerynsfwstringtruefalsequerywhether to include nsfw videos, if any
aiUsageOneOfVideoAIUsageSet | Array<VideoAIUsageSet>queryPeerTube >= 9.0 Only list videos with one of these AI usages, declared by video creators.
If not provided, the preference of the authenticated user (aiUsagesHidden) is used
isLivebooleanquerywhether or not the video is a live
includeScheduledLivebooleanquerywhether or not include live that are scheduled for later
categoryOneOfVideoCategorySet | Array<VideoCategorySet>querycategory id of the video (see /videos/categories)
licenceOneOfVideoLicenceSet | Array<VideoLicenceSet>querylicence id of the video (see /videos/licences)
languageOneOfVideoLanguageSet | Array<VideoLanguageSet>querylanguage id of the video (see /videos/languages). Use _unknown to filter on videos that don't have a video language
tagsOneOfstring | Array<string>querytag(s) of the video
tagsAllOfstring | Array<string>querytag(s) of the video, where all should be present in the video
isLocalbooleanqueryPeerTube >= 4.0 Display only local or remote objects
includeinteger012481632queryOnly administrators and moderators can use this parameter
Include additional videos in results (can be combined using bitwise or operator)
0NONE1NOT_PUBLISHED_STATE2BLACKLISTED4BLOCKED_OWNER8FILES16CAPTIONS32VIDEO SOURCE
hasHLSFilesbooleanqueryPeerTube >= 4.0 Display only videos that have HLS files
hasWebVideoFilesbooleanqueryPeerTube >= 6.0 Display only videos that have Web Video files
hoststringqueryFind elements owned by this host
autoTagOneOfstring | Array<string>queryPeerTube >= 6.2 Admins and moderators only filter on videos that contain one of these automatic tags
stateOneOfid | Array<id>queryPeerTube >= 8.2 Admins and moderators only filter on videos that have one of these states
PeerTube >= 4.0 Display only videos in this specific privacy/privacies
excludeAlreadyWatchedbooleanqueryWhether or not to exclude videos that are in the user's video history
searchstringqueryPlain text search, applied to various parts of the model depending on endpoint
Response
successful operation
List recommended videos
Return videos recommended next to a reference video (or general recommendations if no reference video is given).
PeerTube decides the recommendation algorithm: it currently lists videos sharing tags with the reference video
(excluding videos already watched by the authenticated user), then the latest videos.
All returned videos are restricted to the scope, which defaults to the recommendationScope of the reference video.
Parameters
Restrict recommended videos. Defaults to the recommendationScope of the reference video, or to 1 (all videos) if no reference video is given
videoIdid | UUIDv4 | shortUUIDqueryReference video. Required if scope is 3 or 4
countinteger[1, 30]10queryNumber of videos to return
Videos that must not be recommended (the reference video is always excluded)
x-peertube-video-passwordstringheaderRequired on password protected video
nsfwstringtruefalsequerywhether to include nsfw videos, if any
aiUsageOneOfVideoAIUsageSet | Array<VideoAIUsageSet>queryPeerTube >= 9.0 Only list videos with one of these AI usages, declared by video creators.
If not provided, the preference of the authenticated user (aiUsagesHidden) is used
Response
successful operation
invalid parameters or missing videoId
reference video requires authentication or a password
reference video is not visible by the user or the password is invalid
reference video not found
List available video categories
Response
successful operation
List available video licences
Response
successful operation
List available video languages
Parameters
scopestringsubtitlequeryPeerTube >= 8.2 Filter languages by scope. Use subtitle to exclude sign languages and other languages that don't make sense for subtitles.
Response
successful operation
List available video privacy policies
Response
successful operation
Get a video
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
x-peertube-video-passwordstringheaderRequired on password protected video
Response
successful operation
Requires authentication or the video requires a password
Invalid authentication or the video requires a password
Update a video
Body
multipart/form-dataobjectthumbnailfileimage/jpegpreviewfileimage/jpegtagsstyle formexplode truechannelIdintegerNew channel of the video. The channel must be owned by the same account as the previous one. Use the "change ownership" endpoints to give a video to a channel owned by another account on the local PeerTube instance.
thumbnailfilestring<binary>Video thumbnail file
previewfilestring<binary>deprecatedDeprecated in PeerTube v8.1, use thumbnailfile instead
privacyVideoPrivacySet12345privacy id of the video (see /videos/privacies)
descriptionstringVideo description
waitTranscodingstringWhether or not we wait transcoding before publish the video
supportstringA text tell the audience how to support the video creator
Please support our work on https://soutenir.framasoft.org/en/ <3nsfwbooleanWhether or not this video contains sensitive content
nsfwSummaryanyMore information about the sensitive content of the video
nsfwFlagsNSFWFlag0124NSFW flags (can be combined using bitwise or operator)
0NONE1VIOLENT2EXPLICIT_SEX
namestringVideo name
tagsArray<string>Video tags (maximum 5 tags each between 2 and 30 characters)
commentsPolicyVideoCommentsPolicySet123Comments policy of the video (Enabled = 1, Disabled = 2, Requires Approval = 3)
recommendationScopeVideoRecommendationScopeSet1234Videos that can be recommended next to a video:
1All videos2Only videos of the platform that owns the reference video (or of the current platform if no video is given)3Only videos of the account that owns the reference video4Only videos of the channel of the reference video
This is a preference of the video owner: applications displaying recommendations may not apply it
aiUsageVideoAIUsageSet1234PeerTube >= 9.0 Use of AI in the video, declared by the video creator:
1Not specified2No AI-generated content: nothing seen or heard in the video has been generated by AI3Contains AI-generated content: some parts of the video have been generated by AI4AI-generated: the whole video, or most of it, has been generated by AI
commercialContentVideoCommercialContentSet123PeerTube >= 9.0 Commercial content in the video, declared by the video creator:
1None2Promotional content: the creator promotes their own products, services or business3Paid partnership: a third party paid, or provided goods or services, in exchange for the promotion
downloadEnabledbooleanEnable or disable downloading for this video
originallyPublishedAtstring<date-time> | nullDate when the content was originally published
scheduleUpdateVideoScheduledUpdatevideoPasswordsArray<password>Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
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 video
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
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.
Notify user is watching a video
Call this endpoint regularly (every 5-10 seconds for example) to notify the server the user is watching the video. After a while, PeerTube will increase video's viewers counter. If the user is authenticated, PeerTube will also store the current player time.
Body
currentTimeinteger<seconds>requiredtimestamp within the video, in seconds
5viewEventstringseekEvent since last viewing call:
seek- If the user seeked the video
sessionIdstringOptional param to represent the current viewer session. Used by the backend to properly count one view per session per video. PeerTube admin can configure the server to not trust this sessionId parameter but use the request IP address instead to identify a viewer.
clientstringClient software used to watch the video. For example "Firefox", "PeerTube Approval Android", etc.
deviceVideoStatsUserAgentDeviceDevice used to watch the video. For example "desktop", "mobile", "smarttv", etc.
operatingSystemstringOperating system used to watch the video. For example "Windows", "Ubuntu", etc.
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
Response
successful operation
Upload a video
Uses a single request to upload a video.
Body
multipart/form-dataVideoUploadRequestCommon & objectvideofilevideo/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-streamthumbnailfileimage/jpegpreviewfileimage/jpegnamestringrequiredVideo name
What is PeerTube?channelIdinteger>= 1requiredChannel id that will contain this video
3privacyVideoPrivacySet12345privacy id of the video (see /videos/privacies)
descriptionstringVideo description
**[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**
waitTranscodingbooleanWhether or not we wait transcoding before publish the video
generateTranscriptionbooleanPeerTube >= 6.2 If enabled by the admin, automatically generate a subtitle of the video
supportstringA text tell the audience how to support the video creator
Please support our work on https://soutenir.framasoft.org/en/ <3nsfwbooleanWhether or not this video contains sensitive content
nsfwSummaryanyMore information about the sensitive content of the video
nsfwFlagsNSFWFlag0124NSFW flags (can be combined using bitwise or operator)
0NONE1VIOLENT2EXPLICIT_SEX
tagsArray<string>Video tags (maximum 5 tags each between 2 and 30 characters)
[
"framasoft",
"peertube"
]commentsPolicyVideoCommentsPolicySet123Comments policy of the video (Enabled = 1, Disabled = 2, Requires Approval = 3)
recommendationScopeVideoRecommendationScopeSet1234Videos that can be recommended next to a video:
1All videos2Only videos of the platform that owns the reference video (or of the current platform if no video is given)3Only videos of the account that owns the reference video4Only videos of the channel of the reference video
This is a preference of the video owner: applications displaying recommendations may not apply it
aiUsageVideoAIUsageSet1234PeerTube >= 9.0 Use of AI in the video, declared by the video creator:
1Not specified2No AI-generated content: nothing seen or heard in the video has been generated by AI3Contains AI-generated content: some parts of the video have been generated by AI4AI-generated: the whole video, or most of it, has been generated by AI
commercialContentVideoCommercialContentSet123PeerTube >= 9.0 Commercial content in the video, declared by the video creator:
1None2Promotional content: the creator promotes their own products, services or business3Paid partnership: a third party paid, or provided goods or services, in exchange for the promotion
downloadEnabledbooleanEnable or disable downloading for this video
originallyPublishedAtstring<date-time>Date when the content was originally published
scheduleUpdateVideoScheduledUpdatethumbnailfilestring<binary>Video thumbnail file
previewfilestring<binary>deprecatedDeprecated in PeerTube v8.1, use thumbnailfile instead
videoPasswordsArray<password>videofilestring<binary>requiredVideo file
Response
successful operation
video didn't pass upload filter
upload has timed out
If the response has no body, it means the reverse-proxy didn't let it through. Otherwise disambiguate via code:
quota_reachedfor quota limits whether daily or global
video type unsupported
video unreadable
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.
Initialize the resumable upload of a video
Uses a resumable protocol to initialize the upload of a video
Body
namestringrequiredVideo name
What is PeerTube?channelIdinteger>= 1requiredChannel id that will contain this video
3privacyVideoPrivacySet12345privacy id of the video (see /videos/privacies)
descriptionstringVideo description
**[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**
waitTranscodingbooleanWhether or not we wait transcoding before publish the video
generateTranscriptionbooleanPeerTube >= 6.2 If enabled by the admin, automatically generate a subtitle of the video
supportstringA text tell the audience how to support the video creator
Please support our work on https://soutenir.framasoft.org/en/ <3nsfwbooleanWhether or not this video contains sensitive content
nsfwSummaryanyMore information about the sensitive content of the video
nsfwFlagsNSFWFlag0124NSFW flags (can be combined using bitwise or operator)
0NONE1VIOLENT2EXPLICIT_SEX
tagsArray<string>Video tags (maximum 5 tags each between 2 and 30 characters)
[
"framasoft",
"peertube"
]commentsPolicyVideoCommentsPolicySet123Comments policy of the video (Enabled = 1, Disabled = 2, Requires Approval = 3)
recommendationScopeVideoRecommendationScopeSet1234Videos that can be recommended next to a video:
1All videos2Only videos of the platform that owns the reference video (or of the current platform if no video is given)3Only videos of the account that owns the reference video4Only videos of the channel of the reference video
This is a preference of the video owner: applications displaying recommendations may not apply it
aiUsageVideoAIUsageSet1234PeerTube >= 9.0 Use of AI in the video, declared by the video creator:
1Not specified2No AI-generated content: nothing seen or heard in the video has been generated by AI3Contains AI-generated content: some parts of the video have been generated by AI4AI-generated: the whole video, or most of it, has been generated by AI
commercialContentVideoCommercialContentSet123PeerTube >= 9.0 Commercial content in the video, declared by the video creator:
1None2Promotional content: the creator promotes their own products, services or business3Paid partnership: a third party paid, or provided goods or services, in exchange for the promotion
downloadEnabledbooleanEnable or disable downloading for this video
originallyPublishedAtstring<date-time>Date when the content was originally published
scheduleUpdateVideoScheduledUpdatethumbnailfilestring<binary>Video thumbnail file
previewfilestring<binary>deprecatedDeprecated in PeerTube v8.1, use thumbnailfile instead
videoPasswordsArray<password>filenamestring<filename>requiredVideo filename including extension
what_is_peertube.mp4thumbnailfilestring<binary>Video thumbnail file
previewfilestring<binary>deprecatedDeprecated in PeerTube v8.1, use thumbnailfile instead
Parameters
X-Upload-Content-LengthnumberrequiredheaderNumber of bytes that will be uploaded in subsequent requests. Set this value to the size of the file you are uploading.
X-Upload-Content-Typestring<mimetype>requiredheaderMIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary.
Response
file already exists, send a resume request instead
created
Disambiguate via code:
max_file_size_reachedfor the absolute file size limitquota_reachedfor quota limits whether daily or global
video type unsupported
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.
Send chunk for the resumable upload of a video
Uses a resumable protocol to continue, pause or resume the upload of a video
Body
Parameters
upload_ idstringrequiredqueryCreated session id to proceed with. If you didn't send chunks in the last hour, it is not valid anymore and you need to initialize a new upload.
Content-RangestringrequiredheaderSpecifies the bytes in the file that the request is uploading.
For example, a value of bytes 0-262143/1000000 shows that the request is sending the first
262144 bytes (256 x 1024) in a 2,469,036 byte file.
When the server config client.videos.resumableUpload.minChunkSize (video uploads) or
import.users.resumableUpload.minChunkSize (user archive imports) is not 0,
every chunk except the last one must be at least that big. It must also be at least 1/10,000 of the file size
(the maximum number of object storage multipart upload parts).
Content-LengthnumberrequiredheaderSize of the chunk that the request is sending.
Remember that larger chunks are more efficient. PeerTube's web client uses chunks varying from 1048576 bytes (~1MB) and increases or reduces size depending on connection health.
Response
last chunk received
resume incomplete
chunk is smaller than client.videos.resumableUpload.minChunkSize of the server config or 1/10,000 of the file size (and is not the last one)
video didn't pass upload filter
upload not found
chunk doesn't match range
video unreadable
too many concurrent requests
upload is already being processed
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.
Cancel the resumable upload of a video, deleting any data uploaded so far
Uses a resumable protocol to cancel the upload of a video
Parameters
upload_ idstringrequiredqueryCreated session id to proceed with. If you didn't send chunks in the last hour, it is not valid anymore and you need to initialize a new upload.
Content-LengthnumberrequiredheaderResponse
upload cancelled
upload 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.
Create a live
Body
multipart/form-dataobjectthumbnailfileimage/jpegpreviewfileimage/jpegchannelIdintegerrequiredChannel id that will contain this live video
saveReplaybooleanreplaySettingsLiveVideoReplaySettingspermanentLivebooleanUser can stream multiple times in a permanent live
latencyModeLiveVideoLatencyModeUser can select live latency mode if enabled by the instance
thumbnailfilestring<binary>Live video/replay thumbnail file
previewfilestring<binary>deprecatedDeprecated in PeerTube v8.1, use thumbnailfile instead
privacyVideoPrivacySet12345privacy id of the video (see /videos/privacies)
descriptionstringLive video/replay description
supportstringA text tell the audience how to support the creator
Please support our work on https://soutenir.framasoft.org/en/ <3nsfwbooleanWhether or not this live video/replay contains sensitive content
nsfwSummaryanyMore information about the sensitive content of the video
nsfwFlagsNSFWFlag0124NSFW flags (can be combined using bitwise or operator)
0NONE1VIOLENT2EXPLICIT_SEX
namestringrequiredLive video/replay name
tagsArray<string>Live video/replay tags (maximum 5 tags each between 2 and 30 characters)
commentsPolicyVideoCommentsPolicySet123Comments policy of the video (Enabled = 1, Disabled = 2, Requires Approval = 3)
recommendationScopeVideoRecommendationScopeSet1234Videos that can be recommended next to a video:
1All videos2Only videos of the platform that owns the reference video (or of the current platform if no video is given)3Only videos of the account that owns the reference video4Only videos of the channel of the reference video
This is a preference of the video owner: applications displaying recommendations may not apply it
aiUsageVideoAIUsageSet1234PeerTube >= 9.0 Use of AI in the video, declared by the video creator:
1Not specified2No AI-generated content: nothing seen or heard in the video has been generated by AI3Contains AI-generated content: some parts of the video have been generated by AI4AI-generated: the whole video, or most of it, has been generated by AI
commercialContentVideoCommercialContentSet123PeerTube >= 9.0 Commercial content in the video, declared by the video creator:
1None2Promotional content: the creator promotes their own products, services or business3Paid partnership: a third party paid, or provided goods or services, in exchange for the promotion
downloadEnabledbooleanEnable or disable downloading for the replay of this live video
schedulesArray<LiveSchedule>Response
successful operation
Disambiguate via code:
- default type for a validation error
live_conflicting_permanent_and_save_replayfor conflicting parameters set
Disambiguate via code:
live_not_enabledfor a disabled live featurelive_not_allowing_replayfor a disabled replay featuremax_instance_lives_limit_reachedfor the absolute concurrent live limitmax_user_lives_limit_reachedfor the user concurrent live limit
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 information about a live
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
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.
Update information about a live
Body
saveReplaybooleanreplaySettingsLiveVideoReplaySettingspermanentLivebooleanUser can stream multiple times in a permanent live
latencyModeLiveVideoLatencyModeUser can select live latency mode if enabled by the instance
schedulesArray<LiveSchedule>Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
Response
successful operation
bad parameters or trying to update a live that has already started
trying to save replay of the live but saving replay is not enabled on the instance
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 video source file metadata
Get metadata and download link of original video file
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
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 video source file
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
Response
successful operation
video source 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, moderator
Initialize the resumable replacement of a video
PeerTube >= 6.0 Uses a resumable protocol to initialize the replacement of a video
Body
filenamestring<filename>Video filename including extension
what_is_peertube.mp4Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
X-Upload-Content-LengthnumberrequiredheaderNumber of bytes that will be uploaded in subsequent requests. Set this value to the size of the file you are uploading.
X-Upload-Content-Typestring<mimetype>requiredheaderMIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary.
Response
file already exists, send a resume request instead
created
Disambiguate via code:
max_file_size_reachedfor the absolute file size limitquota_reachedfor quota limits whether daily or global
video type unsupported
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.
Send chunk for the resumable replacement of a video
PeerTube >= 6.0 Uses a resumable protocol to continue, pause or resume the replacement of a video
Body
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
upload_ idstringrequiredqueryCreated session id to proceed with. If you didn't send chunks in the last hour, it is not valid anymore and you need to initialize a new upload.
Content-RangestringrequiredheaderSpecifies the bytes in the file that the request is uploading.
For example, a value of bytes 0-262143/1000000 shows that the request is sending the first
262144 bytes (256 x 1024) in a 2,469,036 byte file.
When the server config client.videos.resumableUpload.minChunkSize (video uploads) or
import.users.resumableUpload.minChunkSize (user archive imports) is not 0,
every chunk except the last one must be at least that big. It must also be at least 1/10,000 of the file size
(the maximum number of object storage multipart upload parts).
Content-LengthnumberrequiredheaderSize of the chunk that the request is sending.
Remember that larger chunks are more efficient. PeerTube's web client uses chunks varying from 1048576 bytes (~1MB) and increases or reduces size depending on connection health.
Response
last chunk received: successful operation
resume incomplete
chunk is smaller than client.videos.resumableUpload.minChunkSize of the server config or 1/10,000 of the file size (and is not the last one)
video didn't pass file replacement filter
replace upload not found
chunk doesn't match range
video unreadable
too many concurrent requests
upload is already being processed
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.
Cancel the resumable replacement of a video
PeerTube >= 6.0 Uses a resumable protocol to cancel the replacement of a video
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
upload_ idstringrequiredqueryCreated session id to proceed with. If you didn't send chunks in the last hour, it is not valid anymore and you need to initialize a new upload.
Content-LengthnumberrequiredheaderResponse
source file replacement cancelled
source file replacement 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.
List storyboards of a video
PeerTube >= 6.0
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
Response
successful operation
List videos of a video channel
Parameters
channelHandlestringrequiredpathThe video channel handle
startinteger>= 0queryOffset used to paginate results
countinteger[1, 100]15queryNumber of items to return
skipCountstringtruefalsefalsequeryif you don't need the total in the response
sortstringname-duration-createdAt-publishedAt-views-likes-comments-trending-hot-bestquerynsfwstringtruefalsequerywhether to include nsfw videos, if any
aiUsageOneOfVideoAIUsageSet | Array<VideoAIUsageSet>queryPeerTube >= 9.0 Only list videos with one of these AI usages, declared by video creators.
If not provided, the preference of the authenticated user (aiUsagesHidden) is used
isLivebooleanquerywhether or not the video is a live
includeScheduledLivebooleanquerywhether or not include live that are scheduled for later
categoryOneOfVideoCategorySet | Array<VideoCategorySet>querycategory id of the video (see /videos/categories)
licenceOneOfVideoLicenceSet | Array<VideoLicenceSet>querylicence id of the video (see /videos/licences)
languageOneOfVideoLanguageSet | Array<VideoLanguageSet>querylanguage id of the video (see /videos/languages). Use _unknown to filter on videos that don't have a video language
tagsOneOfstring | Array<string>querytag(s) of the video
tagsAllOfstring | Array<string>querytag(s) of the video, where all should be present in the video
isLocalbooleanqueryPeerTube >= 4.0 Display only local or remote objects
includeinteger012481632queryOnly administrators and moderators can use this parameter
Include additional videos in results (can be combined using bitwise or operator)
0NONE1NOT_PUBLISHED_STATE2BLACKLISTED4BLOCKED_OWNER8FILES16CAPTIONS32VIDEO SOURCE
hasHLSFilesbooleanqueryPeerTube >= 4.0 Display only videos that have HLS files
hasWebVideoFilesbooleanqueryPeerTube >= 6.0 Display only videos that have Web Video files
hoststringqueryFind elements owned by this host
autoTagOneOfstring | Array<string>queryPeerTube >= 6.2 Admins and moderators only filter on videos that contain one of these automatic tags
stateOneOfid | Array<id>queryPeerTube >= 8.2 Admins and moderators only filter on videos that have one of these states
PeerTube >= 4.0 Display only videos in this specific privacy/privacies
excludeAlreadyWatchedbooleanqueryWhether or not to exclude videos that are in the user's video history
searchstringqueryPlain text search, applied to various parts of the model depending on endpoint
Response
successful operation
Search videos
Parameters
searchstringrequiredqueryString to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete video information and interact with it.
uuidsanyqueryFind elements with specific UUIDs
searchTargetstringlocalsearch-indexqueryIf the administrator enabled search index support, you can override the default search target.
Warning: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
- If the current user has the ability to make a remote URI search (this information is available in the config endpoint), then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
- If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch the data from the origin instance API
startinteger>= 0queryOffset used to paginate results
countinteger[1, 100]15queryNumber of items to return
skipCountstringtruefalsefalsequeryif you don't need the total in the response
sortstringname-duration-createdAt-publishedAt-views-likes-comments-trending-hot-bestquerynsfwstringtruefalsequerywhether to include nsfw videos, if any
aiUsageOneOfVideoAIUsageSet | Array<VideoAIUsageSet>queryPeerTube >= 9.0 Only list videos with one of these AI usages, declared by video creators.
If not provided, the preference of the authenticated user (aiUsagesHidden) is used
isLivebooleanquerywhether or not the video is a live
includeScheduledLivebooleanquerywhether or not include live that are scheduled for later
categoryOneOfVideoCategorySet | Array<VideoCategorySet>querycategory id of the video (see /videos/categories)
licenceOneOfVideoLicenceSet | Array<VideoLicenceSet>querylicence id of the video (see /videos/licences)
languageOneOfVideoLanguageSet | Array<VideoLanguageSet>querylanguage id of the video (see /videos/languages). Use _unknown to filter on videos that don't have a video language
tagsOneOfstring | Array<string>querytag(s) of the video
tagsAllOfstring | Array<string>querytag(s) of the video, where all should be present in the video
isLocalbooleanqueryPeerTube >= 4.0 Display only local or remote objects
includeinteger012481632queryOnly administrators and moderators can use this parameter
Include additional videos in results (can be combined using bitwise or operator)
0NONE1NOT_PUBLISHED_STATE2BLACKLISTED4BLOCKED_OWNER8FILES16CAPTIONS32VIDEO SOURCE
hasHLSFilesbooleanqueryPeerTube >= 4.0 Display only videos that have HLS files
hasWebVideoFilesbooleanqueryPeerTube >= 6.0 Display only videos that have Web Video files
hoststringqueryFind elements owned by this host
autoTagOneOfstring | Array<string>queryPeerTube >= 6.2 Admins and moderators only filter on videos that contain one of these automatic tags
stateOneOfid | Array<id>queryPeerTube >= 8.2 Admins and moderators only filter on videos that have one of these states
PeerTube >= 4.0 Display only videos in this specific privacy/privacies
excludeAlreadyWatchedbooleanqueryWhether or not to exclude videos that are in the user's video history
startDatestring<date-time>queryGet videos that are published after this date
endDatestring<date-time>queryGet videos that are published before this date
originallyPublishedStartDatestring<date-time>queryGet videos that are originally published after this date
originallyPublishedEndDatestring<date-time>queryGet videos that are originally published before this date
durationMinintegerqueryGet videos that have this minimum duration
durationMaxintegerqueryGet videos that have this maximum duration
Response
successful operation
search index unavailable
