From 2963c3432f3967675530162b1bf87b549cc124f5 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 13 Nov 2018 23:27:58 +0100 Subject: [PATCH] updated REST API documentation --- support/doc/api/html/index.html | 5524 +++++++++++++++++-------------- support/doc/api/openapi.yaml | 168 +- 2 files changed, 3146 insertions(+), 2546 deletions(-) diff --git a/support/doc/api/html/index.html b/support/doc/api/html/index.html index 0efc24f02..7e53ce675 100644 --- a/support/doc/api/html/index.html +++ b/support/doc/api/html/index.html @@ -25,13 +25,13 @@ Accounts @@ -39,7 +39,7 @@ Config @@ -47,7 +47,7 @@ Feeds @@ -55,7 +55,7 @@ Job @@ -63,95 +63,16 @@ ServerFollowing - -
- User - -
-
- Video -
@@ -159,78 +80,51 @@ VideoAbuse
- VideoBlacklist + Video -
-
- VideoChannel - -
-
- VideoComment - -
-
- VideoRate -
@@ -238,7 +132,116 @@ Search + +
+ VideoComment + +
+
+ VideoChannel + +
+
+ User + +
+
+ VideoBlacklist + +
+
+ VideoRate +
@@ -283,18 +286,27 @@
-

Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.

+

Introduction

+

The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. You can use your favorite HTTP/REST library for your programming language to use PeerTube. No official SDK is currently provided.

+

Authentication

+

When you sign up for an account, you are given the possibility to generate sessions, and authenticate using this session token. One session token can currently be used at a time.

API Endpoint
https://peertube.example.com/api/v1
+
Request Content-Types: + application/json +
+
Response Content-Types: + application/json; charset=utf-8 +
Schemes: https
Version: - 1.0.0-beta + 1.1.0-alpha.2
@@ -311,8 +323,15 @@

In the header: - Authorization: Bearer mytoken + Authorization: Bearer <token>

+

Authenticating via OAuth requires the following steps:

+
    +
  • Have an account with sufficient authorization levels
  • +
  • + Generate a Bearer Token
  • +
  • Make Authenticated Requests
  • +
@@ -333,11 +352,29 @@
https://peertube.example.com/api/v1/users/token
+
+
+
scopes
+
+
+ admin +

Admin scope

+ moderator +

Moderator scope

+ user +

User scope

+
+

Accounts

+
+
+

Using some features of PeerTube require authentication, for which Accounts provide different levels of permission as well as associated user information. Accounts also encompass remote accounts discovered across the federation.

+
+
@@ -348,11 +385,16 @@

- - GET - /accounts/{name} - + Get the account by name

+
+
+
+ GET + /accounts/{name} +
+
+
@@ -473,16 +515,23 @@

- - GET - /accounts/{name}/videos - + Get videos for an account, provided the name of that account

+
+
+
+ GET + /accounts/{name}/videos +
+
+
@@ -591,11 +640,16 @@

- - GET - /accounts - + Get all accounts

+
+
+
+ GET + /accounts +
+
+
@@ -632,7 +686,7 @@
Response Content-Types: - application/json + application/jsonhttps://peertube.cpy.re/api/v1
Response Example @@ -664,6 +718,11 @@

Config

+
+
+

Each server exposes public information regarding supported videos and options.

+
+
@@ -674,11 +733,16 @@

- - GET - /config - + Get the configuration of the server

+
+
+
+ GET + /config +
+
+
@@ -744,6 +808,11 @@

Feeds

+
+
+

Feeds of videos and feeds of comments allow to see updates and get them in an aggregator or script of your choice.

+
+
@@ -754,11 +823,16 @@

- - GET - /feeds/videos.{format} - + Get the feed of videos for the server, with optional filter by account name or id

+
+
+
+ GET + /feeds/videos.{format} +
+
+
@@ -836,6 +910,11 @@

Job

+
+
+

Jobs are long-running tasks enqueued and processed by the instance itself. No additional worker registration is currently available.

+
+
@@ -846,11 +925,16 @@

- - GET - /jobs - + Get list of jobs

+
+
+
+ GET + /jobs +
+
+
@@ -984,7 +1068,9 @@ OAuth2 - + + admin + @@ -993,6 +1079,11 @@

ServerFollowing

+
+
+

Managing servers which the instance interacts with is crucial to the concept of federation in PeerTube and external video indexation. The PeerTube server then deals with inter-server ActivityPub operations and propagates information across its social graph by posting activities to actors' inbox endpoints.

+
+
@@ -1003,11 +1094,16 @@

- - DELETE - /server/following/{host} - + Unfollow a server by hostname

+
+
+
+ DELETE + /server/following/{host} +
+
+
@@ -1064,7 +1160,9 @@ OAuth2 - + + admin + @@ -1082,11 +1180,16 @@

- - GET - /server/followers - + Get followers of the server

+
+
+
+ GET + /server/followers +
+
+
@@ -1231,11 +1334,16 @@

- - GET - /server/following - + Get servers followed by the server

+
+
+
+ GET + /server/following +
+
+
@@ -1380,11 +1488,16 @@

- - POST - /server/following - + Follow a server

+
+
+
+ POST + /server/following +
+
+
@@ -1488,119 +1601,9 @@ OAuth2 - - - - -
-
-
-
-

User

-
- - -
- User - -
- - -

- - POST - /users - -

-
-
-
-
-
-
- - AddUser - -
-
-
- -

User to create

- -
-
-
-
-
-
-
Request Content-Types: - application/json -
-
Request Example
-
{
-  "username": "string",
-  "password": "string",
-  "email": "string",
-  "videoQuota": "string",
-  "role": "string"
-}
-
- -
-
-
-
-
-
-
-
-
200 OK
-
- - AddUserResponse - -
- -
-
-

successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
{
-  "id": "number",
-  "uuid": "string"
-}
-
- -
-
-
-
-
-
- - - - - - - - - -
- OAuth2 + admin
@@ -1608,21 +1611,32 @@
-
+

VideoAbuse

+
+
+

Video abuses deal with reports of local or remote videos alike.

+
+
+

- - GET - /users - + Get list of reported video abuses

+
+
+
+ GET + /videos/abuse +
+
+
@@ -1680,7 +1694,7 @@
200 OK
@@ -1694,7 +1708,7 @@
- User + VideoAbuse @@ -1713,14 +1727,8 @@
[
   {
     "id": "number",
-    "username": "string",
-    "email": "string",
-    "displayNSFW": "boolean",
-    "autoPlayVideo": "boolean",
-    "role": "string",
-    "videoQuota": "number",
-    "createdAt": "string",
-    "account": {
+    "reason": "string",
+    "reporterAccount": {
       "displayName": "string",
       "id": "number",
       "uuid": "string",
@@ -1737,461 +1745,13 @@
         "updatedAt": "string"
       }
     },
-    "videoChannels": [
-      {
-        "displayName": "string",
-        "description": "string",
-        "isLocal": "boolean",
-        "ownerAccount": {
-          "id": "number",
-          "uuid": "string"
-        }
-      }
-    ]
-  }
-]
-
- -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- User - -
- - -

- - DELETE - /users/{id} - -

-
-
-
-
-
-
id: - - number - - -
- -
in path
-
-
-

The user id

-
-
-
-
-
-
-
-
-
-
-
-
204 No Content
-
-
-

Successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- User - -
- - -

- - GET - /users/{id} - -

-
-
-
-
-
-
id: - - number - - -
- -
in path
-
-
-

The user id

-
-
-
-
-
-
-
-
-
-
-
-
200 OK
-
- - User - -
- -
-
-

successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
{
-  "id": "number",
-  "username": "string",
-  "email": "string",
-  "displayNSFW": "boolean",
-  "autoPlayVideo": "boolean",
-  "role": "string",
-  "videoQuota": "number",
-  "createdAt": "string",
-  "account": {
-    "displayName": "string",
-    "id": "number",
-    "uuid": "string",
-    "url": "string",
-    "name": "string",
-    "host": "string",
-    "followingCount": "number",
-    "followersCount": "number",
-    "createdAt": "string",
-    "updatedAt": "string",
-    "avatar": {
-      "path": "string",
-      "createdAt": "string",
-      "updatedAt": "string"
-    }
-  },
-  "videoChannels": [
-    {
-      "displayName": "string",
-      "description": "string",
-      "isLocal": "boolean",
-      "ownerAccount": {
-        "id": "number",
-        "uuid": "string"
-      }
-    }
-  ]
-}
-
- -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- User - -
- - -

- - PUT - /users/{id} - -

-
-
-
-
-
-
- - UpdateUser - -
-
-
- -

undefined

- -
-
-
-
-
-
-
id: - - number - - -
- -
in path
-
-
-

The user id

-
-
-
-
-
-
-
Request Content-Types: - application/json -
-
Request Example
-
{
-  "id": "string",
-  "email": "string",
-  "videoQuota": "string",
-  "role": "string"
-}
-
- -
-
-
-
-
-
-
-
-
204 No Content
-
-
-

Successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- User - -
- - -

- - GET - /users/me - -

-
-
-
-
-
-
-
-
-
-
200 OK
-
- - User - -
- -
-
-

successful operation

-
-
-
-
type
-
- - - User - - - -
-
-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
[
-  {
-    "id": "number",
-    "username": "string",
-    "email": "string",
-    "displayNSFW": "boolean",
-    "autoPlayVideo": "boolean",
-    "role": "string",
-    "videoQuota": "number",
-    "createdAt": "string",
-    "account": {
-      "displayName": "string",
+    "video": {
       "id": "number",
+      "name": "string",
       "uuid": "string",
-      "url": "string",
-      "name": "string",
-      "host": "string",
-      "followingCount": "number",
-      "followersCount": "number",
-      "createdAt": "string",
-      "updatedAt": "string",
-      "avatar": {
-        "path": "string",
-        "createdAt": "string",
-        "updatedAt": "string"
-      }
+      "url": "string"
     },
-    "videoChannels": [
-      {
-        "displayName": "string",
-        "description": "string",
-        "isLocal": "boolean",
-        "ownerAccount": {
-          "id": "number",
-          "uuid": "string"
-        }
-      }
-    ]
+    "createdAt": "string"
   }
 ]
 
@@ -2222,198 +1782,32 @@
-
+

- - PUT - /users/me - + Report an abuse, on a video by its id

-
-
-
-
- - UpdateMe - -
-
-
- -

undefined

- -
-
-
-
-
-
-
Request Content-Types: - application/json -
-
Request Example
-
{
-  "password": "string",
-  "email": "string",
-  "displayNSFW": "string",
-  "autoPlayVideo": "string"
-}
-
- +
+ POST + /videos/{id}/abuse
-
-
-
-
-
-
204 No Content
-
-
-

Successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- User - -
- - -

- - GET - /users/me/video-quota-used - -

-
-
-
-
-
-
-
-
-
-
200 OK
-
- -
-
-

successful operation

-
-
-
-
type
-
- number - -
-
-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
"number"
-
- -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- User - -
- - -

- - GET - /users/me/videos/{videoId}/rating - -

-
videoId: +
id: string @@ -2423,296 +1817,13 @@
in path
-

The video id

+

The video id or uuid

-
-
-
-
-
-
200 OK
- - -
-
-

successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
{
-  "id": "string",
-  "rating": "number"
-}
-
- -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- User - -
- - -

- - GET - /users/me/videos - -

-
-
-
-
-
-
start: - - number - - -
-
in query
-
-
-

Offset

-
-
-
-
-
count: - - number - - -
-
in query
-
-
-

Number of items

-
-
-
-
-
sort: - - string - - -
-
in query
-
-
-

Sort column (-createdAt for example)

-
-
-
-
-
-
-
-
-
-
-
-
200 OK
-
- - Video - -
- -
-
-

successful operation

-
-
-
-
type
-
- - - Video - - - -
-
-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
[
-  {
-    "id": "number",
-    "uuid": "string",
-    "createdAt": "string",
-    "publishedAt": "string",
-    "updatedAt": "string",
-    "category": {
-      "id": "number",
-      "label": "string"
-    },
-    "licence": {
-      "id": "number",
-      "label": "string"
-    },
-    "language": {
-      "id": "string",
-      "label": "string"
-    },
-    "privacy": "string",
-    "description": "string",
-    "duration": "number",
-    "isLocal": "boolean",
-    "name": "string",
-    "thumbnailPath": "string",
-    "previewPath": "string",
-    "embedPath": "string",
-    "views": "number",
-    "likes": "number",
-    "dislikes": "number",
-    "nsfw": "boolean",
-    "account": {
-      "name": "string",
-      "displayName": "string",
-      "url": "string",
-      "host": "string",
-      "avatar": {
-        "path": "string",
-        "createdAt": "string",
-        "updatedAt": "string"
-      }
-    }
-  }
-]
-
- -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- User - -
- - -

- - POST - /users/register - -

-
-
-
-
-
-
- - RegisterUser - -
-
-
- -

undefined

- -
-
-
-
-
-
-
Request Content-Types: - application/json -
-
Request Example
-
{
-  "username": "string",
-  "password": "string",
-  "email": "string"
-}
-
- -
-
-
@@ -2732,80 +1843,6 @@
-
-
- - -
- User - -
- - -

- - POST - /users/me/avatar/pick - -

-
-
-
-
-
-
avatarfile: - - file - - -
-
in formData
-
-
-

The file to upload.

-
-
-
-
-
-
-
-
-
-
-
-
200 OK
-
- - Avatar - -
- -
-
-

successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
{
-  "path": "string",
-  "createdAt": "string",
-  "updatedAt": "string"
-}
-
- -
-
-
@@ -2830,6 +1867,131 @@

Video

+
+
+

Operations dealing with listing, uploading, fetching or modifying videos.

+
+
+
+ + +
+ Accounts + + Video + +
+ + +

+ Get videos for an account, provided the name of that account +

+
+
+
+ GET + /accounts/{name}/videos +
+
+
+
+
+
+
+
+
name: + + string + + +
+ +
in path
+
+
+

The name of the account (chocobozzz or + chocobozzz@peertube.cpy.re for example)

+
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Video + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "id": "number",
+  "uuid": "string",
+  "createdAt": "string",
+  "publishedAt": "string",
+  "updatedAt": "string",
+  "category": {
+    "id": "number",
+    "label": "string"
+  },
+  "licence": {
+    "id": "number",
+    "label": "string"
+  },
+  "language": {
+    "id": "string",
+    "label": "string"
+  },
+  "privacy": "string",
+  "description": "string",
+  "duration": "number",
+  "isLocal": "boolean",
+  "name": "string",
+  "thumbnailPath": "string",
+  "previewPath": "string",
+  "embedPath": "string",
+  "views": "number",
+  "likes": "number",
+  "dislikes": "number",
+  "nsfw": "boolean",
+  "account": {
+    "name": "string",
+    "displayName": "string",
+    "url": "string",
+    "host": "string",
+    "avatar": {
+      "path": "string",
+      "createdAt": "string",
+      "updatedAt": "string"
+    }
+  }
+}
+
+ +
+
+
+
@@ -2840,11 +2002,16 @@

- - GET - /videos - + Get list of videos

+
+
+
+ GET + /videos +
+
+
@@ -3006,11 +2173,16 @@

- - GET - /videos/categories - + Get list of video licences known by the server

+
+
+
+ GET + /videos/categories +
+
+
@@ -3021,7 +2193,7 @@
200 OK
-
+
@@ -3064,11 +2236,16 @@

- - GET - /videos/licences - + Get list of video licences known by the server

+
+
+
+ GET + /videos/licences +
+
+
@@ -3079,7 +2256,7 @@
200 OK
-
+
@@ -3122,11 +2299,16 @@

- - GET - /videos/languages - + Get list of languages known by the server

+
+
+
+ GET + /videos/languages +
+
+
@@ -3137,7 +2319,7 @@
200 OK
-
+
@@ -3180,11 +2362,16 @@

- - GET - /videos/privacies - + Get list of privacy policies supported by the server

+
+
+
+ GET + /videos/privacies +
+
+
@@ -3195,7 +2382,7 @@
200 OK
-
+
@@ -3238,11 +2425,16 @@

- - PUT - /videos/{id} - + Update metadata for a video by its id

+
+
+
+ PUT + /videos/{id} +
+
+
@@ -3572,11 +2764,16 @@

- - GET - /videos/{id} - + Get a video by its id

+
+
+
+ GET + /videos/{id} +
+
+
@@ -3684,11 +2881,16 @@

- - DELETE - /videos/{id} - + Delete a video by its id

+
+
+
+ DELETE + /videos/{id} +
+
+
@@ -3763,11 +2965,16 @@

- - GET - /videos/{id}/description - + Get a video description by its id

+
+
+
+ GET + /videos/{id}/description +
+
+
@@ -3796,7 +3003,7 @@
200 OK
-
+
@@ -3837,11 +3044,16 @@

- - POST - /videos/{id}/views - + Add a view to the video by its id

+
+
+
+ POST + /videos/{id}/views +
+
+
@@ -3894,11 +3106,16 @@

- - POST - /videos/upload - + Upload a video file with its metadata

+
+
+
+ POST + /videos/upload +
+
+
@@ -4197,22 +3414,33 @@
-

VideoAbuse

-
+

Search

+
+
+

The search helps to find + videos from within the instance and beyond. Videos from other instances federated by the instance (that is, instances followed by the instance) can be found via keywords and other criteria of the advanced search.

+
+
+

- - GET - /videos/abuse - + Get the videos corresponding to a given query

+
+
+
+ GET + /search/videos +
+
+
@@ -4258,402 +3486,19 @@

Sort column (-createdAt for example)

-
-
-
-
-
-
-
-
200 OK
-
- - VideoAbuse - -
- -
-
-

successful operation

-
-
-
-
type
-
- - - VideoAbuse - - - -
-
-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
[
-  {
-    "id": "number",
-    "reason": "string",
-    "reporterAccount": {
-      "displayName": "string",
-      "id": "number",
-      "uuid": "string",
-      "url": "string",
-      "name": "string",
-      "host": "string",
-      "followingCount": "number",
-      "followersCount": "number",
-      "createdAt": "string",
-      "updatedAt": "string",
-      "avatar": {
-        "path": "string",
-        "createdAt": "string",
-        "updatedAt": "string"
-      }
-    },
-    "video": {
-      "id": "number",
-      "name": "string",
-      "uuid": "string",
-      "url": "string"
-    },
-    "createdAt": "string"
-  }
-]
-
- -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- VideoAbuse - -
- - -

- - POST - /videos/{id}/abuse - -

-
-
-
-
-
-
id: +
search: string
-
in path
-
-
-

The video id or uuid

-
-
-
-
-
-
-
-
-
-
-
-
204 No Content
-
-
-

Successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-

VideoBlacklist

-
- - - - - -

- - POST - /videos/{id}/blacklist - -

-
-
-
-
-
-
id: - - string - - -
- -
in path
-
-
-

The video id or uuid

-
-
-
-
-
-
-
-
-
-
-
-
204 No Content
-
-
-

Successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - - - - -

- - DELETE - /videos/{id}/blacklist - -

-
-
-
-
-
-
id: - - string - - -
- -
in path
-
-
-

The video id or uuid

-
-
-
-
-
-
-
-
-
-
-
-
204 No Content
-
-
-

Successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - - - - -

- - GET - /videos/blacklist - -

-
-
-
-
-
-
start: - - number - - -
in query
-

Offset

-
-
-
-
-
count: - - number - - -
-
in query
-
-
-

Number of items

-
-
-
-
-
sort: - - string - - -
-
in query
-
-
-

Sort column (-createdAt for example)

+

String to search

@@ -4668,602 +3513,6 @@
200 OK
- -
-
-

successful operation

-
-
-
-
type
-
- - - VideoBlacklist - - - -
-
-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
[
-  {
-    "id": "number",
-    "videoId": "number",
-    "createdAt": "string",
-    "updatedAt": "string",
-    "name": "string",
-    "uuid": "string",
-    "description": "string",
-    "duration": "number",
-    "views": "number",
-    "likes": "number",
-    "dislikes": "number",
-    "nsfw": "boolean"
-  }
-]
-
- -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-

VideoChannel

-
- - -
- VideoChannel - -
- - -

- - GET - /video-channels - -

-
-
-
-
-
-
start: - - number - - -
-
in query
-
-
-

Offset

-
-
-
-
-
count: - - number - - -
-
in query
-
-
-

Number of items

-
-
-
-
-
sort: - - string - - -
-
in query
-
-
-

Sort column (-createdAt for example)

-
-
-
-
-
-
-
-
-
-
-
-
200 OK
-
- - VideoChannel - -
- -
-
-

successful operation

-
-
-
-
type
-
- - - VideoChannel - - - -
-
-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
[
-  {
-    "displayName": "string",
-    "description": "string",
-    "isLocal": "boolean",
-    "ownerAccount": {
-      "id": "number",
-      "uuid": "string"
-    }
-  }
-]
-
- -
-
-
-
-
- - -
- VideoChannel - -
- - -

- - POST - /video-channels - -

-
-
-
-
-
- -
-
- -

undefined

- -
-
-
-
-
-
-
Request Content-Types: - application/json -
-
Request Example
-
{
-  "name": "string",
-  "description": "string"
-}
-
- -
-
-
-
-
-
-
-
-
204 No Content
-
-
-

Successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- VideoChannel - -
- - -

- - GET - /video-channels/{id} - -

-
-
-
-
-
-
id: - - string - - -
- -
in path
-
-
-

The video channel id or uuid

-
-
-
-
-
-
-
-
-
-
-
-
200 OK
-
- - VideoChannel - -
- -
-
-

successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
{
-  "displayName": "string",
-  "description": "string",
-  "isLocal": "boolean",
-  "ownerAccount": {
-    "id": "number",
-    "uuid": "string"
-  }
-}
-
- -
-
-
-
-
- - -
- VideoChannel - -
- - -

- - PUT - /video-channels/{id} - -

-
-
-
-
-
- -
-
- -

undefined

- -
-
-
-
-
-
-
id: - - string - - -
- -
in path
-
-
-

The video channel id or uuid

-
-
-
-
-
-
-
Request Content-Types: - application/json -
-
Request Example
-
{
-  "name": "string",
-  "description": "string"
-}
-
- -
-
-
-
-
-
-
-
-
204 No Content
-
-
-

Successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- VideoChannel - -
- - -

- - DELETE - /video-channels/{id} - -

-
-
-
-
-
-
id: - - string - - -
- -
in path
-
-
-

The video channel id or uuid

-
-
-
-
-
-
-
-
-
-
-
-
204 No Content
-
-
-

Successful operation

-
-
-
-
-
-
Response Content-Types: - application/json -
-
-
-
-
-
- - - - - - - - - - - - - -
- OAuth2 -
-
-
-
-
-
- - -
- VideoChannel - -
- - -

- - GET - /video-channels/{id}/videos - -

-
-
-
-
-
-
id: - - string - - -
- -
in path
-
-
-

The video channel id or uuid

-
-
-
-
-
-
-
-
-
-
-
-
200 OK
-
- Video
@@ -5273,125 +3522,12 @@

successful operation

-
-
-
-
Response Content-Types: - application/json -
-
-
Response Example - (200 OK) -
-
{
-  "id": "number",
-  "uuid": "string",
-  "createdAt": "string",
-  "publishedAt": "string",
-  "updatedAt": "string",
-  "category": {
-    "id": "number",
-    "label": "string"
-  },
-  "licence": {
-    "id": "number",
-    "label": "string"
-  },
-  "language": {
-    "id": "string",
-    "label": "string"
-  },
-  "privacy": "string",
-  "description": "string",
-  "duration": "number",
-  "isLocal": "boolean",
-  "name": "string",
-  "thumbnailPath": "string",
-  "previewPath": "string",
-  "embedPath": "string",
-  "views": "number",
-  "likes": "number",
-  "dislikes": "number",
-  "nsfw": "boolean",
-  "account": {
-    "name": "string",
-    "displayName": "string",
-    "url": "string",
-    "host": "string",
-    "avatar": {
-      "path": "string",
-      "createdAt": "string",
-      "updatedAt": "string"
-    }
-  }
-}
-
- -
-
-
-
-
- - -
- VideoChannel - -
- - -

- - GET - /accounts/{name}/video-channels - -

-
-
-
-
-
-
name: - - string - - -
- -
in path
-
-
-

The name of the account (chocobozzz or - chocobozzz@peertube.cpy.re for example)

-
-
-
-
-
-
-
-
-
-
-
-
200 OK
-
- - VideoChannel - -
- -
-
-

successful operation

-
-
type
- VideoChannel + Video @@ -5409,12 +3545,45 @@
[
   {
-    "displayName": "string",
-    "description": "string",
-    "isLocal": "boolean",
-    "ownerAccount": {
+    "id": "number",
+    "uuid": "string",
+    "createdAt": "string",
+    "publishedAt": "string",
+    "updatedAt": "string",
+    "category": {
       "id": "number",
-      "uuid": "string"
+      "label": "string"
+    },
+    "licence": {
+      "id": "number",
+      "label": "string"
+    },
+    "language": {
+      "id": "string",
+      "label": "string"
+    },
+    "privacy": "string",
+    "description": "string",
+    "duration": "number",
+    "isLocal": "boolean",
+    "name": "string",
+    "thumbnailPath": "string",
+    "previewPath": "string",
+    "embedPath": "string",
+    "views": "number",
+    "likes": "number",
+    "dislikes": "number",
+    "nsfw": "boolean",
+    "account": {
+      "name": "string",
+      "displayName": "string",
+      "url": "string",
+      "host": "string",
+      "avatar": {
+        "path": "string",
+        "createdAt": "string",
+        "updatedAt": "string"
+      }
     }
   }
 ]
@@ -5425,6 +3594,11 @@
             

VideoComment

+
+
+

Operations dealing with comments to a video. Comments are organized in threads.

+
+
@@ -5435,11 +3609,16 @@

- - GET - /videos/{id}/comment-threads - + Get the comment threads of a video by its id

+
+
+
+ GET + /videos/{id}/comment-threads +
+
+
@@ -5580,11 +3759,16 @@

- - POST - /videos/{id}/comment-threads - + Creates a comment thread, on a video by its id

+
+
+
+ POST + /videos/{id}/comment-threads +
+
+
@@ -5702,11 +3886,16 @@

- - GET - /videos/{id}/comment-threads/{threadId} - + Get the comment thread by its id, of a video by its id

+
+
+
+ GET + /videos/{id}/comment-threads/{threadId} +
+
+
@@ -5880,11 +4069,16 @@

- - POST - /videos/{id}/comments/{commentId} - + Creates a comment in a comment thread by its id, of a video by its id

+
+
+
+ POST + /videos/{id}/comments/{commentId} +
+
+
@@ -6017,11 +4211,16 @@

- - DELETE - /videos/{id}/comments/{commentId} - + Delete a comment in a comment therad by its id, of a video by its id

+
+
+
+ DELETE + /videos/{id}/comments/{commentId} +
+
+
@@ -6101,22 +4300,252 @@
-

VideoRate

-
+

VideoChannel

+
+
+

Operations dealing with creation, modification and video listing of a user's channels.

+
+
+

- - PUT - /videos/{id}/rate - + Get list of video channels

+
+
+
+ GET + /video-channels +
+
+
+
+
+
+
+
+
start: + + number + + +
+
in query
+
+
+

Offset

+
+
+
+
+
count: + + number + + +
+
in query
+
+
+

Number of items

+
+
+
+
+
sort: + + string + + +
+
in query
+
+
+

Sort column (-createdAt for example)

+
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + VideoChannel + +
+ +
+
+

successful operation

+
+
+
+
type
+
+ + + VideoChannel + + + +
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "displayName": "string",
+    "description": "string",
+    "isLocal": "boolean",
+    "ownerAccount": {
+      "id": "number",
+      "uuid": "string"
+    }
+  }
+]
+
+ +
+
+
+
+
+ + +
+ VideoChannel + +
+ + +

+ Creates a video channel for the current user +

+
+
+
+ POST + /video-channels +
+
+
+
+
+
+
+
+ +
+
+ +

undefined

+ +
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "name": "string",
+  "description": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
204 No Content
+
+
+

Successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+
+
+
+ + +
+ VideoChannel + +
+ + +

+ Get a video channel by its id +

+
+
+
+ GET + /video-channels/{id} +
+
+
@@ -6132,7 +4561,204 @@
in path
-

The video id or uuid

+

The video channel id or uuid

+
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + VideoChannel + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "displayName": "string",
+  "description": "string",
+  "isLocal": "boolean",
+  "ownerAccount": {
+    "id": "number",
+    "uuid": "string"
+  }
+}
+
+ +
+
+
+
+
+ + +
+ VideoChannel + +
+ + +

+ Update a video channel by its id +

+
+
+
+ PUT + /video-channels/{id} +
+
+
+
+
+
+
+
+ +
+
+ +

undefined

+ +
+
+
+
+
+
+
id: + + string + + +
+ +
in path
+
+
+

The video channel id or uuid

+
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "name": "string",
+  "description": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
204 No Content
+
+
+

Successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+
+
+
+ + +
+ VideoChannel + +
+ + +

+ Delete a video channel by its id +

+
+
+
+ DELETE + /video-channels/{id} +
+
+
+
+
+
+
+
+
id: + + string + + +
+ +
in path
+
+
+

The video channel id or uuid

@@ -6181,22 +4807,360 @@
-

Search

-
+

- - GET - /search/videos - + Get videos of a video channel by its id

+
+
+
+ GET + /video-channels/{id}/videos +
+
+
+
+
+
+
+
+
id: + + string + + +
+ +
in path
+
+
+

The video channel id or uuid

+
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Video + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "id": "number",
+  "uuid": "string",
+  "createdAt": "string",
+  "publishedAt": "string",
+  "updatedAt": "string",
+  "category": {
+    "id": "number",
+    "label": "string"
+  },
+  "licence": {
+    "id": "number",
+    "label": "string"
+  },
+  "language": {
+    "id": "string",
+    "label": "string"
+  },
+  "privacy": "string",
+  "description": "string",
+  "duration": "number",
+  "isLocal": "boolean",
+  "name": "string",
+  "thumbnailPath": "string",
+  "previewPath": "string",
+  "embedPath": "string",
+  "views": "number",
+  "likes": "number",
+  "dislikes": "number",
+  "nsfw": "boolean",
+  "account": {
+    "name": "string",
+    "displayName": "string",
+    "url": "string",
+    "host": "string",
+    "avatar": {
+      "path": "string",
+      "createdAt": "string",
+      "updatedAt": "string"
+    }
+  }
+}
+
+ +
+
+
+
+
+ + +
+ VideoChannel + +
+ + +

+ Get video channels of an account by its name +

+
+
+
+ GET + /accounts/{name}/video-channels +
+
+
+
+
+
+
+
+
name: + + string + + +
+ +
in path
+
+
+

The name of the account (chocobozzz or + chocobozzz@peertube.cpy.re for example)

+
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + VideoChannel + +
+ +
+
+

successful operation

+
+
+
+
type
+
+ + + VideoChannel + + + +
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "displayName": "string",
+    "description": "string",
+    "isLocal": "boolean",
+    "ownerAccount": {
+      "id": "number",
+      "uuid": "string"
+    }
+  }
+]
+
+ +
+
+
+
+

User

+
+ + +
+ User + +
+ + +

+ Creates user +

+
+
+
+ POST + /users +
+
+
+
+
+
+
+
+
+ + AddUser + +
+
+
+ +

User to create

+ +
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "username": "string",
+  "password": "string",
+  "email": "string",
+  "videoQuota": "string",
+  "role": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
200 OK
+
+ + AddUserResponse + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "id": "number",
+  "uuid": "string"
+}
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 + + admin +
+
+
+
+
+
+ + +
+ User + +
+ + +

+ Get a list of users +

+
+
+
+ GET + /users +
+
+
@@ -6242,19 +5206,927 @@

Sort column (-createdAt for example)

+
+
+
+
+
+
+
-
search: +
200 OK
+
+ + User + +
+ +
+
+

successful operation

+
+
+
+
type
+
+ + + User + + + +
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "username": "string",
+    "email": "string",
+    "displayNSFW": "boolean",
+    "autoPlayVideo": "boolean",
+    "role": "string",
+    "videoQuota": "number",
+    "createdAt": "string",
+    "account": {
+      "displayName": "string",
+      "id": "number",
+      "uuid": "string",
+      "url": "string",
+      "name": "string",
+      "host": "string",
+      "followingCount": "number",
+      "followersCount": "number",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "avatar": {
+        "path": "string",
+        "createdAt": "string",
+        "updatedAt": "string"
+      }
+    },
+    "videoChannels": [
+      {
+        "displayName": "string",
+        "description": "string",
+        "isLocal": "boolean",
+        "ownerAccount": {
+          "id": "number",
+          "uuid": "string"
+        }
+      }
+    ]
+  }
+]
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+
+
+
+ + +
+ User + +
+ + +

+ Delete a user by its id +

+
+
+
+ DELETE + /users/{id} +
+
+
+
+
+
+
+
+
id: + + number + + +
+ +
in path
+
+
+

The user id

+
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

Successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 + + admin +
+
+
+
+
+
+ + +
+ User + +
+ + +

+ Get user by its id +

+
+
+
+ GET + /users/{id} +
+
+
+
+
+
+
+
+
id: + + number + + +
+ +
in path
+
+
+

The user id

+
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + User + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "id": "number",
+  "username": "string",
+  "email": "string",
+  "displayNSFW": "boolean",
+  "autoPlayVideo": "boolean",
+  "role": "string",
+  "videoQuota": "number",
+  "createdAt": "string",
+  "account": {
+    "displayName": "string",
+    "id": "number",
+    "uuid": "string",
+    "url": "string",
+    "name": "string",
+    "host": "string",
+    "followingCount": "number",
+    "followersCount": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "avatar": {
+      "path": "string",
+      "createdAt": "string",
+      "updatedAt": "string"
+    }
+  },
+  "videoChannels": [
+    {
+      "displayName": "string",
+      "description": "string",
+      "isLocal": "boolean",
+      "ownerAccount": {
+        "id": "number",
+        "uuid": "string"
+      }
+    }
+  ]
+}
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+
+
+
+ + +
+ User + +
+ + +

+ Update user profile by its id +

+
+
+
+ PUT + /users/{id} +
+
+
+
+
+
+
+
+
+ + UpdateUser + +
+
+
+ +

undefined

+ +
+
+
+
+
+
+
id: + + number + + +
+ +
in path
+
+
+

The user id

+
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "id": "string",
+  "email": "string",
+  "videoQuota": "string",
+  "role": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
204 No Content
+
+
+

Successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+
+
+
+ + +
+ User + +
+ + +

+ Get current user information +

+
+
+
+ GET + /users/me +
+
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + User + +
+ +
+
+

successful operation

+
+
+
+
type
+
+ + + User + + + +
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "username": "string",
+    "email": "string",
+    "displayNSFW": "boolean",
+    "autoPlayVideo": "boolean",
+    "role": "string",
+    "videoQuota": "number",
+    "createdAt": "string",
+    "account": {
+      "displayName": "string",
+      "id": "number",
+      "uuid": "string",
+      "url": "string",
+      "name": "string",
+      "host": "string",
+      "followingCount": "number",
+      "followersCount": "number",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "avatar": {
+        "path": "string",
+        "createdAt": "string",
+        "updatedAt": "string"
+      }
+    },
+    "videoChannels": [
+      {
+        "displayName": "string",
+        "description": "string",
+        "isLocal": "boolean",
+        "ownerAccount": {
+          "id": "number",
+          "uuid": "string"
+        }
+      }
+    ]
+  }
+]
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+
+
+
+ + +
+ User + +
+ + +

+ Update current user information +

+
+
+
+ PUT + /users/me +
+
+
+
+
+
+
+
+
+ + UpdateMe + +
+
+
+ +

undefined

+ +
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "password": "string",
+  "email": "string",
+  "displayNSFW": "string",
+  "autoPlayVideo": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
204 No Content
+
+
+

Successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+
+
+
+ + +
+ User + +
+ + +

+ Get current user used quota +

+
+
+
+ GET + /users/me/video-quota-used +
+
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ +
+
+

successful operation

+
+
+
+
type
+
+ number + +
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
"number"
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+
+
+
+ + +
+ User + +
+ + +

+ Get rating of video by its id, among those of the current user +

+
+
+
+ GET + /users/me/videos/{videoId}/rating +
+
+
+
+
+
+
+
+
videoId: string
+
in path
+
+
+

The video id

+
+
+
+
+
+
+
+
+
+
+
+
200 OK
+ + +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "id": "string",
+  "rating": "number"
+}
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+
+
+
+ + +
+ User + +
+ + +

+ Get videos of the current user +

+
+
+
+ GET + /users/me/videos +
+
+
+
+
+
+
+
+
start: + + number + + +
in query
-

String to search

+

Offset

+
+
+
+
+
count: + + number + + +
+
in query
+
+
+

Number of items

+
+
+
+
+
sort: + + string + + +
+
in query
+
+
+

Sort column (-createdAt for example)

@@ -6348,13 +6220,624 @@
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+
+
+
+ + +
+ User + +
+ + +

+ Register a user +

+
+
+
+ POST + /users/register +
+
+
+
+
+
+
+
+
+ + RegisterUser + +
+
+
+ +

undefined

+ +
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "username": "string",
+  "password": "string",
+  "email": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
204 No Content
+
+
+

Successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ User + +
+ + +

+ Update current user avatar +

+
+
+
+ POST + /users/me/avatar/pick +
+
+
+
+
+
+
+
+
avatarfile: + + file + + +
+
in formData
+
+
+

The file to upload.

+
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Avatar + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "path": "string",
+  "createdAt": "string",
+  "updatedAt": "string"
+}
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+
+
+

VideoBlacklist

+
+ + + + + +

+ Put on blacklist a video by its id +

+
+
+
+ POST + /videos/{id}/blacklist +
+
+
+
+
+
+
+
+
id: + + string + + +
+ +
in path
+
+
+

The video id or uuid

+
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

Successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 + + admin, + moderator +
+
+
+
+
+
+ + + + + +

+ Delete an entry of the blacklist of a video by its id +

+
+
+
+ DELETE + /videos/{id}/blacklist +
+
+
+
+
+
+
+
+
id: + + string + + +
+ +
in path
+
+
+

The video id or uuid

+
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

Successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 + + admin, + moderator +
+
+
+
+
+
+ + + + + +

+ Get list of videos on blacklist +

+
+
+
+ GET + /videos/blacklist +
+
+
+
+
+
+
+
+
start: + + number + + +
+
in query
+
+
+

Offset

+
+
+
+
+
count: + + number + + +
+
in query
+
+
+

Number of items

+
+
+
+
+
sort: + + string + + +
+
in query
+
+
+

Sort column (-createdAt for example)

+
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + VideoBlacklist + +
+ +
+
+

successful operation

+
+
+
+
type
+
+ + + VideoBlacklist + + + +
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "videoId": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "name": "string",
+    "uuid": "string",
+    "description": "string",
+    "duration": "number",
+    "views": "number",
+    "likes": "number",
+    "dislikes": "number",
+    "nsfw": "boolean"
+  }
+]
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 + + admin, + moderator +
+
+
+
+
+

VideoRate

+
+ + +
+ VideoRate + +
+ + +

+ Vote for a video by its id +

+
+
+
+ PUT + /videos/{id}/rate +
+
+
+
+
+
+
+
+
id: + + string + + +
+ +
in path
+
+
+

The video id or uuid

+
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

Successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+
+ + + + + + + + + + + + + +
+ OAuth2 +
+
+
+

Schema Definitions

VideoConstantNumber: -