Video Upload

Initialize the resumable upload of a video

POST
https://peertube2.cpy.re/api/v1/videos/upload-resumable

Uses a resumable protocol to initialize the upload of a video

Body

application/json
namestringrequired

Video name

Example
What is PeerTube?
channelIdinteger>= 1required

Channel id that will contain this video

Example
3
privacyVideoPrivacySet12345

privacy id of the video (see /videos/privacies)

category id of the video (see /videos/categories)

Example
15

licence id of the video (see /videos/licences)

Example
2

language id of the video (see /videos/languages)

Example
en
descriptionstring

Video description

Example
**[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)**
waitTranscodingboolean

Whether or not we wait transcoding before publish the video

generateTranscriptionboolean

PeerTube >= 6.2 If enabled by the admin, automatically generate a subtitle of the video

supportstring

A text tell the audience how to support the video creator

Example
Please support our work on https://soutenir.framasoft.org/en/ <3
nsfwboolean

Whether or not this video contains sensitive content

nsfwSummaryany

More information about the sensitive content of the video

nsfwFlagsNSFWFlag0124

NSFW flags (can be combined using bitwise or operator)

  • 0 NONE
  • 1 VIOLENT
  • 2 EXPLICIT_SEX
tagsArray<string>

Video tags (maximum 5 tags each between 2 and 30 characters)

Example
[
  "framasoft",
  "peertube"
]
commentsPolicyVideoCommentsPolicySet123

Comments policy of the video (Enabled = 1, Disabled = 2, Requires Approval = 3)

recommendationScopeVideoRecommendationScopeSet1234

Videos that can be recommended next to a video:

  • 1 All videos
  • 2 Only videos of the platform that owns the reference video (or of the current platform if no video is given)
  • 3 Only videos of the account that owns the reference video
  • 4 Only videos of the channel of the reference video

This is a preference of the video owner: applications displaying recommendations may not apply it

aiUsageVideoAIUsageSet1234

PeerTube >= 9.0 Use of AI in the video, declared by the video creator:

  • 1 Not specified
  • 2 No AI-generated content: nothing seen or heard in the video has been generated by AI
  • 3 Contains AI-generated content: some parts of the video have been generated by AI
  • 4 AI-generated: the whole video, or most of it, has been generated by AI
commercialContentVideoCommercialContentSet123

PeerTube >= 9.0 Commercial content in the video, declared by the video creator:

  • 1 None
  • 2 Promotional content: the creator promotes their own products, services or business
  • 3 Paid partnership: a third party paid, or provided goods or services, in exchange for the promotion
downloadEnabledboolean

Enable or disable downloading for this video

originallyPublishedAtstring<date-time>

Date when the content was originally published

scheduleUpdateVideoScheduledUpdate
Show child attributes
privacyVideoPrivacySet12345

privacy id of the video (see /videos/privacies)

updateAtstring<date-time>required

When to update the video

thumbnailfilestring<binary>

Video thumbnail file

previewfilestring<binary>deprecated

Deprecated in PeerTube v8.1, use thumbnailfile instead

videoPasswordsArray<password>
filenamestring<filename>required

Video filename including extension

Example
what_is_peertube.mp4
thumbnailfilestring<binary>

Video thumbnail file

previewfilestring<binary>deprecated

Deprecated in PeerTube v8.1, use thumbnailfile instead

Parameters

X-Upload-Content-Lengthnumberrequiredheader

Number 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>requiredheader

MIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary.

Response

200OK

file already exists, send a resume request instead

201Created

created

Response headers
Locationstring<url>header
Content-Lengthnumberheader
413Payload Too Large

Disambiguate via code:

  • max_file_size_reached for the absolute file size limit
  • quota_reached for quota limits whether daily or global
415Unsupported Media Type

video type unsupported

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.