]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - support/doc/api/openapi.yaml
Exclude 0p from auto webtorrent quality
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
index 29e42064b43d92bc1abee0bef7d96eeb3074c93b..9434af9049097b15e9d76156bcde36d69582845a 100644 (file)
@@ -1,7 +1,7 @@
 openapi: 3.0.0
 info:
   title: PeerTube
-  version: 2.1.1
+  version: 2.2.0
   contact:
     name: PeerTube Community
     url: 'https://joinpeertube.org'
@@ -71,10 +71,13 @@ tags:
       Operations dealing with listing, uploading, fetching or modifying videos.
   - name: Search
     description: |
-      The search helps to find _videos_ from within the instance and beyond.
+      The search helps to find _videos_ or _channels_ 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.
+
+      Administrators can also enable the use of a remote search system, indexing
+      videos and channels not could be not federated by the instance.
   - name: Video Comments
     description: >
       Operations dealing with comments to a video. Comments are organized in
@@ -117,7 +120,7 @@ x-tagGroups:
   - name: Moderation
     tags:
       - Video Abuses
-      - Video Blacklist
+      - Video Blocks
   - name: Instance Configuration
     tags:
       - Config
@@ -1242,6 +1245,7 @@ paths:
       parameters:
         - $ref: '#/components/parameters/idOrUUID'
       requestBody:
+        required: true
         content:
           application/json:
             schema:
@@ -1250,6 +1254,28 @@ paths:
                 reason:
                   description: Reason why the user reports this video
                   type: string
+                predefinedReasons:
+                  description: Reason categories that help triage reports
+                  type: array
+                  items:
+                    type: string
+                    enum:
+                    - violentOrAbusive
+                    - hatefulOrAbusive
+                    - spamOrMisleading
+                    - privacy
+                    - rights
+                    - serverRules
+                    - thumbnails
+                    - captions
+                startAt:
+                  type: number
+                  description: Timestamp in the video that marks the beginning of the report
+                endAt:
+                  type: number
+                  description: Timestamp in the video that marks the ending of the report
+              required:
+                - reason
       responses:
         '204':
           description: successful operation
@@ -1973,13 +1999,57 @@ paths:
         - $ref: '#/components/parameters/skipCount'
         - $ref: '#/components/parameters/start'
         - $ref: '#/components/parameters/count'
+        - $ref: '#/components/parameters/searchTarget'
         - $ref: '#/components/parameters/videosSearchSort'
         - name: search
           in: query
           required: true
-          description: String to search
+          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
+        - name: startDate
+          in: query
+          required: true
+          description: Get videos that are published after this date
+          schema:
+            type: string
+            format: date-time
+        - name: endDate
+          in: query
+          required: true
+          description: Get videos that are published before this date
+          schema:
+            type: string
+            format: date-time
+        - name: originallyPublishedStartDate
+          in: query
+          required: true
+          description: Get videos that are originally published after this date
+          schema:
+            type: string
+            format: date-time
+        - name: originallyPublishedEndDate
+          in: query
+          required: true
+          description: Get videos that are originally published before this date
+          schema:
+            type: string
+            format: date-time
+        - name: durationMin
+          in: query
+          required: true
+          description: Get videos that have this minimum duration
+          schema:
+            type: number
+        - name: durationMax
+          in: query
+          required: true
+          description: Get videos that have this maximum duration
+          schema:
+            type: number
       responses:
         '200':
           description: successful operation
@@ -1987,6 +2057,34 @@ paths:
             application/json:
               schema:
                 $ref: '#/components/schemas/VideoListResponse'
+  /search/video-channels:
+    get:
+      tags:
+        - Search
+      summary: Search channels
+      parameters:
+        - $ref: '#/components/parameters/start'
+        - $ref: '#/components/parameters/count'
+        - $ref: '#/components/parameters/searchTarget'
+        - $ref: '#/components/parameters/sort'
+        - 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
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                type: array
+                items:
+                  $ref: '#/components/schemas/VideoChannel'
 servers:
   - url: 'https://peertube.cpy.re/api/v1'
     description: Live Test Server (live data - stable version)
@@ -2017,6 +2115,26 @@ components:
       description: Sort column (-createdAt for example)
       schema:
         type: string
+    searchTarget:
+      name: searchTarget
+      in: query
+      required: false
+      description: >
+        If the administrator enabled search index support, you can override the default search target.
+
+
+        **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
+        It means the instance may not know the objects you fetched. If you want to load video/channel information:
+          * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
+          then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
+          After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
+          * If the current user has not the ability to make a remote URI search, then redirect the user on the origin instance or fetch
+          the data from the origin instance API
+      schema:
+        type: string
+        enum:
+          - 'local'
+          - 'search-index'
     videosSort:
       name: sort
       in: query
@@ -2393,6 +2511,19 @@ components:
           $ref: '#/components/schemas/VideoAbuseStateSet'
         label:
           type: string
+    VideoAbusePredefinedReasons:
+      type: array
+      items:
+        type: string
+        enum:
+        - violentOrAbusive
+        - hatefulOrAbusive
+        - spamOrMisleading
+        - privacy
+        - rights
+        - serverRules
+        - thumbnails
+        - captions
 
     VideoResolutionConstant:
       properties:
@@ -2474,6 +2605,8 @@ components:
           type: string
         fps:
           type: number
+        metadataUrl:
+          type: string
     VideoStreamingPlaylists:
       properties:
         id:
@@ -2487,6 +2620,10 @@ components:
           type: string
         segmentsSha256Url:
           type: string
+        files:
+          type: array
+          items:
+            $ref: '#/components/schemas/VideoFile'
         redundancies:
           type: array
           items:
@@ -2638,6 +2775,8 @@ components:
           type: number
         reason:
           type: string
+        predefinedReasons:
+          $ref: '#/components/schemas/VideoAbusePredefinedReasons'
         reporterAccount:
           $ref: '#/components/schemas/Account'
         state: