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

# Create Voice Over Video

> Makes an MP4 video from an approved voice over: one generated image per sentence of the script, with its audio, captions if you want them, and a Hamsa logo. 1080×1920 for `9:16`, 1920×1080 for `16:9`. It is made in the background: follow it in `voiceOverVideos` of Get Voice Over until `status` is `COMPLETED` (then `videoUrl` is set) or `FAILED`. A video that makes no progress for 20 minutes fails. You are charged only when it completes. Voice overs belong to the person who made them: an API key sees and changes the voice overs of its creator in its project.

Needs **Create** on **Voice overs** (`voice_overs:create`).



## OpenAPI

````yaml /api-reference/openapi.json post /v2/voice-overs/{id}/videos
openapi: 3.0.1
info:
  title: Hamsa API
  description: >-
    The Hamsa API: voice agents and their calls, phone numbers, batch calls and
    knowledge bases; speech to text, text to speech, voices and AI content.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tryhamsa.com
security: []
paths:
  /v2/voice-overs/{id}/videos:
    post:
      tags: []
      summary: Make a video from a voice over
      description: >-
        Makes an MP4 video from an approved voice over: one generated image per
        sentence of the script, with its audio, captions if you want them, and a
        Hamsa logo. 1080×1920 for `9:16`, 1920×1080 for `16:9`. It is made in
        the background: follow it in `voiceOverVideos` of Get Voice Over until
        `status` is `COMPLETED` (then `videoUrl` is set) or `FAILED`. A video
        that makes no progress for 20 minutes fails. You are charged only when
        it completes. Voice overs belong to the person who made them: an API key
        sees and changes the voice overs of its creator in its project.


        Needs **Create** on **Voice overs** (`voice_overs:create`).
      parameters:
        - in: path
          name: id
          required: true
          description: The voice over.
          schema:
            type: string
            format: uuid
            example: bd0ebca4-a16e-488b-b195-4690792259c7
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - voiceOverSuggestionId
                - style
              properties:
                voiceOverSuggestionId:
                  type: string
                  format: uuid
                  description: The approved take.
                  example: c816c6f6-9d49-4b5d-8c87-4a7a24fc8af1
                style:
                  type: string
                  enum:
                    - REALISTIC
                    - CARTOON
                    - INFO_GRAPHIC
                  description: >-
                    The look of the images. `CARTOON` picks one of three cartoon
                    styles at random.
                  example: REALISTIC
                aspectRatio:
                  type: string
                  enum:
                    - '9:16'
                    - '16:9'
                  default: '9:16'
                  example: '9:16'
                includeSubtitles:
                  type: boolean
                  example: true
                  default: true
                captionStyle:
                  type: string
                  enum:
                    - WORD_BY_WORD
                    - BUILD_UP
                    - FULL_SENTENCE
                  description: >-
                    How captions appear. Required while `includeSubtitles` is
                    `true`; ignored otherwise.
                  example: WORD_BY_WORD
                captionBox:
                  type: boolean
                  default: true
                  description: A rounded box behind the captions.
                  example: true
                transition:
                  type: string
                  enum:
                    - FADE
                    - DISSOLVE
                    - SLIDE_LEFT
                    - SLIDE_RIGHT
                    - CIRCLE_OPEN
                    - WIPE_LEFT
                    - ZOOM_IN
                  description: >-
                    The transition between images. Leave it out for straight
                    cuts.
                  example: FADE
                kenBurnsEnabled:
                  type: boolean
                  default: false
                  description: A slow zoom on each image.
                  example: false
                prompt:
                  type: string
                  maxLength: 1000
                  description: >-
                    Design guidance applied to every image, up to 1000
                    characters.
                  example: Warm morning light, a busy street café
      responses:
        '200':
          description: Started.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: voice over video generation started
                  messageKey:
                    type: string
                    example: VoiceOverVideoGenerationStarted
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: The video.
                        example: 3e9a7c21-5b4d-4f8e-a1c2-7d6e5f4a3b29
                      status:
                        type: string
                        example: IN_PROGRESS
        '400':
          description: >-
            Invalid body, for example "captionStyle field is required!"
            (subtitles are on by default) or "style must be one of: REALISTIC,
            CARTOON, INFO_GRAPHIC".
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '402':
          description: >-
            Your balance has run out ("Balance is insufficient, please renew or
            upgrade your plan!").
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '403':
          description: >-
            The key's scopes don't allow this (it needs `voice_overs:create`),
            or the project is deactivated (only reading works then).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '404':
          description: >-
            No such voice over of yours ("Not found"), it isn't `APPROVED` ("Can
            not generate video for this voice over suggestion"), or the take
            isn't its approved one ("Voice over suggestion is not approved").
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '500':
          description: Server Side Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ErrorSchema:
      type: object
      properties:
        code:
          type: integer
          description: >-
            Service error code: the HTTP status with a service prefix (for
            example `8404`). Missing when the service has no code for that
            status.
          example: 8404
        message:
          type: string
          description: >-
            What went wrong. Some services (calls and recordings) put the error
            key here, for example `CallNotFoundOrUnavailable`, and send no
            `messageKey`.
          example: Policy not found!
        messageKey:
          type: string
          description: >-
            Stable key for the error, safe to match on in code. Not returned by
            every service.
          example: PolicyNotFound
        params:
          type: object
          additionalProperties: true
          description: >-
            Details for some errors (for example `reason`). Not returned by
            every service.
          example:
            reason: NO_DRAFT
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass the API key in the Authorization header, You need to put Token
        keyword before the API key. e.g. 'Authorization: Token <api-key>'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.