Video Upload

Upload a video

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

Uses a single request to upload a video.

Body

multipart/form-data
Encoding
videofilevideo/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
thumbnailfileimage/jpeg
previewfileimage/jpeg
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>
videofilestring<binary>required

Video file

Response

successful operation

Response fields application/json
videoobject
Show child attributes
idid

object id for the video

Show child attributes
id>= 1
Example
42
uuidUUIDv4

universal identifier for the video, that can be used across instances

Show child attributes
UUIDv4<uuid>
Example
9c9de5e8-0a1e-484a-b099-e80766180a6d
shortUUIDshortUUID
Show child attributes

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

shortUUID
Example
2y84q2MQUMWPbiEcxNXMgC
403Forbidden

video didn't pass upload filter

408Request Timeout

upload has timed out

413Payload Too Large

If the response has no body, it means the reverse-proxy didn't let it through. Otherwise disambiguate via code:

  • quota_reached for quota limits whether daily or global
Response headers
X-File-Maximum-Sizestring<Nginx size>header

Maximum file size for the video

415Unsupported Media Type

video type unsupported

422Unprocessable Entity

video unreadable

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.