+ - Video
+ - Video Upload
+ parameters:
+ - name: upload_id
+ in: path
+ required: true
+ description: |
+ Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is
+ not valid anymore and you need to initialize a new upload.
+ schema:
+ type: string
+ - name: Content-Range
+ in: header
+ schema:
+ type: string
+ example: bytes 0-262143/2469036
+ required: true
+ description: |
+ Specifies 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.
+ - name: Content-Length
+ in: header
+ schema:
+ type: number
+ example: 262144
+ required: true
+ description: |
+ Size of the chunk that the request is sending.
+
+ The chunk size __must be a multiple of 256 KB__, and unlike [Google Resumable](https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol)
+ doesn't mandate for chunks to have the same size throughout the upload sequence.
+
+ 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.
+ requestBody:
+ content:
+ application/octet-stream:
+ schema:
+ type: string
+ format: binary
+ responses:
+ '200':
+ description: last chunk received
+ headers:
+ Content-Length:
+ schema:
+ type: number
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoUploadResponse'
+ '308':
+ description: resume incomplete
+ headers:
+ Range:
+ schema:
+ type: string
+ example: bytes=0-262143
+ Content-Length:
+ schema:
+ type: number
+ example: 0
+ '403':
+ description: video didn't pass upload filter
+ '413':
+ description: video file too large, due to quota or max body size limit set by the reverse-proxy
+ '422':
+ description: video unreadable
+ delete:
+ summary: Cancel the resumable upload of a video, deleting any data uploaded so far
+ description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the upload of a video
+ operationId: uploadResumableCancel
+ security:
+ - OAuth2: []
+ tags:
+ - Video
+ - Video Upload
+ parameters:
+ - name: upload_id
+ in: path
+ required: true
+ description: |
+ Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is
+ not valid anymore and the upload session has already been deleted with its data ;-)
+ schema:
+ type: string
+ - name: Content-Length
+ in: header
+ required: true
+ schema:
+ type: number
+ example: 0
+ responses:
+ '204':
+ description: upload cancelled
+ headers:
+ Content-Length:
+ schema:
+ type: number
+ example: 0
+ /videos/imports:
+ post:
+ summary: Import a video
+ description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
+ operationId: importVideo
+ security:
+ - OAuth2: []
+ tags:
+ - Video
+ - Video Upload
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/VideoCreateImport'
+ encoding:
+ torrentfile:
+ contentType: application/x-bittorrent
+ thumbnailfile:
+ contentType: image/jpeg
+ previewfile:
+ contentType: image/jpeg
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoUploadResponse'
+ '400':
+ description: '`magnetUri` or `targetUrl` or a torrent file missing'
+ '403':
+ description: video didn't pass pre-import filter
+ '409':
+ description: HTTP or Torrent/magnetURI import not enabled
+
+ /videos/live:
+ post:
+ summary: Create a live
+ operationId: createLive
+ security:
+ - OAuth2: []
+ tags:
+ - Live Videos