PeerTube Video API

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

OpenAPI Specification

peertube-video-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: PeerTube Abuses Video API
  version: 8.1.0
  contact:
    name: PeerTube Community
    url: https://joinpeertube.org
  license:
    name: AGPLv3.0
    url: https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE
  x-logo:
    url: https://joinpeertube.org/img/brand.png
    altText: PeerTube Project Homepage
  description: "The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite\nHTTP/REST library for your programming language to use PeerTube.\n\nSee the [REST API quick start](https://docs.joinpeertube.org/api/rest-getting-started) for a few\nexamples of using the PeerTube API.\n\n# Authentication\n\nWhen you sign up for an account on a PeerTube instance, you are given the possibility\nto generate sessions on it, and authenticate there using an access token. Only __one\naccess token can currently be used at a time__.\n\n## Roles\n\nAccounts are given permissions based on their role. There are three roles on\nPeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/admin/managing-users#roles) for a detail of their permissions.\n\n# Errors\n\nThe API uses standard HTTP status codes to indicate the success or failure\nof the API call, completed by a [RFC7807-compliant](https://tools.ietf.org/html/rfc7807) response body.\n\n```\nHTTP 1.1 404 Not Found\nContent-Type: application/problem+json; charset=utf-8\n\n{\n  \"detail\": \"Video not found\",\n  \"docs\": \"https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo\",\n  \"status\": 404,\n  \"title\": \"Not Found\",\n  \"type\": \"about:blank\"\n}\n```\n\nWe provide error `type` (following RFC7807) and `code` (internal PeerTube code) values for [a growing number of cases](https://github.com/Chocobozzz/PeerTube/blob/develop/packages/models/src/server/server-error-code.enum.ts),\nbut it is still optional. Types are used to disambiguate errors that bear the same status code\nand are non-obvious:\n\n```\nHTTP 1.1 403 Forbidden\nContent-Type: application/problem+json; charset=utf-8\n\n{\n  \"detail\": \"Cannot get this video regarding follow constraints\",\n  \"docs\": \"https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo\",\n  \"status\": 403,\n  \"title\": \"Forbidden\",\n  \"type\": \"https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/does_not_respect_follow_constraints\"\n}\n```\n\nHere a 403 error could otherwise mean that the video is private or blocklisted.\n\n### Validation errors\n\nEach parameter is evaluated on its own against a set of rules before the route validator\nproceeds with potential testing involving parameter combinations. Errors coming from validation\nerrors appear earlier and benefit from a more detailed error description:\n\n```\nHTTP 1.1 400 Bad Request\nContent-Type: application/problem+json; charset=utf-8\n\n{\n  \"detail\": \"Incorrect request parameters: id\",\n  \"docs\": \"https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo\",\n  \"instance\": \"/api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180\",\n  \"invalid-params\": {\n    \"id\": {\n      \"location\": \"params\",\n      \"msg\": \"Invalid value\",\n      \"param\": \"id\",\n      \"value\": \"9c9de5e8-0a1e-484a-b099-e80766180\"\n    }\n  },\n  \"status\": 400,\n  \"title\": \"Bad Request\",\n  \"type\": \"about:blank\"\n}\n```\n\nWhere `id` is the name of the field concerned by the error, within the route definition.\n`invalid-params.<field>.location` can be either 'params', 'body', 'header', 'query' or 'cookies', and\n`invalid-params.<field>.value` reports the value that didn't pass validation whose `invalid-params.<field>.msg`\nis about.\n\n### Deprecated error fields\n\nSome fields could be included with previous versions. They are still included but their use is deprecated:\n- `error`: superseded by `detail`\n\n# Rate limits\n\nWe are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators:\n\n| Endpoint (prefix: `/api/v1`) | Calls         | Time frame   |\n|------------------------------|---------------|--------------|\n| `/*`                         | 50            | 10 seconds   |\n| `POST /users/token`          | 15            | 5 minutes    |\n| `POST /users/register`       | 2<sup>*</sup> | 5 minutes    |\n| `POST /users/ask-send-verify-email` | 3      | 5 minutes    |\n\nDepending on the endpoint, <sup>*</sup>failed requests are not taken into account. A service\nlimit is announced by a `429 Too Many Requests` status code.\n\nYou can get details about the current state of your rate limit by reading the\nfollowing headers:\n\n| Header                  | Description                                                |\n|-------------------------|------------------------------------------------------------|\n| `X-RateLimit-Limit`     | Number of max requests allowed in the current time period  |\n| `X-RateLimit-Remaining` | Number of remaining requests in the current time period    |\n| `X-RateLimit-Reset`     | Timestamp of end of current time period as UNIX timestamp  |\n| `Retry-After`           | Seconds to delay after the first `429` is received         |\n\n# CORS\n\nThis API features [Cross-Origin Resource Sharing (CORS)](https://fetch.spec.whatwg.org/),\nallowing cross-domain communication from the browser for some routes:\n\n| Endpoint                    |\n|------------------------- ---|\n| `/api/*`                    |\n| `/download/*`               |\n| `/lazy-static/*`            |\n| `/.well-known/webfinger`    |\n\nIn addition, all routes serving ActivityPub are CORS-enabled for all origins.\n"
servers:
- url: https://peertube2.cpy.re
  description: Live Test Server (live data - latest nightly version)
- url: https://peertube3.cpy.re
  description: Live Test Server (live data - latest RC version)
- url: https://peertube.cpy.re
  description: Live Test Server (live data - stable version)
tags:
- name: Video
  description: 'Operations dealing with listing, uploading, fetching or modifying videos.

    '
paths:
  /api/v1/accounts/{name}/videos:
    get:
      tags:
      - Video
      summary: List videos of an account
      operationId: getAccountVideos
      parameters:
      - $ref: '#/components/parameters/name'
      - $ref: '#/components/parameters/start'
      - $ref: '#/components/parameters/count'
      - $ref: '#/components/parameters/skipCount'
      - $ref: '#/components/parameters/videosSort'
      - $ref: '#/components/parameters/nsfw'
      - $ref: '#/components/parameters/nsfwFlagsIncluded'
      - $ref: '#/components/parameters/nsfwFlagsExcluded'
      - $ref: '#/components/parameters/isLive'
      - $ref: '#/components/parameters/includeScheduledLive'
      - $ref: '#/components/parameters/categoryOneOf'
      - $ref: '#/components/parameters/licenceOneOf'
      - $ref: '#/components/parameters/languageOneOf'
      - $ref: '#/components/parameters/tagsOneOf'
      - $ref: '#/components/parameters/tagsAllOf'
      - $ref: '#/components/parameters/isLocal'
      - $ref: '#/components/parameters/include'
      - $ref: '#/components/parameters/hasHLSFiles'
      - $ref: '#/components/parameters/hasWebVideoFiles'
      - $ref: '#/components/parameters/host'
      - $ref: '#/components/parameters/autoTagOneOfVideo'
      - $ref: '#/components/parameters/stateOneOfVideo'
      - $ref: '#/components/parameters/privacyOneOf'
      - $ref: '#/components/parameters/excludeAlreadyWatched'
      - $ref: '#/components/parameters/search'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoListResponse'
      x-codeSamples:
      - lang: JavaScript
        source: "fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')\n.then(function(response) {\n  return response.json()\n}).then(function(data) {\n  console.log(data)\n})\n"
      - lang: Shell
        source: '## DEPENDENCIES: jq

          curl -s https://peertube2.cpy.re/api/v1/accounts/{name}/videos | jq

          '
      - lang: Ruby
        source: 'require ''net/http''

          require ''json''


          uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")


          http = Net::HTTP.new(uri.host, uri.port)

          http.use_ssl = true


          response = http.get(uri.request_uri)


          puts JSON.parse(response.read_body)

          '
      - lang: Python
        source: 'import requests


          r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")

          json = r.json()


          print(json)

          '
  /api/v1/videos/{id}/token:
    post:
      summary: Request video token
      operationId: requestVideoToken
      description: Request special tokens that expire quickly to use them in some context (like accessing private static files)
      tags:
      - Video
      security:
      - OAuth2: []
      parameters:
      - $ref: '#/components/parameters/idOrUUID'
      - $ref: '#/components/parameters/videoPasswordHeader'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTokenResponse'
        '400':
          description: incorrect parameters
        '404':
          description: video not found
  /api/v1/videos/{id}/studio/edit:
    post:
      summary: Create a studio task
      tags:
      - Video
      description: Create a task to edit a video  (cut, add intro/outro etc)
      security:
      - OAuth2: []
      parameters:
      - $ref: '#/components/parameters/idOrUUID'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VideoStudioCreateTask'
      responses:
        '204':
          description: successful operation
        '400':
          description: incorrect parameters
        '404':
          description: video not found
  /api/v1/videos:
    get:
      summary: List videos
      operationId: getVideos
      tags:
      - Video
      parameters:
      - $ref: '#/components/parameters/start'
      - $ref: '#/components/parameters/count'
      - $ref: '#/components/parameters/skipCount'
      - $ref: '#/components/parameters/videosSort'
      - $ref: '#/components/parameters/nsfw'
      - $ref: '#/components/parameters/nsfwFlagsIncluded'
      - $ref: '#/components/parameters/nsfwFlagsExcluded'
      - $ref: '#/components/parameters/isLive'
      - $ref: '#/components/parameters/includeScheduledLive'
      - $ref: '#/components/parameters/categoryOneOf'
      - $ref: '#/components/parameters/licenceOneOf'
      - $ref: '#/components/parameters/languageOneOf'
      - $ref: '#/components/parameters/tagsOneOf'
      - $ref: '#/components/parameters/tagsAllOf'
      - $ref: '#/components/parameters/isLocal'
      - $ref: '#/components/parameters/include'
      - $ref: '#/components/parameters/hasHLSFiles'
      - $ref: '#/components/parameters/hasWebVideoFiles'
      - $ref: '#/components/parameters/host'
      - $ref: '#/components/parameters/autoTagOneOfVideo'
      - $ref: '#/components/parameters/stateOneOfVideo'
      - $ref: '#/components/parameters/privacyOneOf'
      - $ref: '#/components/parameters/excludeAlreadyWatched'
      - $ref: '#/components/parameters/search'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoListResponse'
  /api/v1/videos/categories:
    get:
      summary: List available video categories
      operationId: getCategories
      tags:
      - Video
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
              examples:
                nightly:
                  externalValue: https://peertube2.cpy.re/api/v1/videos/categories
  /api/v1/videos/licences:
    get:
      summary: List available video licences
      operationId: getLicences
      tags:
      - Video
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
              examples:
                nightly:
                  externalValue: https://peertube2.cpy.re/api/v1/videos/licences
  /api/v1/videos/languages:
    get:
      summary: List available video languages
      operationId: getLanguages
      tags:
      - Video
      parameters:
      - name: scope
        in: query
        description: '**PeerTube >= 8.2** Filter languages by scope. Use `subtitle` to exclude sign languages and other languages that don''t make sense for subtitles.'
        required: false
        schema:
          type: string
          enum:
          - subtitle
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
              examples:
                nightly:
                  externalValue: https://peertube2.cpy.re/api/v1/videos/languages
  /api/v1/videos/privacies:
    get:
      summary: List available video privacy policies
      operationId: getVideoPrivacyPolicies
      tags:
      - Video
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
              examples:
                nightly:
                  externalValue: https://peertube2.cpy.re/api/v1/videos/privacies
  /api/v1/videos/{id}:
    put:
      summary: Update a video
      operationId: putVideo
      security:
      - OAuth2: []
      tags:
      - Video
      parameters:
      - $ref: '#/components/parameters/idOrUUID'
      responses:
        '204':
          description: successful operation
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                channelId:
                  type: integer
                  description: New channel of the video. The channel must be owned by the same account as the previous one. Use the "change ownership" endpoints to give a video to a channel owned by another account on the local PeerTube instance.
                thumbnailfile:
                  description: Video thumbnail file
                  type: string
                  format: binary
                previewfile:
                  description: Deprecated in PeerTube v8.1, use thumbnailfile instead
                  deprecated: true
                  type: string
                  format: binary
                category:
                  $ref: '#/components/schemas/VideoCategorySet'
                licence:
                  $ref: '#/components/schemas/VideoLicenceSet'
                language:
                  $ref: '#/components/schemas/VideoLanguageSet'
                privacy:
                  $ref: '#/components/schemas/VideoPrivacySet'
                description:
                  description: Video description
                  type: string
                waitTranscoding:
                  description: Whether or not we wait transcoding before publish the video
                  type: string
                support:
                  description: A text tell the audience how to support the video creator
                  example: Please support our work on https://soutenir.framasoft.org/en/ <3
                  type: string
                nsfw:
                  description: Whether or not this video contains sensitive content
                  type: boolean
                nsfwSummary:
                  description: More information about the sensitive content of the video
                nsfwFlags:
                  $ref: '#/components/schemas/NSFWFlag'
                name:
                  description: Video name
                  type: string
                  minLength: 3
                  maxLength: 120
                tags:
                  description: Video tags (maximum 5 tags each between 2 and 30 characters)
                  type: array
                  minItems: 1
                  maxItems: 5
                  items:
                    type: string
                    minLength: 2
                    maxLength: 30
                commentsPolicy:
                  $ref: '#/components/schemas/VideoCommentsPolicySet'
                downloadEnabled:
                  description: Enable or disable downloading for this video
                  type: boolean
                originallyPublishedAt:
                  description: Date when the content was originally published
                  type: string
                  format: date-time
                  nullable: true
                scheduleUpdate:
                  $ref: '#/components/schemas/VideoScheduledUpdate'
                videoPasswords:
                  $ref: '#/components/schemas/AddVideoPasswords'
            encoding:
              thumbnailfile:
                contentType: image/jpeg
              previewfile:
                contentType: image/jpeg
              tags:
                style: form
                explode: true
    get:
      summary: Get a video
      operationId: getVideo
      tags:
      - Video
      parameters:
      - $ref: '#/components/parameters/idOrUUID'
      - $ref: '#/components/parameters/videoPasswordHeader'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoDetails'
        '401':
          description: Requires authentication or the video requires a password
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
        '403':
          description: Invalid authentication or the video requires a password
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
    delete:
      summary: Delete a video
      operationId: delVideo
      security:
      - OAuth2: []
      tags:
      - Video
      parameters:
      - $ref: '#/components/parameters/idOrUUID'
      responses:
        '204':
          description: successful operation
  /api/v1/videos/{id}/views:
    post:
      summary: Notify user is watching a video
      description: Call this endpoint regularly (every 5-10 seconds for example) to notify the server the user is watching the video. After a while, PeerTube will increase video's viewers counter. If the user is authenticated, PeerTube will also store the current player time.
      operationId: addView
      tags:
      - Video
      parameters:
      - $ref: '#/components/parameters/idOrUUID'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserViewingVideo'
        required: true
      responses:
        '204':
          description: successful operation
  /api/v1/videos/upload:
    post:
      summary: Upload a video
      description: Uses a single request to upload a video.
      operationId: uploadLegacy
      security:
      - OAuth2: []
      tags:
      - Video
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoUploadResponse'
        '403':
          description: video didn't pass upload filter
        '408':
          description: upload has timed out
        '413':
          x-summary: video file too large, due to quota or max body size limit set by the reverse-proxy
          description: 'If the response has no body, it means the reverse-proxy didn''t let it through. Otherwise disambiguate via `code`:

            - `quota_reached` for quota limits whether daily or global

            '
          headers:
            X-File-Maximum-Size:
              schema:
                type: string
                format: Nginx size
              description: Maximum file size for the video
        '415':
          description: video type unsupported
        '422':
          description: video unreadable
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VideoUploadRequestLegacy'
            encoding:
              videofile:
                contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
              thumbnailfile:
                contentType: image/jpeg
              previewfile:
                contentType: image/jpeg
      x-codeSamples:
      - lang: Shell
        source: "## DEPENDENCIES: jq\nUSERNAME=\"<your_username>\"\nPASSWORD=\"<your_password>\"\nFILE_PATH=\"<your_file_path>\"\nCHANNEL_ID=\"<your_channel_id>\"\nNAME=\"<video_name>\"\nAPI=\"https://peertube2.cpy.re/api/v1\"\n\n## AUTH\nclient_id=$(curl -s \"$API/oauth-clients/local\" | jq -r \".client_id\")\nclient_secret=$(curl -s \"$API/oauth-clients/local\" | jq -r \".client_secret\")\ntoken=$(curl -s \"$API/users/token\" \\\n  --data client_id=\"$client_id\" \\\n  --data client_secret=\"$client_secret\" \\\n  --data grant_type=password \\\n  --data username=\"$USERNAME\" \\\n  --data password=\"$PASSWORD\" \\\n  | jq -r \".access_token\")\n\n## VIDEO UPLOAD\ncurl -s \"$API/videos/upload\" \\\n  -H \"Authorization: Bearer $token\" \\\n  --max-time 600 \\\n  --form videofile=@\"$FILE_PATH\" \\\n  --form channelId=$CHANNEL_ID \\\n  --form name=\"$NAME\"\n"
  /api/v1/videos/upload-resumable:
    post:
      summary: Initialize the resumable upload of a video
      description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to initialize the upload of a video
      operationId: uploadResumableInit
      security:
      - OAuth2: []
      tags:
      - Video
      parameters:
      - $ref: '#/components/parameters/resumableUploadInitContentLengthHeader'
      - $ref: '#/components/parameters/resumableUploadInitContentTypeHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoUploadRequestResumable'
      responses:
        '200':
          description: file already exists, send a [`resume`](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) request instead
        '201':
          description: created
          headers:
            Location:
              schema:
                type: string
                format: url
                example: /api/v1/videos/upload-resumable?upload_id=471e97554f21dec3b8bb5d4602939c51
            Content-Length:
              schema:
                type: number
                example: 0
        '413':
          x-summary: video file too large, due to quota, absolute max file size or concurrent partial upload limit
          description: 'Disambiguate via `code`:

            - `max_file_size_reached` for the absolute file size limit

            - `quota_reached` for quota limits whether daily or global

            '
        '415':
          description: video type unsupported
    put:
      summary: Send chunk for the resumable upload of a video
      description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to continue, pause or resume the upload of a video
      operationId: uploadResumable
      security:
      - OAuth2: []
      tags:
      - Video
      parameters:
      - $ref: '#/components/parameters/resumableUploadId'
      - $ref: '#/components/parameters/resumableUploadChunkContentRangeHeader'
      - $ref: '#/components/parameters/resumableUploadChunkContentLengthHeader'
      requestBody:
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: last chunk received
          headers:
            Content-Length:
              schema:
                type: number
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoUploadResponse'
        '308':
          description: resume incomplete
          headers:
            Range:
              schema:
                type: string
                example: bytes=0-262143
            Content-Length:
              schema:
                type: number
                example: 0
        '403':
          description: video didn't pass upload filter
        '404':
          description: upload not found
        '409':
          description: chunk doesn't match range
        '422':
          description: video unreadable
        '429':
          description: too many concurrent requests
        '503':
          description: upload is already being processed
          headers:
            Retry-After:
              schema:
                type: number
                example: 300
    delete:
      summary: Cancel the resumable upload of a video, deleting any data uploaded so far
      description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the upload of a video
      operationId: uploadResumableCancel
      security:
      - OAuth2: []
      tags:
      - Video
      parameters:
      - $ref: '#/components/parameters/resumableUploadId'
      - name: Content-Length
        in: header
        required: true
        schema:
          type: number
          example: 0
      responses:
        '204':
          description: upload cancelled
          headers:
            Content-Length:
              schema:
                type: number
                example: 0
        '404':
          description: upload not found
  /api/v1/videos/live:
    post:
      summary: Create a live
      operationId: addLive
      security:
      - OAuth2: []
      tags:
      - Video
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoUploadResponse'
        '400':
          x-summary: validation error, or conflicting `saveReplay` and `permanentLive` parameter set
          description: 'Disambiguate via `code`:

            - default type for a validation error

            - `live_conflicting_permanent_and_save_replay` for conflicting parameters set

            '
        '403':
          x-summary: live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded
          description: 'Disambiguate via `code`:

            - `live_not_enabled` for a disabled live feature

            - `live_not_allowing_replay` for a disabled replay feature

            - `max_instance_lives_limit_reached` for the absolute concurrent live limit

            - `max_user_lives_limit_reached` for the user concurrent live limit

            '
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                channelId:
                  description: Channel id that will contain this live video
                  type: integer
                saveReplay:
                  type: boolean
                replaySettings:
                  $ref: '#/components/schemas/LiveVideoReplaySettings'
                permanentLive:
                  description: User can stream multiple times in a permanent live
                  type: boolean
                latencyMode:
                  description: User can select live latency mode if enabled by the instance
                  allOf:
                  - $ref: '#/components/schemas/LiveVideoLatencyMode'
                thumbnailfile:
                  description: Live video/replay thumbnail file
                  type: string
                  format: binary
                previewfile:
                  description: Deprecated in PeerTube v8.1, use thumbnailfile instead
                  deprecated: true
                  type: string
                  format: binary
                privacy:
                  $ref: '#/components/schemas/VideoPrivacySet'
                category:
                  $ref: '#/components/schemas/VideoCategorySet'
                licence:
                  $ref: '#/components/schemas/VideoLicenceSet'
                language:
                  $ref: '#/components/schemas/VideoLanguageSet'
                description:
                  description: Live video/replay description
                  type: string
                support:
                  description: A text tell the audience how to support the creator
                  example: Please support our work on https://soutenir.framasoft.org/en/ <3
                  type: string
                nsfw:
                  description: Whether or not this live video/replay contains sensitive content
                  type: boolean
                nsfwSummary:
                  description: More information about the sensitive content of the video
                nsfwFlags:
                  $ref: '#/components/schemas/NSFWFlag'
                name:
                  description: Live video/replay name
                  type: string
                  minLength: 3
                  maxLength: 120
                tags:
                  description: Live video/replay tags (maximum 5 tags each between 2 and 30 characters)
                  type: array
                  minItems: 1
                  maxItems: 5
                  items:
                    type: string
                    minLength: 2
                    maxLength: 30
                commentsPolicy:
                  $ref: '#/components/schemas/VideoCommentsPolicySet'
                downloadEnabled:
                  description: Enable or disable downloading for the replay of this live video
                  type: boolean
                schedules:
                  type: array
                  items:
                    $ref: '#/components/schemas/LiveSchedule'
              required:
              - channelId
              - name
            encoding:
              thumbnailfile:
                contentType: image/jpeg
              previewfile:
                contentType: image/jpeg
  /api/v1/videos/live/{id}:
    get:
      summary: Get information about a live
      operationId: getLiveId
      security:
      - OAuth2: []
      tags:
      - Video
      parameters:
      - $ref: '#/components/parameters/idOrUUID'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LiveVideoResponse'
    put:
      summary: Update information about a live
      operationId: updateLiveId
      security:
      - OAuth2: []
      tags:
      - Video
      parameters:
      - $ref: '#/components/parameters/idOrUUID'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LiveVideoUpdate'
      responses:
        '204':
          description: successful operation
        '400':
          description: bad parameters or trying to update a live that has already started
        '403':
          description: trying to save replay of the live but saving replay is not enabled on the instance
  /api/v1/videos/{id}/source:
    get:
      summary: Get video source file metadata
      description: Get metadata and download link of original video file
      operationId: getVideoSource
      security:
      - OAuth2: []
      tags:
      - Video
      parameters:
      - $ref: '#/components/parameters/idOrUUID'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoSource'
  /api/v1/videos/{id}/source/file:
    delete:
      summary: Delete video source file
      operationId: delete

# --- truncated at 32 KB (87 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/peertube/refs/heads/main/openapi/peertube-video-api-openapi.yml