]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - support/doc/api/openapi.yaml
Merge branch 'master' into develop
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
index 8de9c65058e0397ace5be89a131c25b0fe1f720f..9184d78277e9e4f612c71944714b8b704de21860 100644 (file)
@@ -63,7 +63,7 @@ tags:
       server then deals with inter-server ActivityPub operations and propagates
       information across its social graph by posting activities to actors' inbox
       endpoints.
-  - name: Video Abuse
+  - name: Video Abuses
     description: |
       Video abuses deal with reports of local or remote videos alike.
   - name: Video
@@ -116,7 +116,7 @@ x-tagGroups:
       - Search
   - name: Moderation
     tags:
-      - Video Abuse
+      - Video Abuses
       - Video Blacklist
   - name: Instance Configuration
     tags:
@@ -148,6 +148,17 @@ paths:
       summary: 'List videos of an account'
       parameters:
         - $ref: '#/components/parameters/name'
+        - $ref: '#/components/parameters/categoryOneOf'
+        - $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
@@ -538,7 +549,7 @@ paths:
                 type: number
   '/users/me/videos/{videoId}/rating':
     get:
-      summary: Get rate of my user of a video
+      summary: Get rate of my user for a video
       security:
         - OAuth2: []
       tags:
@@ -630,9 +641,17 @@ paths:
         - My Subscriptions
         - Videos
       parameters:
+        - $ref: '#/components/parameters/categoryOneOf'
+        - $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/sort'
+        - $ref: '#/components/parameters/videosSort'
       responses:
         '200':
           description: successful operation
@@ -768,6 +787,7 @@ paths:
         - $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'
@@ -1197,7 +1217,7 @@ paths:
             - admin
             - moderator
       tags:
-        - Video Abuse
+        - Video Abuses
       parameters:
         - $ref: '#/components/parameters/start'
         - $ref: '#/components/parameters/count'
@@ -1217,12 +1237,63 @@ paths:
       security:
         - OAuth2: []
       tags:
-        - Video Abuse
+        - Video Abuses
+        - Videos
       parameters:
         - $ref: '#/components/parameters/idOrUUID'
+      requestBody:
+        content:
+          application/json:
+            schema:
+              type: object
+              properties:
+                reason:
+                  description: Reason why the user reports this video
+                  type: string
       responses:
         '204':
           description: successful operation
+  '/videos/{id}/abuse/{abuseId}':
+    put:
+      summary: Update an abuse
+      security:
+        - OAuth2:
+          - admin
+          - moderator
+      tags:
+        - Video Abuses
+      responses:
+        '204':
+          description: successful operation
+      parameters:
+        - $ref: '#/components/parameters/idOrUUID'
+        - $ref: '#/components/parameters/abuseId'
+      requestBody:
+        content:
+          application/json:
+            schema:
+              type: object
+              properties:
+                state:
+                  $ref: '#/components/schemas/VideoAbuseStateSet'
+                moderationComment:
+                  type: string
+                  description: 'Update the comment of the video abuse for other admin/moderators'
+    delete:
+      summary: Delete an abuse
+      security:
+        - OAuth2:
+            - admin
+            - moderator
+      tags:
+        - Video Abuses
+      responses:
+        '204':
+          description: successful operation
+      parameters:
+        - $ref: '#/components/parameters/idOrUUID'
+        - $ref: '#/components/parameters/abuseId'
+
   '/videos/{id}/blacklist':
     post:
       summary: Blacklist a video
@@ -1408,6 +1479,17 @@ paths:
         - Video Channels
       parameters:
         - $ref: '#/components/parameters/channelHandle'
+        - $ref: '#/components/parameters/categoryOneOf'
+        - $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
@@ -1640,7 +1722,7 @@ paths:
                 - startPosition
                 - insertAfterPosition
 
-  /video-playlists/{id}/videos/:playlistElementId:
+  /video-playlists/{id}/videos/{playlistElementId}:
     put:
       summary: 'Update a playlist element'
       security:
@@ -1678,6 +1760,44 @@ paths:
         '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: number
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                type: object
+                properties:
+                  videoId:
+                    type: array
+                    items:
+                      type: object
+                      properties:
+                        playlistElementId:
+                          type: number
+                        playlistId:
+                          type: number
+                        startTimestamp:
+                          type: number
+                        stopTimestamp:
+                          type: number
+
   '/accounts/{name}/video-channels':
     get:
       summary: List video channels of an account
@@ -1757,6 +1877,18 @@ paths:
             application/json:
               schema:
                 $ref: '#/components/schemas/CommentThreadPostResponse'
+      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
@@ -1789,6 +1921,18 @@ paths:
             application/json:
               schema:
                 $ref: '#/components/schemas/CommentThreadPostResponse'
+      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:
@@ -1819,6 +1963,14 @@ paths:
         - Search
       summary: Search videos
       parameters:
+        - $ref: '#/components/parameters/categoryOneOf'
+        - $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/videosSearchSort'
@@ -1973,6 +2125,13 @@ components:
       description: Playlist element id
       schema:
         type: number
+    abuseId:
+      name: abuseId
+      in: path
+      required: true
+      description: Video abuse id
+      schema:
+        type: number
     captionLanguage:
       name: captionLanguage
       in: path
@@ -2012,7 +2171,7 @@ components:
       name: categoryOneOf
       in: query
       required: false
-      description: category id of the video
+      description: category id of the video (see /videos/categories)
       schema:
         oneOf:
         - type: number
@@ -2051,7 +2210,7 @@ components:
       name: languageOneOf
       in: query
       required: false
-      description: language id of the video
+      description: language id of the video (see /videos/languages). Use _unknown to filter on videos that don't have a video language
       schema:
         oneOf:
         - type: string
@@ -2064,7 +2223,7 @@ components:
       name: licenceOneOf
       in: query
       required: false
-      description: licence id of the video
+      description: licence id of the video (see /videos/licences)
       schema:
         oneOf:
         - type: number
@@ -2073,6 +2232,16 @@ components:
             type: number
       style: form
       explode: false
+    skipCount:
+      name: skipCount
+      in: query
+      required: false
+      description: if you don't need the `total` in the response
+      schema:
+        type: string
+        enum:
+          - 'true'
+          - 'false'
     nsfw:
       name: nsfw
       in: query
@@ -2183,6 +2352,22 @@ components:
           $ref: '#/components/schemas/VideoPrivacySet'
         label:
           type: string
+
+    NSFWPolicy:
+      type: string
+      enum:
+        - display
+        - blur
+        - do_not_list
+
+    UserRole:
+      type: number
+      enum:
+        - 0
+        - 1
+        - 2
+      description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
+
     VideoStateConstant:
       properties:
         id:
@@ -2194,6 +2379,21 @@ components:
           description: 'The video state (Published = 1, to transcode = 2, to import = 3)'
         label:
           type: string
+
+    VideoAbuseStateSet:
+      type: integer
+      enum:
+        - 1
+        - 2
+        - 3
+      description: 'The video playlist privacy (Pending = 1, Rejected = 2, Accepted = 3)'
+    VideoAbuseStateConstant:
+      properties:
+        id:
+          $ref: '#/components/schemas/VideoAbuseStateSet'
+        label:
+          type: string
+
     VideoResolutionConstant:
       properties:
         id:
@@ -2440,6 +2640,10 @@ components:
           type: string
         reporterAccount:
           $ref: '#/components/schemas/Account'
+        state:
+          $ref: '#/components/schemas/VideoAbuseStateConstant'
+        moderationComment:
+          type: string
         video:
           type: object
           properties:
@@ -2449,8 +2653,6 @@ components:
               type: string
             uuid:
               type: string
-            url:
-              type: string
         createdAt:
           type: string
     VideoBlacklist:
@@ -2606,17 +2808,20 @@ components:
           type: string
         email:
           type: string
-        displayNSFW:
+        theme:
+          type: string
+          description: 'Theme enabled by this user'
+        emailVerified:
+          type: boolean
+          description: 'Is email verified?'
+        nsfwPolicy:
+          $ref: '#/components/schemas/NSFWPolicy'
+        webtorrentEnabled:
           type: boolean
         autoPlayVideo:
           type: boolean
         role:
-          type: integer
-          enum:
-            - 0
-            - 1
-            - 2
-          description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
+          $ref: '#/components/schemas/UserRole'
         roleLabel:
           type: string
           enum:
@@ -2627,6 +2832,24 @@ components:
           type: number
         videoQuotaDaily:
           type: number
+        videosCount:
+          type: number
+        videoAbusesCount:
+          type: number
+        videoAbusesAcceptedCount:
+          type: number
+        videoAbusesCreatedCount:
+          type: number
+        videoCommentsCount:
+          type: number
+        noInstanceConfigWarningModal:
+          type: boolean
+        noWelcomeModal:
+          type: boolean
+        blocked:
+          type: boolean
+        blockedReason:
+          type: string
         createdAt:
           type: string
         account:
@@ -3092,12 +3315,7 @@ components:
           type: string
           description: 'The user daily video quota '
         role:
-          type: integer
-          enum:
-            - 0
-            - 1
-            - 2
-          description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
+          $ref: '#/components/schemas/UserRole'
       required:
         - username
         - password
@@ -3120,12 +3338,7 @@ components:
           type: string
           description: 'The updated daily video quota of the user '
         role:
-          type: integer
-          enum:
-            - 0
-            - 1
-            - 2
-          description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
+          $ref: '#/components/schemas/UserRole'
       required:
         - id
         - email