TwelveLabs Videos API

Manage videos within an index.

OpenAPI Specification

twelvelabs-videos-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: TwelveLabs Analyze Videos API
  description: REST API for the TwelveLabs video-understanding platform. Upload and index video, run any-to-video semantic search (Marengo), generate text from video (Pegasus) - open-ended analysis, gist, and summaries - and create multimodal embeddings. All requests are authenticated with an `x-api-key` header.
  termsOfService: https://www.twelvelabs.io/terms-of-use
  contact:
    name: TwelveLabs Support
    url: https://docs.twelvelabs.io
    email: support@twelvelabs.io
  version: '1.3'
servers:
- url: https://api.twelvelabs.io/v1.3
security:
- apiKeyAuth: []
tags:
- name: Videos
  description: Manage videos within an index.
paths:
  /indexes/{index_id}/videos:
    get:
      operationId: listVideos
      tags:
      - Videos
      summary: List videos
      description: Returns the videos indexed within the specified index.
      parameters:
      - $ref: '#/components/parameters/IndexId'
      - name: page
        in: query
        schema:
          type: integer
          default: 1
      - name: page_limit
        in: query
        schema:
          type: integer
          default: 10
          maximum: 50
      - name: sort_by
        in: query
        schema:
          type: string
          enum:
          - created_at
          - updated_at
          default: created_at
      - name: sort_option
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
          default: desc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Video'
                  page_info:
                    $ref: '#/components/schemas/PageInfo'
  /indexes/{index_id}/videos/{video_id}:
    get:
      operationId: retrieveVideo
      tags:
      - Videos
      summary: Retrieve video information
      parameters:
      - $ref: '#/components/parameters/IndexId'
      - $ref: '#/components/parameters/VideoId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video'
    put:
      operationId: updateVideo
      tags:
      - Videos
      summary: Update video information
      description: Updates the title and user metadata of the specified video.
      parameters:
      - $ref: '#/components/parameters/IndexId'
      - $ref: '#/components/parameters/VideoId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                video_title:
                  type: string
                user_metadata:
                  type: object
                  additionalProperties: true
      responses:
        '200':
          description: OK
    delete:
      operationId: deleteVideo
      tags:
      - Videos
      summary: Delete a video
      parameters:
      - $ref: '#/components/parameters/IndexId'
      - $ref: '#/components/parameters/VideoId'
      responses:
        '204':
          description: No Content
components:
  schemas:
    PageInfo:
      type: object
      properties:
        limit_per_page:
          type: integer
        total_results:
          type: integer
        page:
          type: integer
        total_page:
          type: integer
        next_page_token:
          type: string
        prev_page_token:
          type: string
    Video:
      type: object
      properties:
        _id:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        indexed_at:
          type: string
          format: date-time
        system_metadata:
          type: object
          properties:
            duration:
              type: number
            filename:
              type: string
            fps:
              type: number
            height:
              type: integer
            width:
              type: integer
            video_title:
              type: string
        user_metadata:
          type: object
          additionalProperties: true
        hls:
          type: object
          properties:
            video_url:
              type: string
            thumbnail_urls:
              type: array
              items:
                type: string
            status:
              type: string
  parameters:
    IndexId:
      name: index_id
      in: path
      required: true
      schema:
        type: string
      description: Unique identifier of the index.
    VideoId:
      name: video_id
      in: path
      required: true
      schema:
        type: string
      description: Unique identifier of the video.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: TwelveLabs API key sent in the `x-api-key` request header.