+ description: file already exists, send a [`resume`](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) request instead
+ '201':
+ description: created
+ headers:
+ Location:
+ schema:
+ type: string
+ format: url
+ example: /api/v1/videos/upload-resumable?upload_id=471e97554f21dec3b8bb5d4602939c51
+ Content-Length:
+ schema:
+ type: number
+ example: 0
+ '400':
+ description: invalid file field, schedule date or parameter
+ '413':
+ description: video file too large, due to quota, absolute max file size or concurrent partial upload limit
+ '415':
+ description: video type unsupported
+ put:
+ summary: Send chunk for the resumable upload of a video
+ description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to continue, pause or resume the upload of a video
+ 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 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
+ 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)
+ security:
+ - OAuth2: []
+ tags:
+ - Video
+ - Video Upload
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ torrentfile:
+ description: Torrent File
+ type: string
+ format: binary
+ targetUrl:
+ description: HTTP target URL
+ type: string
+ magnetUri:
+ description: Magnet URI
+ type: string
+ channelId:
+ description: Channel id that will contain this video
+ type: integer
+ thumbnailfile:
+ description: Video thumbnail file
+ type: string
+ format: binary
+ previewfile:
+ description: Video preview file
+ type: string
+ format: binary
+ privacy:
+ $ref: '#/components/schemas/VideoPrivacySet'
+ category:
+ description: Video category
+ type: integer
+ example: 4
+ licence:
+ description: Video licence
+ type: integer
+ example: 2
+ language:
+ description: Video language
+ type: string
+ description:
+ description: Video description
+ type: string
+ waitTranscoding:
+ description: Whether or not we wait transcoding before publish the video
+ type: boolean
+ support:
+ description: A text tell the audience how to support the video creator
+ example: Please support my work on <insert crowdfunding plateform>! <3
+ type: string
+ nsfw:
+ description: Whether or not this video contains sensitive content
+ type: boolean
+ name:
+ description: Video name
+ type: string
+ minLength: 3
+ maxLength: 120
+ tags:
+ description: Video tags (maximum 5 tags each between 2 and 30 characters)
+ type: array
+ minItems: 1
+ maxItems: 5
+ items:
+ type: string
+ minLength: 2
+ maxLength: 30
+ commentsEnabled:
+ description: Enable or disable comments for this video
+ type: boolean
+ downloadEnabled:
+ description: Enable or disable downloading for this video
+ type: boolean
+ scheduleUpdate:
+ $ref: '#/components/schemas/VideoScheduledUpdate'
+ required:
+ - channelId
+ - name
+ 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
+ security:
+ - OAuth2: []
+ tags:
+ - Live Videos
+ - Video
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoUploadResponse'
+ '403':
+ description: Live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ channelId:
+ description: Channel id that will contain this live video
+ type: integer
+ saveReplay:
+ type: boolean
+ permanentLive:
+ description: User can stream multiple times in a permanent live
+ type: boolean
+ thumbnailfile:
+ description: Live video/replay thumbnail file
+ type: string
+ format: binary
+ previewfile:
+ description: Live video/replay preview file
+ type: string
+ format: binary
+ privacy:
+ $ref: '#/components/schemas/VideoPrivacySet'
+ category:
+ description: Live video/replay category
+ type: string
+ licence:
+ description: Live video/replay licence
+ type: string
+ language:
+ description: Live video/replay language
+ type: string
+ description:
+ description: Live video/replay description
+ type: string
+ support:
+ description: A text tell the audience how to support the creator
+ example: Please support my work on <insert crowdfunding plateform>! <3
+ type: string
+ nsfw:
+ description: Whether or not this live video/replay contains sensitive content
+ type: boolean
+ name:
+ description: Live video/replay name
+ type: string
+ minLength: 3
+ maxLength: 120
+ tags:
+ description: Live video/replay tags (maximum 5 tags each between 2 and 30 characters)
+ type: array
+ minItems: 1
+ maxItems: 5
+ items:
+ type: string
+ minLength: 2
+ maxLength: 30
+ commentsEnabled:
+ description: Enable or disable comments for this live video/replay
+ type: boolean
+ downloadEnabled:
+ description: Enable or disable downloading for the replay of this live
+ type: boolean
+ required:
+ - channelId
+ - name
+ encoding:
+ thumbnailfile:
+ contentType: image/jpeg
+ previewfile:
+ contentType: image/jpeg
+
+ /videos/live/{id}:
+ get:
+ summary: Get information about a live
+ security:
+ - OAuth2: []
+ tags:
+ - Live Videos
+ - Video
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/LiveVideoResponse'
+ put:
+ summary: Update information about a live
+ security:
+ - OAuth2: []
+ tags:
+ - Live Videos
+ - Video
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/LiveVideoUpdate'
+ responses:
+ '204':
+ description: Successful operation
+ '400':
+ description: Bad parameters or trying to update a live that has already started
+ '403':
+ description: Trying to save replay of the live but saving replay is not enabled on the instance
+
+ /users/me/abuses:
+ get:
+ summary: List my abuses
+ security:
+ - OAuth2: []
+ tags:
+ - Abuses
+ - My User
+ parameters:
+ - name: id
+ in: query
+ description: only list the report with this id
+ schema:
+ type: integer
+ - name: state
+ in: query
+ schema:
+ $ref: '#/components/schemas/AbuseStateSet'
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/abusesSort'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Abuse'
+
+ /abuses:
+ get:
+ summary: List abuses
+ security:
+ - OAuth2:
+ - admin
+ - moderator
+ tags:
+ - Abuses
+ parameters:
+ - name: id
+ in: query
+ description: only list the report with this id
+ schema:
+ type: integer
+ - name: predefinedReason
+ in: query
+ description: predefined reason the listed reports should contain
+ schema:
+ $ref: '#/components/schemas/PredefinedAbuseReasons'
+ - name: search
+ in: query
+ description: plain search that will match with video titles, reporter names and more
+ schema:
+ type: string
+ - name: state
+ in: query
+ schema:
+ $ref: '#/components/schemas/AbuseStateSet'
+ - name: searchReporter
+ in: query
+ description: only list reports of a specific reporter
+ schema:
+ type: string
+ - name: searchReportee
+ description: only list reports of a specific reportee
+ in: query
+ schema:
+ type: string
+ - name: searchVideo
+ in: query
+ description: only list reports of a specific video
+ schema:
+ type: string
+ - name: searchVideoChannel
+ in: query
+ description: only list reports of a specific video channel
+ schema:
+ type: string
+ - name: videoIs
+ in: query
+ description: only list blacklisted or deleted videos
+ schema:
+ type: string
+ enum:
+ - 'deleted'
+ - 'blacklisted'
+ - name: filter
+ in: query
+ description: only list account, comment or video reports
+ schema:
+ type: string
+ enum:
+ - 'video'
+ - 'comment'
+ - 'account'
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/abusesSort'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Abuse'
+
+ post:
+ summary: Report an abuse
+ security:
+ - OAuth2: []
+ tags:
+ - Abuses
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ reason:
+ description: Reason why the user reports this video
+ type: string
+ minLength: 2
+ maxLength: 3000
+ predefinedReasons:
+ $ref: '#/components/schemas/PredefinedAbuseReasons'
+ video:
+ type: object
+ properties:
+ id:
+ description: Video id to report
+ type: number
+ startAt:
+ type: integer
+ description: Timestamp in the video that marks the beginning of the report
+ minimum: 0
+ endAt:
+ type: integer
+ description: Timestamp in the video that marks the ending of the report
+ minimum: 0
+ comment:
+ type: object
+ properties:
+ id:
+ description: Comment id to report
+ type: number
+ account:
+ type: object
+ properties:
+ id:
+ description: Account id to report
+ type: number
+ required:
+ - reason
+ responses:
+ '204':
+ description: successful operation
+ '400':
+ description: incorrect request parameters
+ '/abuses/{abuseId}':
+ put:
+ summary: Update an abuse
+ security:
+ - OAuth2:
+ - admin
+ - moderator
+ tags:
+ - Abuses
+ parameters:
+ - $ref: '#/components/parameters/abuseId'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ state:
+ $ref: '#/components/schemas/AbuseStateSet'
+ moderationComment:
+ type: string
+ description: Update the report comment visible only to the moderation team
+ minLength: 2
+ maxLength: 3000
+ responses:
+ '204':
+ description: successful operation
+ '404':
+ description: abuse not found
+ delete:
+ tags:
+ - Abuses
+ summary: Delete an abuse
+ security:
+ - OAuth2:
+ - admin
+ - moderator
+ parameters:
+ - $ref: '#/components/parameters/abuseId'
+ responses:
+ '204':
+ description: successful operation
+ '404':
+ description: block not found
+ '/abuses/{abuseId}/messages':
+ get:
+ summary: List messages of an abuse
+ security:
+ - OAuth2: []
+ tags:
+ - Abuses
+ parameters:
+ - $ref: '#/components/parameters/abuseId'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/AbuseMessage'
+
+ post:
+ summary: Add message to an abuse
+ security:
+ - OAuth2: []
+ tags:
+ - Abuses
+ parameters:
+ - $ref: '#/components/parameters/abuseId'
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ message:
+ description: Message to send
+ type: string
+ minLength: 2
+ maxLength: 3000
+ required:
+ - message
+ responses:
+ '200':
+ description: successful operation
+ '400':
+ description: incorrect request parameters
+ '/abuses/{abuseId}/messages/{abuseMessageId}':
+ delete:
+ summary: Delete an abuse message
+ security:
+ - OAuth2: []
+ tags:
+ - Abuses
+ parameters:
+ - $ref: '#/components/parameters/abuseId'
+ - $ref: '#/components/parameters/abuseMessageId'
+ responses:
+ '204':
+ description: successful operation
+
+ '/videos/{id}/blacklist':
+ post:
+ summary: Block a video
+ security:
+ - OAuth2:
+ - admin
+ - moderator
+ tags:
+ - Video Blocks
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ responses:
+ '204':
+ description: successful operation
+ delete:
+ summary: Unblock a video by its id
+ security:
+ - OAuth2:
+ - admin
+ - moderator
+ tags:
+ - Video Blocks
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ responses:
+ '204':
+ description: successful operation
+ '404':
+ description: block not found
+ /videos/blacklist:
+ get:
+ tags:
+ - Video Blocks
+ summary: List video blocks
+ security:
+ - OAuth2:
+ - admin
+ - moderator
+ parameters:
+ - name: type
+ in: query
+ description: >
+ list only blocks that match this type:
+
+ - `1`: manual block
+
+ - `2`: automatic block that needs review
+ schema:
+ type: integer
+ enum:
+ - 1
+ - 2
+ - name: search
+ in: query
+ description: plain search that will match with video titles, and more
+ schema:
+ type: string
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/blacklistsSort'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ total:
+ type: integer
+ example: 1
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/VideoBlacklist'
+ /videos/{id}/captions:
+ get:
+ summary: List captions of a video
+ tags:
+ - Video Captions
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ total:
+ type: integer
+ example: 1
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/VideoCaption'
+ /videos/{id}/captions/{captionLanguage}:
+ put:
+ summary: Add or replace a video caption
+ security:
+ - OAuth2:
+ - user
+ tags:
+ - Video Captions
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ - $ref: '#/components/parameters/captionLanguage'
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ captionfile:
+ description: The file to upload.
+ type: string
+ format: binary
+ encoding:
+ captionfile:
+ contentType: text/vtt, application/x-subrip, text/plain
+ responses:
+ '204':
+ description: successful operation
+ '404':
+ description: video or language not found
+ delete:
+ summary: Delete a video caption
+ security:
+ - OAuth2:
+ - user
+ tags:
+ - Video Captions
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ - $ref: '#/components/parameters/captionLanguage'
+ responses:
+ '204':
+ description: successful operation
+ '404':
+ description: video or language or caption for that language not found
+ /video-channels:
+ get:
+ summary: List video channels
+ tags:
+ - Video Channels
+ parameters:
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/sort'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ total:
+ type: integer
+ example: 1
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/VideoChannel'
+ post:
+ summary: Create a video channel
+ security:
+ - OAuth2: []
+ tags:
+ - Video Channels
+ responses:
+ '204':
+ description: successful operation
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoChannelCreate'
+ '/video-channels/{channelHandle}':
+ get:
+ summary: Get a video channel
+ tags:
+ - Video Channels
+ parameters:
+ - $ref: '#/components/parameters/channelHandle'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoChannel'
+ put:
+ summary: Update a video channel
+ security:
+ - OAuth2: []
+ tags:
+ - Video Channels
+ parameters:
+ - $ref: '#/components/parameters/channelHandle'
+ responses:
+ '204':
+ description: successful operation
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoChannelUpdate'
+ delete:
+ summary: Delete a video channel
+ security:
+ - OAuth2: []
+ tags:
+ - Video Channels
+ parameters:
+ - $ref: '#/components/parameters/channelHandle'
+ responses:
+ '204':
+ description: successful operation
+ '/video-channels/{channelHandle}/videos':
+ get:
+ summary: List videos of a video channel
+ tags:
+ - Video
+ - Video Channels
+ parameters:
+ - $ref: '#/components/parameters/channelHandle'
+ - $ref: '#/components/parameters/categoryOneOf'
+ - $ref: '#/components/parameters/isLive'
+ - $ref: '#/components/parameters/tagsOneOf'
+ - $ref: '#/components/parameters/tagsAllOf'
+ - $ref: '#/components/parameters/licenceOneOf'
+ - $ref: '#/components/parameters/languageOneOf'
+ - $ref: '#/components/parameters/nsfw'
+ - $ref: '#/components/parameters/filter'
+ - $ref: '#/components/parameters/skipCount'
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/videosSort'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoListResponse'
+ '/video-channels/{channelHandle}/avatar/pick':
+ post:
+ summary: Update channel avatar
+ security:
+ - OAuth2: []
+ tags:
+ - Video Channels
+ parameters:
+ - $ref: '#/components/parameters/channelHandle'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ avatar:
+ $ref: '#/components/schemas/ActorImage'
+ '413':
+ description: image file too large
+ headers:
+ X-File-Maximum-Size:
+ schema:
+ type: string
+ format: Nginx size
+ description: Maximum file size for the avatar
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ avatarfile:
+ description: The file to upload.
+ type: string
+ format: binary
+ encoding:
+ avatarfile:
+ contentType: image/png, image/jpeg
+ '/video-channels/{channelHandle}/avatar':
+ delete:
+ summary: Delete channel avatar
+ security:
+ - OAuth2: []
+ tags:
+ - Video Channels
+ parameters:
+ - $ref: '#/components/parameters/channelHandle'
+ responses:
+ '204':
+ description: successful operation
+
+
+ '/video-channels/{channelHandle}/banner/pick':
+ post:
+ summary: Update channel banner
+ security:
+ - OAuth2: []
+ tags:
+ - Video Channels
+ parameters:
+ - $ref: '#/components/parameters/channelHandle'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ banner:
+ $ref: '#/components/schemas/ActorImage'
+ '413':
+ description: image file too large
+ headers:
+ X-File-Maximum-Size:
+ schema:
+ type: string
+ format: Nginx size
+ description: Maximum file size for the banner
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ bannerfile:
+ description: The file to upload.
+ type: string
+ format: binary
+ encoding:
+ bannerfile:
+ contentType: image/png, image/jpeg
+ '/video-channels/{channelHandle}/banner':
+ delete:
+ summary: Delete channel banner
+ security:
+ - OAuth2: []
+ tags:
+ - Video Channels
+ parameters:
+ - $ref: '#/components/parameters/channelHandle'
+ responses:
+ '204':
+ description: successful operation
+
+ /video-playlists/privacies:
+ get:
+ summary: List available playlist privacies
+ tags:
+ - Video Playlists
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ type: string
+ examples:
+ nightly:
+ externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies
+
+ /video-playlists:
+ get:
+ summary: List video playlists
+ tags:
+ - Video Playlists
+ parameters:
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/sort'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ total:
+ type: integer
+ example: 1
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/VideoPlaylist'
+ post:
+ summary: Create a video playlist
+ description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
+ security:
+ - OAuth2: []
+ tags:
+ - Video Playlists
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ videoPlaylist:
+ type: object
+ properties:
+ id:
+ type: integer
+ uuid:
+ $ref: '#/components/schemas/UUIDv4'
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ displayName:
+ description: Video playlist display name
+ type: string
+ minLength: 1
+ maxLength: 120
+ thumbnailfile:
+ description: Video playlist thumbnail file
+ type: string
+ format: binary
+ privacy:
+ $ref: '#/components/schemas/VideoPlaylistPrivacySet'
+ description:
+ description: Video playlist description
+ type: string
+ videoChannelId:
+ description: Video channel in which the playlist will be published
+ type: integer
+ required:
+ - displayName
+ encoding:
+ thumbnailfile:
+ contentType: image/jpeg
+
+ /video-playlists/{id}:
+ get:
+ summary: Get a video playlist
+ tags:
+ - Video Playlists
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoPlaylist'
+ put:
+ summary: Update a video playlist
+ description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
+ security:
+ - OAuth2: []
+ tags:
+ - Video Playlists
+ responses:
+ '204':
+ description: successful operation
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ displayName:
+ description: Video playlist display name
+ type: string
+ minLength: 1
+ maxLength: 120
+ thumbnailfile:
+ description: Video playlist thumbnail file
+ type: string
+ format: binary
+ privacy:
+ $ref: '#/components/schemas/VideoPlaylistPrivacySet'
+ description:
+ description: Video playlist description
+ type: string
+ videoChannelId:
+ description: Video channel in which the playlist will be published
+ type: integer
+ encoding:
+ thumbnailfile:
+ contentType: image/jpeg
+ delete:
+ summary: Delete a video playlist
+ security:
+ - OAuth2: []
+ tags:
+ - Video Playlists
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ responses:
+ '204':
+ description: successful operation
+
+ /video-playlists/{id}/videos:
+ get:
+ summary: 'List videos of a playlist'
+ tags:
+ - Videos
+ - Video Playlists
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoListResponse'
+ post:
+ summary: 'Add a video in a playlist'
+ security:
+ - OAuth2: []
+ tags:
+ - Videos
+ - Video Playlists
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ videoPlaylistElement:
+ type: object
+ properties:
+ id:
+ type: integer
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ videoId:
+ type: integer
+ description: 'Video to add in the playlist'
+ startTimestamp:
+ type: integer
+ description: 'Start the video at this specific timestamp (in seconds)'
+ stopTimestamp:
+ type: integer
+ description: 'Stop the video at this specific timestamp (in seconds)'
+ required:
+ - videoId
+
+ /video-playlists/{id}/videos/reorder:
+ post:
+ summary: 'Reorder a playlist'
+ security:
+ - OAuth2: []
+ tags:
+ - Video Playlists
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ responses:
+ '204':
+ description: successful operation
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ startPosition:
+ type: integer
+ description: 'Start position of the element to reorder'
+ minimum: 1
+ insertAfterPosition:
+ type: integer
+ description: 'New position for the block to reorder, to add the block before the first element'
+ minimum: 0
+ reorderLength:
+ type: integer
+ description: 'How many element from `startPosition` to reorder'
+ minimum: 1
+ required:
+ - startPosition
+ - insertAfterPosition
+
+ /video-playlists/{id}/videos/{playlistElementId}:
+ put:
+ summary: 'Update a playlist element'
+ security:
+ - OAuth2: []
+ tags:
+ - Video Playlists
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ - $ref: '#/components/parameters/playlistElementId'
+ responses:
+ '204':
+ description: successful operation
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ startTimestamp:
+ type: integer
+ description: 'Start the video at this specific timestamp (in seconds)'
+ stopTimestamp:
+ type: integer
+ description: 'Stop the video at this specific timestamp (in seconds)'
+ delete:
+ summary: 'Delete an element from a playlist'
+ security:
+ - OAuth2: []
+ tags:
+ - Video Playlists
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ - $ref: '#/components/parameters/playlistElementId'
+ responses:
+ '204':
+ description: successful operation
+
+ '/users/me/video-playlists/videos-exist':
+ get:
+ summary: 'Check video exists in my playlists'
+ security:
+ - OAuth2: []
+ tags:
+ - Video Playlists
+ parameters:
+ - name: videoIds
+ in: query
+ required: true
+ description: The video ids to check
+ schema:
+ type: array
+ items:
+ type: integer
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ videoId:
+ type: array
+ items:
+ type: object
+ properties:
+ playlistElementId:
+ type: integer
+ playlistId:
+ type: integer
+ startTimestamp:
+ type: integer
+ stopTimestamp:
+ type: integer
+
+ '/accounts/{name}/video-channels':
+ get:
+ summary: List video channels of an account
+ tags:
+ - Video Channels
+ - Accounts
+ parameters:
+ - $ref: '#/components/parameters/name'
+ - name: withStats
+ in: query
+ description: include view statistics for the last 30 days (only if authentified as the account user)
+ schema:
+ type: boolean
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/sort'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ properties:
+ total:
+ type: integer
+ example: 1
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/VideoChannel'
+ '/accounts/{name}/ratings':
+ get:
+ summary: List ratings of an account
+ security:
+ - OAuth2: []
+ tags:
+ - Accounts
+ parameters:
+ - $ref: '#/components/parameters/name'
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/sort'
+ - name: rating
+ in: query
+ required: false
+ description: Optionally filter which ratings to retrieve
+ schema:
+ type: string
+ enum:
+ - like
+ - dislike
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/VideoRating'
+ '/videos/{id}/comment-threads':
+ get:
+ summary: List threads of a video
+ tags:
+ - Video Comments
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/commentsSort'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CommentThreadResponse'
+ post:
+ summary: Create a thread
+ security:
+ - OAuth2: []
+ tags:
+ - Video Comments
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CommentThreadPostResponse'
+ '404':
+ description: video does not exist
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ text:
+ type: string
+ description: 'Text comment'
+ required:
+ - text
+
+ '/videos/{id}/comment-threads/{threadId}':
+ get:
+ summary: Get a thread
+ tags:
+ - Video Comments
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ - $ref: '#/components/parameters/threadId'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoCommentThreadTree'
+ '/videos/{id}/comments/{commentId}':
+ post:
+ summary: Reply to a thread of a video
+ security:
+ - OAuth2: []
+ tags:
+ - Video Comments
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ - $ref: '#/components/parameters/commentId'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CommentThreadPostResponse'
+ '404':
+ description: thread or video does not exist
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ text:
+ type: string
+ description: 'Text comment'
+ required:
+ - text
+
+ delete:
+ summary: Delete a comment or a reply
+ security:
+ - OAuth2: []
+ tags:
+ - Video Comments
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ - $ref: '#/components/parameters/commentId'
+ responses:
+ '204':
+ description: successful operation
+ '403':
+ description: cannot remove comment of another user
+ '404':
+ description: comment or video does not exist
+ '409':
+ description: comment is already deleted
+ '/videos/{id}/rate':
+ put:
+ summary: Like/dislike a video
+ security:
+ - OAuth2: []
+ tags:
+ - Video Rates
+ parameters:
+ - $ref: '#/components/parameters/idOrUUID'
+ responses:
+ '204':
+ description: successful operation
+ '404':
+ description: video does not exist
+ /search/videos:
+ get:
+ tags:
+ - Search
+ summary: Search videos
+ parameters:
+ - name: search
+ in: query
+ required: true
+ allowEmptyValue: false
+ description: >
+ String 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.
+ schema:
+ type: string
+ - $ref: '#/components/parameters/categoryOneOf'
+ - $ref: '#/components/parameters/isLive'
+ - $ref: '#/components/parameters/tagsOneOf'
+ - $ref: '#/components/parameters/tagsAllOf'
+ - $ref: '#/components/parameters/licenceOneOf'
+ - $ref: '#/components/parameters/languageOneOf'
+ - $ref: '#/components/parameters/nsfw'
+ - $ref: '#/components/parameters/filter'
+ - $ref: '#/components/parameters/skipCount'
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/searchTarget'
+ - $ref: '#/components/parameters/videosSearchSort'
+ - name: startDate
+ in: query
+ description: Get videos that are published after this date
+ schema:
+ type: string
+ format: date-time
+ - name: endDate
+ in: query
+ description: Get videos that are published before this date
+ schema:
+ type: string
+ format: date-time
+ - name: originallyPublishedStartDate
+ in: query
+ description: Get videos that are originally published after this date
+ schema:
+ type: string
+ format: date-time
+ - name: originallyPublishedEndDate
+ in: query
+ description: Get videos that are originally published before this date
+ schema:
+ type: string
+ format: date-time
+ - name: durationMin
+ in: query
+ description: Get videos that have this minimum duration
+ schema:
+ type: integer
+ - name: durationMax
+ in: query
+ description: Get videos that have this maximum duration
+ schema:
+ type: integer
+ callbacks:
+ 'searchTarget === search-index':
+ $ref: '#/components/callbacks/searchIndex'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoListResponse'
+ '500':
+ description: search index unavailable
+ /search/video-channels:
+ get:
+ tags:
+ - Search
+ summary: Search channels
+ parameters:
+ - name: search
+ in: query
+ required: true
+ description: >
+ String 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 channel information and interact with it.
+ schema:
+ type: string
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/searchTarget'
+ - $ref: '#/components/parameters/sort'
+ callbacks:
+ 'searchTarget === search-index':
+ $ref: '#/components/callbacks/searchIndex'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json: