> ## Documentation Index
> Fetch the complete documentation index at: https://docs.convertly.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an HLS/DASH video stream

> Create an adaptive HLS/DASH streaming asset from a stored video file. Playback is authorized and delivered through Convertly's video CDN when the asset is ready.



## OpenAPI

````yaml /openapi.json post /api/video/streams
openapi: 3.1.0
info:
  title: Convertly API
  version: 1.0.0
  description: >-
    Convertly provides production API endpoints for media conversion,
    compression, Image CDN delivery, Forma AI, HLS/DASH video streaming, media
    tools, async jobs, workflows, webhooks, and Convertly Storage.
  license:
    name: Proprietary
    url: https://convertly.sh/terms
servers:
  - url: https://convertly.sh
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /api/video/streams:
    post:
      tags:
        - Video Streaming
      summary: Create an HLS/DASH video stream
      description: >-
        Create an adaptive HLS/DASH streaming asset from a stored video file.
        Playback is authorized and delivered through Convertly's video CDN when
        the asset is ready.
      operationId: createVideoStream
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVideoStreamRequest'
      responses:
        '202':
          description: Video stream accepted for processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoStreamResponse'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '402':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '429':
          $ref: '#/components/responses/Error'
        '500':
          $ref: '#/components/responses/Error'
        '503':
          $ref: '#/components/responses/Error'
components:
  schemas:
    CreateVideoStreamRequest:
      type: object
      required:
        - sourceFileId
      properties:
        sourceFileId:
          type: string
          format: uuid
          description: Stored video file id from Convertly Storage.
        profile:
          type: string
          enum:
            - basic
            - standard
            - hd
            - source_max
            - custom
          default: standard
        renditions:
          type: array
          items:
            $ref: '#/components/schemas/VideoStreamRenditionInput'
          description: Required when profile is custom.
        segmentDuration:
          type: integer
          minimum: 2
          maximum: 12
          default: 6
        access:
          type: string
          enum:
            - public
            - signed
          default: signed
        clip:
          $ref: '#/components/schemas/VideoStreamClip'
        packageFormats:
          type: array
          default:
            - hls
          minItems: 1
          maxItems: 2
          items:
            type: string
            enum:
              - hls
              - dash
          description: Packaging formats to generate. Include dash for DASH/CMAF output.
        videoCodec:
          type: string
          enum:
            - h264
            - av1
          default: h264
          description: >-
            Video codec for the stream. H.264 can use the configured managed
            provider; AV1 routes through Convertly's built-in packager.
        tokenTtlSeconds:
          type: integer
          minimum: 300
          maximum: 86400
          default: 3600
        allowedDomains:
          type: array
          maxItems: 25
          items:
            type: string
          description: Optional playback domain allowlist.
        captions:
          type: array
          maxItems: 20
          items:
            $ref: '#/components/schemas/VideoCaptionTrackInput'
    VideoStreamResponse:
      type: object
      properties:
        stream:
          $ref: '#/components/schemas/VideoStream'
    VideoStreamRenditionInput:
      type: object
      required:
        - height
        - bitrate
      properties:
        height:
          type: integer
          minimum: 144
          maximum: 2160
          example: 720
        bitrate:
          type: integer
          minimum: 150000
          maximum: 25000000
          example: 2800000
        audioBitrate:
          type: integer
          minimum: 64000
          maximum: 320000
          example: 128000
    VideoStreamClip:
      type: object
      properties:
        start:
          type: number
          minimum: 0
          example: 80
        end:
          type: number
          minimum: 0
          example: 125
        duration:
          type: number
          minimum: 0
          example: 45
        mode:
          type: string
          enum:
            - accurate
            - fast
          default: accurate
    VideoCaptionTrackInput:
      type: object
      required:
        - label
        - language
        - content
      properties:
        label:
          type: string
          maxLength: 80
          example: English
        language:
          type: string
          example: en
        kind:
          type: string
          enum:
            - subtitles
            - captions
          default: subtitles
        content:
          type: string
          description: WebVTT content. Convertly adds a WEBVTT header when missing.
    VideoStream:
      type: object
      properties:
        id:
          type: string
          format: uuid
        assetId:
          type: string
          format: uuid
        playbackId:
          type: string
        status:
          type: string
          enum:
            - pending
            - processing
            - ready
            - failed
            - deleted
        protocol:
          type: string
          enum:
            - hls
            - dash
            - hls_dash
        profile:
          type: string
        videoCodec:
          type: string
          enum:
            - h264
            - av1
          default: h264
        access:
          type: string
          enum:
            - public
            - signed
        duration:
          type:
            - number
            - 'null'
        width:
          type:
            - integer
            - 'null'
        height:
          type:
            - integer
            - 'null'
        manifestUrl:
          type:
            - string
            - 'null'
        posterUrl:
          type:
            - string
            - 'null'
        renditions:
          type: array
          items:
            $ref: '#/components/schemas/VideoStreamRendition'
        error:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        readyAt:
          type:
            - string
            - 'null'
          format: date-time
        packageFormats:
          type: array
          items:
            type: string
            enum:
              - hls
              - dash
        hlsManifestUrl:
          type:
            - string
            - 'null'
        dashManifestUrl:
          type:
            - string
            - 'null'
        tokenTtlSeconds:
          type:
            - integer
            - 'null'
        allowedDomains:
          type: array
          items:
            type: string
        captions:
          type: array
          items:
            $ref: '#/components/schemas/VideoCaptionTrack'
        analytics:
          type:
            - object
            - 'null'
          properties:
            events:
              type: integer
            plays:
              type: integer
    Error:
      type: object
      properties:
        error:
          type: string
        upgradeUrl:
          type: string
      required:
        - error
    VideoStreamRendition:
      type: object
      properties:
        id:
          type: string
          format: uuid
        width:
          type: integer
        height:
          type: integer
        bitrate:
          type: integer
        averageBitrate:
          type: integer
        codec:
          type: string
          example: h264
        audioCodec:
          type:
            - string
            - 'null'
          example: aac
        segmentCount:
          type: integer
    VideoCaptionTrack:
      type: object
      properties:
        id:
          type: string
          format: uuid
        label:
          type: string
        language:
          type: string
        kind:
          type: string
          enum:
            - subtitles
            - captions
        url:
          type:
            - string
            - 'null'
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Dashboard-generated Convertly API key. Keys currently begin with
        `cvly_`.
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Alternative API key header for server-side clients.

````