Video Upload

Initialize the resumable replacement of a video

POST
https://peertube2.cpy.re/api/v1/videos/{id}/source/replace-resumable

PeerTube >= 6.0 Uses a resumable protocol to initialize the replacement of a video

Body

application/json
filenamestring<filename>

Video filename including extension

Example
what_is_peertube.mp4

Parameters

idid | UUIDv4 | shortUUIDrequiredpath

The object id, uuid or short uuid

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.