]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - support/doc/api/openapi.yaml
fix diff order
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
index 86dfae69d84631dd5fbef0828c1ff6857672e962..59ca8b29a9305f16a8fe3af1fd50fac86c05fff9 100644 (file)
@@ -4,11 +4,19 @@ info:
   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
@@ -17,31 +25,30 @@ paths:
       produces:
         - application/json
       parameters:
-        - name: id
-          in: path
-          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: 'stopping page'
-        - name: sort
-          in: query
-          required: false
-          type: number
-          description: 'sorting'
+        - $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:
@@ -70,35 +77,54 @@ paths:
           description: successful operation
           schema:
             $ref: '#/definitions/ServerConfig'
-  /jobs:
+  /feeds/videos.{format}:
     get:
       tags:
-        - Job
-      consumes:
-        - application/json
+        - Feeds
       produces:
+        - application/atom+xml
+        - application/rss+xml
         - application/json
       parameters:
-        - name: state
+        - name: format
           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
+          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: ''
-        - name: sort
+          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: number
-          description: 'sorting'
+          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
@@ -108,6 +134,8 @@ paths:
               $ref: '#/definitions/Job'
   '/server/following/{host}':
     delete:
+      security:
+        - OAuth2: [ ]
       tags:
         - ServerFollowing
       consumes:
@@ -132,21 +160,9 @@ paths:
       produces:
         - application/json
       parameters:
-        - name: start
-          in: query
-          required: false
-          type: number
-          description: 'starting page'
-        - name: stop
-          in: query
-          required: false
-          type: number
-          description: 'stopping page'
-        - name: sort
-          in: query
-          required: false
-          type: number
-          description: 'sorting'
+        - $ref: "commons.yaml#/parameters/start"
+        - $ref: "commons.yaml#/parameters/count"
+        - $ref: "commons.yaml#/parameters/sort"
       responses:
         '200':
           description: successful operation
@@ -163,21 +179,9 @@ paths:
       produces:
         - application/json
       parameters:
-        - name: start
-          in: query
-          required: false
-          type: number
-          description: 'starting page'
-        - name: stop
-          in: query
-          required: false
-          type: number
-          description: 'stopping page'
-        - name: sort
-          in: query
-          required: false
-          type: number
-          description: 'sorting'
+        - $ref: "commons.yaml#/parameters/start"
+        - $ref: "commons.yaml#/parameters/count"
+        - $ref: "commons.yaml#/parameters/sort"
       responses:
         '200':
           description: successful operation
@@ -186,6 +190,8 @@ paths:
             items:
               $ref: '#/definitions/Follow'
     post:
+      security:
+        - OAuth2: [ ]
       tags:
         - ServerFollowing
       consumes:
@@ -199,9 +205,11 @@ paths:
             $ref: '#/definitions/Follow'
       responses:
         '204':
-          description: successful operation
+          $ref: "commons.yaml#/responses/emptySuccess"
   /users:
     post:
+      security:
+        - OAuth2: [ ]
       tags:
         - User
       consumes:
@@ -221,6 +229,8 @@ paths:
           schema:
             $ref: '#/definitions/AddUserResponse'
     get:
+      security:
+        - OAuth2: [ ]
       tags:
         - User
       consumes:
@@ -228,21 +238,9 @@ paths:
       produces:
         - application/json
       parameters:
-        - name: start
-          in: query
-          required: false
-          type: number
-          description: 'starting page'
-        - name: stop
-          in: query
-          required: false
-          type: number
-          description: 'stopping page'
-        - name: sort
-          in: query
-          required: false
-          type: number
-          description: 'sorting'
+        - $ref: "commons.yaml#/parameters/start"
+        - $ref: "commons.yaml#/parameters/count"
+        - $ref: "commons.yaml#/parameters/sort"
       responses:
         '200':
           description: successful operation
@@ -252,6 +250,8 @@ paths:
               $ref: '#/definitions/User'
   '/users/{id}':
     delete:
+      security:
+        - OAuth2: [ ]
       tags:
         - User
       consumes:
@@ -259,15 +259,13 @@ paths:
       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:
@@ -275,17 +273,15 @@ paths:
       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:
@@ -293,11 +289,7 @@ paths:
       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
@@ -305,9 +297,11 @@ paths:
             $ref: '#/definitions/UpdateUser'
       responses:
         '204':
-          description: successful operation
+          $ref: "commons.yaml#/responses/emptySuccess"
   /users/me:
     get:
+      security:
+        - OAuth2: [ ]
       tags:
         - User
       consumes:
@@ -322,6 +316,8 @@ paths:
             items:
               $ref: '#/definitions/User'
     put:
+      security:
+        - OAuth2: [ ]
       tags:
         - User
       consumes:
@@ -336,9 +332,11 @@ paths:
             $ref: '#/definitions/UpdateMe'
       responses:
         '204':
-          description: successful operation
+          $ref: "commons.yaml#/responses/emptySuccess"
   /users/me/video-quota-used:
     get:
+      security:
+        - OAuth2: [ ]
       tags:
         - User
       consumes:
@@ -353,6 +351,8 @@ paths:
             type: number
   '/users/me/videos/{videoId}/rating':
     get:
+      security:
+        - OAuth2: [ ]
       tags:
         - User
       consumes:
@@ -372,6 +372,8 @@ paths:
             $ref: '#/definitions/GetMeVideoRating'
   /users/me/videos:
     get:
+      security:
+        - OAuth2: [ ]
       tags:
         - User
       consumes:
@@ -379,21 +381,9 @@ paths:
       produces:
         - application/json
       parameters:
-        - name: start
-          in: query
-          required: false
-          type: number
-          description: 'starting page'
-        - name: stop
-          in: query
-          required: false
-          type: number
-          description: 'stopping page'
-        - name: sort
-          in: query
-          required: false
-          type: number
-          description: 'sorting'
+        - $ref: "commons.yaml#/parameters/start"
+        - $ref: "commons.yaml#/parameters/count"
+        - $ref: "commons.yaml#/parameters/sort"
       responses:
         '200':
           description: successful operation
@@ -417,9 +407,11 @@ paths:
             $ref: '#/definitions/RegisterUser'
       responses:
         '204':
-          description: successful operation
+          $ref: "commons.yaml#/responses/emptySuccess"
   /users/me/avatar/pick:
     post:
+      security:
+        - OAuth2: [ ]
       tags:
         - User
       consumes:
@@ -445,21 +437,14 @@ paths:
       produces:
         - application/json
       parameters:
-        - name: start
-          in: query
-          required: false
-          type: number
-          description: 'starting page'
-        - name: stop
-          in: query
-          required: false
-          type: number
-          description: 'stopping page'
-        - name: sort
+        - name: category
           in: query
           required: false
           type: number
-          description: 'sorting'
+          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
@@ -527,39 +512,10 @@ paths:
             type: array
             items:
               type: string
-  /videos/search:
-    get:
-      tags:
-        - Video
-      consumes:
-        - 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: 'stopping page'
-        - name: sort
-          in: query
-          required: false
-          type: number
-          description: 'sorting'
-      responses:
-        '200':
-          description: successful operation
-          schema:
-            type: array
-            items:
-              $ref: '#/definitions/Video'
   "/videos/{id}":
     put:
+      security:
+        - OAuth2: [ ]
       tags:
         - Video
       consumes:
@@ -567,60 +523,21 @@ paths:
       produces:
         - application/json
       parameters:
-        - name: id
-          in: path
-          required: true
-          type: string
-          description: 'The video id'
-        - name: thumbnailfile
-          in: formData
-          type: file
-          description: 'Video thumbnail file'
-        - name: previewfile
-          in: formData
-          type: file
-          description: 'Video preview file'
-        - name: category
-          in: formData
-          type: number
-          description: 'Video category'
-        - name: licence
-          in: formData
-          type: number
-          description: 'Video licence'
-        - name: language
-          in: formData
-          type: number
-          description: 'Video language'
-        - name: description
-          in: formData
-          type: string
-          description: 'Video description'
-        - name: support
-          in: formData
-          type: string
-          description: 'Text describing how to support the video uploader'
-        - name: nsfw
-          in: formData
-          type: boolean
-          description: 'Whether or not this video contains sensitive content'
-        - name: name
-          in: formData
-          type: string
-          description: 'Video name'
-        - name: tags
-          in: formData
-          type: string[]
-          description: 'Video tags'
-        - name: commentsEnabled
-          in: formData
-          type: boolean
-          description: 'Enable or disable comments for this video'
-        - name: privacy
-          in: formData
-          type: string
-          enum: [Public, Unlisted, Private]
-          description: 'Video privacy'
+        - $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
@@ -634,17 +551,15 @@ paths:
       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:
@@ -652,14 +567,10 @@ paths:
       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:
@@ -669,11 +580,7 @@ paths:
       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
@@ -688,16 +595,14 @@ paths:
       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:
@@ -710,65 +615,25 @@ paths:
           type: file
           required: true
           description: 'Video file'
-        - name: thumbnailfile
-          in: formData
-          type: file
-          required: true
-          description: 'Video thumbnail file'
-        - name: previewfile
-          in: formData
-          type: file
-          required: true
-          description: 'Video preview file'
-        - name: category
-          in: formData
-          type: number
-          description: 'Video category'
-        - name: licence
-          in: formData
-          type: number
-          description: 'Video licence'
-        - name: language
-          in: formData
-          type: number
-          description: 'Video language'
-        - name: description
-          in: formData
-          type: string
-          description: 'Video description'
-        - name: support
-          in: formData
-          type: string
-          description: 'Text describing how to support the video uploader'
         - name: channelId
           in: formData
           required: true
           type: number
           description: 'Channel id that will contain this video'
-        - name: nsfw
-          in: formData
-          required: true
-          type: boolean
-          description: 'Whether or not this video contains sensitive content'
-        - name: name
-          in: formData
-          required: true
-          type: string
-          description: 'Video name'
-        - name: tags
-          in: formData
-          type: string[]
-          description: 'Video tags'
-        - name: commentsEnabled
-          in: formData
-          type: boolean
-          description: 'Enable or disable comments for this video'
-        - name: privacy
-          in: formData
-          required: true
-          type: string
-          enum: [Public, Unlisted, Private]
-          description: 'Video privacy'
+        - $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
@@ -776,6 +641,8 @@ paths:
             $ref: '#/definitions/VideoUploadResponse'
   /videos/abuse:
     get:
+      security:
+        - OAuth2: [ ]
       tags:
         - VideoAbuse
       consumes:
@@ -783,21 +650,9 @@ paths:
       produces:
         - application/json
       parameters:
-        - name: start
-          in: query
-          required: false
-          type: number
-          description: 'starting page'
-        - name: stop
-          in: query
-          required: false
-          type: number
-          description: 'stopping page'
-        - name: sort
-          in: query
-          required: false
-          type: number
-          description: 'sorting'
+        - $ref: "commons.yaml#/parameters/start"
+        - $ref: "commons.yaml#/parameters/count"
+        - $ref: "commons.yaml#/parameters/sort"
       responses:
         '200':
           description: successful operation
@@ -807,6 +662,8 @@ paths:
               $ref: '#/definitions/VideoAbuse'
   "/videos/{id}/abuse":
     post:
+      security:
+        - OAuth2: [ ]
       tags:
         - VideoAbuse
       consumes:
@@ -814,16 +671,14 @@ paths:
       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:
@@ -831,15 +686,13 @@ paths:
       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:
@@ -847,16 +700,14 @@ paths:
       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:
@@ -864,21 +715,9 @@ paths:
       produces:
         - application/json
       parameters:
-        - name: start
-          in: query
-          required: false
-          type: number
-          description: 'starting page'
-        - name: stop
-          in: query
-          required: false
-          type: number
-          description: 'stopping page'
-        - name: sort
-          in: query
-          required: false
-          type: number
-          description: 'sorting'
+        - $ref: "commons.yaml#/parameters/start"
+        - $ref: "commons.yaml#/parameters/count"
+        - $ref: "commons.yaml#/parameters/sort"
       responses:
         '200':
           description: successful operation
@@ -886,7 +725,7 @@ paths:
             type: array
             items:
               $ref: '#/definitions/VideoBlacklist'
-  /videos/channels:
+  /video-channels:
     get:
       tags:
         - VideoChannel
@@ -895,21 +734,9 @@ paths:
       produces:
         - application/json
       parameters:
-        - name: start
-          in: query
-          required: false
-          type: number
-          description: 'starting page'
-        - name: stop
-          in: query
-          required: false
-          type: number
-          description: 'stopping page'
-        - name: sort
-          in: query
-          required: false
-          type: number
-          description: 'sorting'
+        - $ref: "commons.yaml#/parameters/start"
+        - $ref: "commons.yaml#/parameters/count"
+        - $ref: "commons.yaml#/parameters/sort"
       responses:
         '200':
           description: successful operation
@@ -918,6 +745,8 @@ paths:
             items:
               $ref: '#/definitions/VideoChannel'
     post:
+      security:
+        - OAuth2: [ ]
       tags:
         - VideoChannel
       consumes:
@@ -931,8 +760,8 @@ paths:
             $ref: '#/definitions/VideoChannelInput'
       responses:
         '204':
-          description: successful operation
-  "/videos/channels/{id}":
+          $ref: "commons.yaml#/responses/emptySuccess"
+  "/video-channels/{id}":
     get:
       tags:
         - VideoChannel
@@ -941,17 +770,15 @@ paths:
       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:
@@ -959,19 +786,17 @@ paths:
       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:
@@ -979,15 +804,26 @@ paths:
       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
@@ -996,11 +832,7 @@ paths:
       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
@@ -1008,7 +840,7 @@ paths:
             type: array
             items:
               $ref: '#/definitions/VideoChannel'
-  "/videos/{videoId}/comment-threads":
+  "/videos/{id}/comment-threads":
     get:
       tags:
         - VideoComment
@@ -1017,32 +849,18 @@ paths:
       produces:
         - application/json
       parameters:
-        - name: videoId
-          in: path
-          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: 'stopping page'
-        - name: sort
-          in: query
-          required: false
-          type: number
-          description: 'sorting'
+        - $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:
@@ -1050,17 +868,13 @@ paths:
       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
@@ -1069,23 +883,17 @@ paths:
       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:
@@ -1093,22 +901,16 @@ paths:
       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:
@@ -1116,21 +918,15 @@ paths:
       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:
@@ -1138,21 +934,47 @@ paths:
       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:
-  VideoConstant:
+  VideoConstantNumber:
     properties:
       id:
         type: number
       label:
         type: string
+  VideoConstantString:
+    properties:
+      id:
+        type: string
+      label:
+        type: string
   VideoPrivacy:
     type: string
     enum: [Public, Unlisted, Private]
@@ -1169,11 +991,11 @@ definitions:
       updatedAt:
         type: string
       category:
-        $ref: "#/definitions/VideoConstant"
+        $ref: "#/definitions/VideoConstantNumber"
       licence:
-        $ref: "#/definitions/VideoConstant"
+        $ref: "#/definitions/VideoConstantNumber"
       language:
-        $ref: "#/definitions/VideoConstant"
+        $ref: "#/definitions/VideoConstantString"
       privacy:
         $ref: "#/definitions/VideoPrivacy"
       description:
@@ -1266,17 +1088,13 @@ definitions:
         type: string
       isLocal:
         type: boolean
-      owner:
+      ownerAccount:
         type: object
         properties:
-          name:
-            type: string
+          id:
+            type: number
           uuid:
             type: string
-      videos:
-        type: array
-        items:
-          $ref: "#/definitions/Video"
   VideoComment:
     properties:
       id:
@@ -1565,4 +1383,4 @@ definitions:
       name:
         type: string
       description:
-        type: string
+        type: string
\ No newline at end of file