]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - support/doc/api/openapi.yaml
Add root class if user is logged in
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
index f00e40737bab37fbcc5da884472a208a2645690a..44b437c40a0bbc0eecc4cd174dec40aa5c1950d4 100644 (file)
@@ -1,8 +1,12 @@
 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
+basePath: '/api/v1'
+schemes:
+  - https
 paths:
   '/accounts/{id}':
     get:
@@ -18,6 +22,21 @@ paths:
           required: true
           type: string
           description: 'The id of the account'
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: stop
+          in: query
+          required: false
+          type: number
+          description: 'stoping page'
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
@@ -50,7 +69,7 @@ paths:
         '200':
           description: successful operation
           schema:
-            $ref: '#/definitions/ServerConfig' 
+            $ref: '#/definitions/ServerConfig'
   /jobs:
     get:
       tags:
@@ -59,13 +78,34 @@ paths:
         - application/json
       produces:
         - application/json
+      parameters:
+        - name: state
+          in: path
+          required: true
+          type: string
+          description: 'The id of the account'
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: count
+          in: query
+          required: false
+          type: number
+          description: ''
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
           schema:
             type: array
             items:
-              $ref: '#/definitions/Job' 
+              $ref: '#/definitions/Job'
   '/server/following/{host}':
     delete:
       tags:
@@ -91,6 +131,22 @@ paths:
         - application/json
       produces:
         - application/json
+      parameters:
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: stop
+          in: query
+          required: false
+          type: number
+          description: 'stoping page'
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
@@ -106,6 +162,22 @@ paths:
         - application/json
       produces:
         - application/json
+      parameters:
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: stop
+          in: query
+          required: false
+          type: number
+          description: 'stoping page'
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
@@ -154,6 +226,22 @@ paths:
         - application/json
       produces:
         - application/json
+      parameters:
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: stop
+          in: query
+          required: false
+          type: number
+          description: 'stoping page'
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
@@ -289,6 +377,22 @@ paths:
         - application/json
       produces:
         - application/json
+      parameters:
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: stop
+          in: query
+          required: false
+          type: number
+          description: 'stoping page'
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
@@ -339,6 +443,22 @@ paths:
         - application/json
       produces:
         - application/json
+      parameters:
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: stop
+          in: query
+          required: false
+          type: number
+          description: 'stoping page'
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
@@ -414,6 +534,22 @@ paths:
         - application/json
       produces:
         - application/json
+      parameters:
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: stop
+          in: query
+          required: false
+          type: number
+          description: 'stoping page'
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
@@ -536,6 +672,22 @@ paths:
         - application/json
       produces:
         - application/json
+      parameters:
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: stop
+          in: query
+          required: false
+          type: number
+          description: 'stoping page'
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
@@ -601,6 +753,22 @@ paths:
         - application/json
       produces:
         - application/json
+      parameters:
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: stop
+          in: query
+          required: false
+          type: number
+          description: 'stoping page'
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
@@ -616,6 +784,22 @@ paths:
         - application/json
       produces:
         - application/json
+      parameters:
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: stop
+          in: query
+          required: false
+          type: number
+          description: 'stoping page'
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
@@ -728,6 +912,21 @@ paths:
           required: true
           type: string
           description: 'The video id '
+        - name: start
+          in: query
+          required: false
+          type: number
+          description: 'starting page'
+        - name: stop
+          in: query
+          required: false
+          type: number
+          description: 'stoping page'
+        - name: sort
+          in: query
+          required: false
+          type: number
+          description: 'sorting'
       responses:
         '200':
           description: successful operation
@@ -838,30 +1037,28 @@ paths:
         '204':
           description: successful operation
 definitions:
+  VideoConstant:
+    properties:
+      id:
+        type: number
+      label:
+        type: string
   Video:
     properties:
       id:
         type: number
       uuid:
         type: string
-      accountName:
-        type: string
       createdAt:
         type: string
       updatedAt:
         type: string
-      categoryLabel:
-        type: string
       category:
-        type: number
-      licenceLabel:
-        type: string
+        $ref: "#/definitions/VideoConstant"
       licence:
-        type: number
-      languageLabel:
-        type: string
+        $ref: "#/definitions/VideoConstant"
       language:
-        type: number
+        $ref: "#/definitions/VideoConstant"
       description:
         type: string
       duration:
@@ -870,8 +1067,6 @@ definitions:
         type: boolean
       name:
         type: string
-      serverHost:
-        type: string
       thumbnailPath:
         type: string
       previewPath:
@@ -886,22 +1081,26 @@ definitions:
         type: number
       nsfw:
         type: boolean
+      account:
+        name: string
+        displayName: string
+        url: string
+        host: 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:
+        id: number
+        name: string
+        uuid: string
+        url: string
       createdAt:
         type: string
   VideoBlacklist:
@@ -940,14 +1139,14 @@ definitions:
         type: boolean
       owner:
         type: object
-        properties: 
-          name: 
+        properties:
+          name:
             type: string
-          uuid: 
+          uuid:
             type: string
       videos:
         type: array
-        items: 
+        items:
           $ref: "#/definitions/Video"
   VideoComment:
     properties:
@@ -1029,7 +1228,7 @@ definitions:
         type: boolean
       role:
         type: string
-        enum: [User, Moderator, Administrator] 
+        enum: [User, Moderator, Administrator]
       videoQuota:
         type: number
       createdAt:
@@ -1042,7 +1241,7 @@ definitions:
           $ref: "#/definitions/VideoChannel"
   ServerConfig:
     properties:
-      signup: 
+      signup:
         type: object
         properties:
           allowed:
@@ -1065,7 +1264,7 @@ definitions:
                 properties:
                   max:
                     type: number
-          extensions: 
+          extensions:
             type: array
             items:
               type: string
@@ -1074,8 +1273,8 @@ definitions:
         properties:
           file:
             type: object
-            properties: 
-              extensions: 
+            properties:
+              extensions:
                 type: array
                 items:
                   type: string