swagger: '2.0'
info:
title: PeerTube
- version: 0.0.15-alpha
+ version: 1.0.0-beta
description: Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.
+host: peertube.example.com
+securityDefinitions:
+ OAuth2:
+ description: 'In the header: *Authorization: Bearer mytoken*'
+ type: oauth2
+ flow: password
+ # Not implemented yet
+ # authorizationUrl: https://example.com/oauth/authorize
+ tokenUrl: https://peertube.example.com/api/v1/users/token
+basePath: '/api/v1'
+schemes:
+ - https
paths:
- '/accounts/{id}':
+ '/accounts/{name}':
get:
tags:
- Accounts
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The id of the account'
+ - $ref: "accounts.yaml#/parameters/name"
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/Account'
+ '/accounts/{name}/videos':
+ get:
+ tags:
+ - Accounts
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ parameters:
+ - $ref: "accounts.yaml#/parameters/name"
+ responses:
+ '200':
+ description: successful operation
+ schema:
+ $ref: '#/definitions/Video'
/accounts:
get:
tags:
'200':
description: successful operation
schema:
- $ref: '#/definitions/ServerConfig'
+ $ref: '#/definitions/ServerConfig'
+ /feeds/videos.{format}:
+ get:
+ tags:
+ - Feeds
+ produces:
+ - application/atom+xml
+ - application/rss+xml
+ - application/json
+ parameters:
+ - name: format
+ in: path
+ required: true
+ type: string
+ enum: [ 'xml', 'atom', 'json']
+ default: 'xml'
+ description: 'The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and json to JSON FEED 1.0'
+ - name: accountId
+ in: query
+ required: false
+ type: number
+ description: 'The id of the local account to filter to (beware, users IDs and not actors IDs which will return empty feeds'
+ - name: accountName
+ in: query
+ required: false
+ type: string
+ description: 'The name of the local account to filter to'
+ responses:
+ '200':
+ description: successful operation
/jobs:
get:
+ security:
+ - OAuth2: [ ]
tags:
- Job
consumes:
- application/json
produces:
- application/json
+ parameters:
+ - name: state
+ in: path
+ required: true
+ type: string
+ description: 'The state of the job'
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
schema:
type: array
items:
- $ref: '#/definitions/Job'
+ $ref: '#/definitions/Job'
'/server/following/{host}':
delete:
+ security:
+ - OAuth2: [ ]
tags:
- ServerFollowing
consumes:
- application/json
produces:
- application/json
+ parameters:
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
- application/json
produces:
- application/json
+ parameters:
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
items:
$ref: '#/definitions/Follow'
post:
+ security:
+ - OAuth2: [ ]
tags:
- ServerFollowing
consumes:
$ref: '#/definitions/Follow'
responses:
'204':
- description: successful operation
+ $ref: "commons.yaml#/responses/emptySuccess"
/users:
post:
+ security:
+ - OAuth2: [ ]
tags:
- User
consumes:
- in: body
name: body
required: true
+ description: 'User to create'
schema:
$ref: '#/definitions/AddUser'
responses:
schema:
$ref: '#/definitions/AddUserResponse'
get:
+ security:
+ - OAuth2: [ ]
tags:
- User
consumes:
- application/json
produces:
- application/json
+ parameters:
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
$ref: '#/definitions/User'
'/users/{id}':
delete:
+ security:
+ - OAuth2: [ ]
tags:
- User
consumes:
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The user id '
+ - $ref: "users.yaml#/parameters/id"
responses:
'204':
- description: successful operation
+ $ref: "commons.yaml#/responses/emptySuccess"
get:
+ security:
+ - OAuth2: [ ]
tags:
- User
consumes:
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The user id '
+ - $ref: "users.yaml#/parameters/id"
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/User'
put:
+ security:
+ - OAuth2: [ ]
tags:
- User
consumes:
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The user id '
+ - $ref: "users.yaml#/parameters/id"
- in: body
name: body
required: true
$ref: '#/definitions/UpdateUser'
responses:
'204':
- description: successful operation
+ $ref: "commons.yaml#/responses/emptySuccess"
/users/me:
get:
+ security:
+ - OAuth2: [ ]
tags:
- User
consumes:
items:
$ref: '#/definitions/User'
put:
+ security:
+ - OAuth2: [ ]
tags:
- User
consumes:
$ref: '#/definitions/UpdateMe'
responses:
'204':
- description: successful operation
+ $ref: "commons.yaml#/responses/emptySuccess"
/users/me/video-quota-used:
get:
+ security:
+ - OAuth2: [ ]
tags:
- User
consumes:
type: number
'/users/me/videos/{videoId}/rating':
get:
+ security:
+ - OAuth2: [ ]
tags:
- User
consumes:
$ref: '#/definitions/GetMeVideoRating'
/users/me/videos:
get:
+ security:
+ - OAuth2: [ ]
tags:
- User
consumes:
- application/json
produces:
- application/json
+ parameters:
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
$ref: '#/definitions/RegisterUser'
responses:
'204':
- description: successful operation
+ $ref: "commons.yaml#/responses/emptySuccess"
/users/me/avatar/pick:
post:
+ security:
+ - OAuth2: [ ]
tags:
- User
consumes:
- application/json
produces:
- application/json
+ parameters:
+ - name: category
+ in: query
+ required: false
+ type: number
+ description: category id of the video
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
type: array
items:
type: string
- /videos/search:
- get:
- tags:
- - Video
- consumes:
- - application/json
- produces:
- - application/json
- responses:
- '200':
- description: successful operation
- schema:
- type: array
- items:
- $ref: '#/definitions/Video'
"/videos/{id}":
put:
+ security:
+ - OAuth2: [ ]
tags:
- Video
consumes:
- - application/json
+ - multipart/form-data
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "videos.yaml#/parameters/id"
+ - $ref: "videos.yaml#/parameters/thumbnailfile"
+ - $ref: "videos.yaml#/parameters/previewfile"
+ - $ref: "videos.yaml#/parameters/category"
+ - $ref: "videos.yaml#/parameters/licence"
+ - $ref: "videos.yaml#/parameters/language"
+ - $ref: "videos.yaml#/parameters/description"
+ - $ref: "videos.yaml#/parameters/waitTranscoding"
+ - $ref: "videos.yaml#/parameters/support"
+ - $ref: "videos.yaml#/parameters/nsfw"
+ - $ref: "videos.yaml#/parameters/name"
+ - $ref: "videos.yaml#/parameters/tags"
+ - $ref: "videos.yaml#/parameters/commentsEnabled"
+ - $ref: "videos.yaml#/parameters/privacy"
+ - $ref: "videos.yaml#/parameters/scheduleUpdate"
responses:
'200':
description: successful operation
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "videos.yaml#/parameters/id"
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/Video'
delete:
+ security:
+ - OAuth2: [ ]
tags:
- Video
consumes:
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "videos.yaml#/parameters/id"
responses:
'204':
- description: successful operation
+ $ref: "commons.yaml#/responses/emptySuccess"
"/videos/{id}/description":
get:
tags:
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "videos.yaml#/parameters/id"
responses:
'200':
description: successful operation
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "videos.yaml#/parameters/id"
responses:
'204':
- description: successful operation
+ $ref: "commons.yaml#/responses/emptySuccess"
/videos/upload:
post:
+ security:
+ - OAuth2: [ ]
tags:
- Video
consumes:
produces:
- application/json
parameters:
- - in: formData
- name: videofile
+ - name: videofile
+ in: formData
type: file
- description: The file to upload.
+ required: true
+ description: 'Video file'
+ - name: channelId
+ in: formData
+ required: true
+ type: number
+ description: 'Channel id that will contain this video'
+ - $ref: "videos.yaml#/parameters/thumbnailfile"
+ - $ref: "videos.yaml#/parameters/previewfile"
+ - $ref: "videos.yaml#/parameters/category"
+ - $ref: "videos.yaml#/parameters/licence"
+ - $ref: "videos.yaml#/parameters/language"
+ - $ref: "videos.yaml#/parameters/description"
+ - $ref: "videos.yaml#/parameters/waitTranscoding"
+ - $ref: "videos.yaml#/parameters/support"
+ - $ref: "videos.yaml#/parameters/nsfw"
+ - $ref: "videos.yaml#/parameters/name"
+ - $ref: "videos.yaml#/parameters/tags"
+ - $ref: "videos.yaml#/parameters/commentsEnabled"
+ - $ref: "videos.yaml#/parameters/privacy"
+ - $ref: "videos.yaml#/parameters/scheduleUpdate"
responses:
'200':
description: successful operation
$ref: '#/definitions/VideoUploadResponse'
/videos/abuse:
get:
+ security:
+ - OAuth2: [ ]
tags:
- VideoAbuse
consumes:
- application/json
produces:
- application/json
+ parameters:
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
$ref: '#/definitions/VideoAbuse'
"/videos/{id}/abuse":
post:
+ security:
+ - OAuth2: [ ]
tags:
- VideoAbuse
consumes:
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "videos.yaml#/parameters/id"
responses:
'204':
- description: successful operation
- "/videos/{videoId}/blacklist":
+ $ref: "commons.yaml#/responses/emptySuccess"
+ "/videos/{id}/blacklist":
post:
+ security:
+ - OAuth2: [ ]
tags:
- VideoBlacklist
consumes:
produces:
- application/json
parameters:
- - name: videoId
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "videos.yaml#/parameters/id"
responses:
'204':
- description: successful operation
+ $ref: "commons.yaml#/responses/emptySuccess"
delete:
+ security:
+ - OAuth2: [ ]
tags:
- VideoBlacklist
consumes:
produces:
- application/json
parameters:
- - name: videoId
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "videos.yaml#/parameters/id"
responses:
'204':
- description: successful operation
+ $ref: "commons.yaml#/responses/emptySuccess"
/videos/blacklist:
get:
+ security:
+ - OAuth2: [ ]
tags:
- VideoBlacklist
consumes:
- application/json
produces:
- application/json
+ parameters:
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
type: array
items:
$ref: '#/definitions/VideoBlacklist'
- /videos/channels:
+ /video-channels:
get:
tags:
- VideoChannel
- application/json
produces:
- application/json
+ parameters:
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
items:
$ref: '#/definitions/VideoChannel'
post:
+ security:
+ - OAuth2: [ ]
tags:
- VideoChannel
consumes:
$ref: '#/definitions/VideoChannelInput'
responses:
'204':
- description: successful operation
- "/videos/channels/{id}":
+ $ref: "commons.yaml#/responses/emptySuccess"
+ "/video-channels/{id}":
get:
tags:
- VideoChannel
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "video-channels.yaml#/parameters/id"
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/VideoChannel'
put:
+ security:
+ - OAuth2: [ ]
tags:
- VideoChannel
consumes:
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "video-channels.yaml#/parameters/id"
- in: body
name: body
schema:
$ref: '#/definitions/VideoChannelInput'
responses:
'204':
- description: successful operation
+ $ref: "commons.yaml#/responses/emptySuccess"
delete:
+ security:
+ - OAuth2: [ ]
tags:
- VideoChannel
consumes:
produces:
- application/json
parameters:
- - name: id
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "video-channels.yaml#/parameters/id"
responses:
'204':
+ $ref: "commons.yaml#/responses/emptySuccess"
+ "/video-channels/{id}/videos":
+ get:
+ tags:
+ - VideoChannel
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ parameters:
+ - $ref: "video-channels.yaml#/parameters/id"
+ responses:
+ '200':
description: successful operation
- /videos/accounts/{accountId}/channels:
+ schema:
+ $ref: '#/definitions/Video'
+ /accounts/{name}/video-channels:
get:
tags:
- VideoChannel
produces:
- application/json
parameters:
- - name: accountId
- in: path
- required: true
- type: string
- description: 'The account id '
+ - $ref: "accounts.yaml#/parameters/name"
responses:
'200':
description: successful operation
type: array
items:
$ref: '#/definitions/VideoChannel'
- "/videos/{videoId}/comment-threads":
+ "/videos/{id}/comment-threads":
get:
tags:
- VideoComment
produces:
- application/json
parameters:
- - name: videoId
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "videos.yaml#/parameters/id"
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/CommentThreadResponse'
post:
+ security:
+ - OAuth2: [ ]
tags:
- VideoComment
consumes:
produces:
- application/json
parameters:
- - name: videoId
- in: path
- required: true
- type: string
- description: 'The video id '
+ - $ref: "videos.yaml#/parameters/id"
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/CommentThreadPostResponse'
- "/videos/{videoId}/comment-threads/{threadId}":
+ "/videos/{id}/comment-threads/{threadId}":
get:
tags:
- VideoComment
produces:
- application/json
parameters:
- - name: videoId
- in: path
- required: true
- type: string
- description: 'The video id '
- - name: threadId
- in: path
- required: true
- type: string
- description: 'The thread id '
+ - $ref: "videos.yaml#/parameters/id"
+ - $ref: "video-comments.yaml#/parameters/threadId"
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/VideoCommentThreadTree'
- "/videos/{videoId}/comments/{commentId}":
+ "/videos/{id}/comments/{commentId}":
post:
+ security:
+ - OAuth2: [ ]
tags:
- VideoComment
consumes:
produces:
- application/json
parameters:
- - name: videoId
- in: path
- required: true
- type: string
- description: 'The video id '
- - name: commentId
- in: path
- required: true
- type: string
- description: 'The comment id '
+ - $ref: "videos.yaml#/parameters/id"
+ - $ref: "video-comments.yaml#/parameters/commentId"
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/CommentThreadPostResponse'
delete:
+ security:
+ - OAuth2: [ ]
tags:
- VideoComment
consumes:
produces:
- application/json
parameters:
- - name: videoId
- in: path
- required: true
- type: string
- description: 'The video id '
- - name: commentId
- in: path
- required: true
- type: string
- description: 'The comment id '
+ - $ref: "videos.yaml#/parameters/id"
+ - $ref: "video-comments.yaml#/parameters/commentId"
responses:
'204':
- description: successful operation
+ $ref: "commons.yaml#/responses/emptySuccess"
"/videos/{id}/rate":
put:
+ security:
+ - OAuth2: [ ]
tags:
- VideoRate
consumes:
produces:
- application/json
parameters:
- - name: id
- in: path
+ - $ref: "videos.yaml#/parameters/id"
+ responses:
+ '204':
+ $ref: "commons.yaml#/responses/emptySuccess"
+ /search/videos:
+ get:
+ tags:
+ - Search
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ parameters:
+ - $ref: "commons.yaml#/parameters/start"
+ - $ref: "commons.yaml#/parameters/count"
+ - $ref: "commons.yaml#/parameters/sort"
+ - name: search
+ in: query
required: true
type: string
- description: 'The video id '
+ description: 'String to search'
responses:
- '204':
+ '200':
description: successful operation
+ schema:
+ type: array
+ items:
+ $ref: '#/definitions/Video'
definitions:
+ VideoConstantNumber:
+ properties:
+ id:
+ type: number
+ label:
+ type: string
+ VideoConstantString:
+ properties:
+ id:
+ type: string
+ label:
+ type: string
+ VideoPrivacy:
+ type: string
+ enum: [Public, Unlisted, Private]
Video:
properties:
id:
type: number
uuid:
type: string
- accountName:
- type: string
createdAt:
type: string
- updatedAt:
+ publishedAt:
type: string
- categoryLabel:
+ updatedAt:
type: string
category:
- type: number
- licenceLabel:
- type: string
+ $ref: "#/definitions/VideoConstantNumber"
licence:
- type: number
- languageLabel:
- type: string
+ $ref: "#/definitions/VideoConstantNumber"
language:
- type: number
+ $ref: "#/definitions/VideoConstantString"
+ privacy:
+ $ref: "#/definitions/VideoPrivacy"
description:
type: string
duration:
type: boolean
name:
type: string
- serverHost:
- type: string
thumbnailPath:
type: string
previewPath:
type: number
nsfw:
type: boolean
+ account:
+ type: object
+ properties:
+ name:
+ type: string
+ displayName:
+ type: string
+ url:
+ type: string
+ host:
+ type: string
+ avatar:
+ $ref: "#/definitions/Avatar"
VideoAbuse:
properties:
id:
type: number
reason:
type: string
- reporterUsername:
- type: string
- reporterServerHost:
- type: string
- videoId:
- type: number
- videoUUID:
- type: string
- videoName:
- type: string
+ reporterAccount:
+ $ref: "#/definitions/Account"
+ video:
+ type: object
+ properties:
+ id:
+ type: number
+ name:
+ type: string
+ uuid:
+ type: string
+ url:
+ type: string
createdAt:
type: string
VideoBlacklist:
type: string
isLocal:
type: boolean
- owner:
+ ownerAccount:
type: object
- properties:
- name:
- type: string
- uuid:
+ properties:
+ id:
+ type: number
+ uuid:
type: string
- videos:
- type: array
- items:
- $ref: "#/definitions/Video"
VideoComment:
properties:
id:
type: boolean
role:
type: string
- enum: [User, Moderator, Administrator]
+ enum: [User, Moderator, Administrator]
videoQuota:
type: number
createdAt:
$ref: "#/definitions/VideoChannel"
ServerConfig:
properties:
- signup:
+ signup:
type: object
properties:
allowed:
properties:
max:
type: number
- extensions:
+ extensions:
type: array
items:
type: string
properties:
file:
type: object
- properties:
- extensions:
+ properties:
+ extensions:
type: array
items:
type: string
updatedAt:
type: string
-#Api responses
+# Api responses
AddUserResponse:
properties:
id:
type: string
VideoUploadResponse:
properties:
- id:
- type: number
- uuid:
- type: string
+ video:
+ type: object
+ properties:
+ id:
+ type: number
+ uuid:
+ type: string
CommentThreadResponse:
properties:
total:
comment:
$ref: "#/definitions/VideoComment"
-#request bodies
+# Request bodies
AddUser:
properties:
username:
name:
type: string
description:
- type: string
+ type: string
\ No newline at end of file