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

# Create Template to Video Task

<Tip>
  Read [Templates](/resources/templates) to see all available templates
</Tip>


## OpenAPI

````yaml POST /v1/video/template2video
openapi: 3.1.0
info:
  title: DomoAI Enterprise API
  version: 0.15.0
  description: >-
    When an organization is in the BANNED state, Open APIs authenticated with a
    valid API key whose organization is banned return HTTP 403 with error code
    4002 and message "Organization is banned".
servers:
  - url: https://api.domoai.com
security: []
paths:
  /v1/video/template2video:
    post:
      tags:
        - AI Video
      summary: Template To Video
      operationId: template_to_video_v1_video_template2video_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTemplate2VideoTaskIn'
            examples:
              image_base64_string:
                summary: image base64 string to video
                value:
                  template: kissing_screen
                  prompt: The girl kiss the screen.
                  image:
                    bytes_base64_encoded: /9j/4AAQSkZJRgABAQAAAQABAAD/2w...
                  callback_url: https://example.com/callback
                  seconds: 5
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomoOut_TaskOut_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      callbacks:
        task_status_callback:
          '{$request.body.callback_url}':
            post:
              summary: Task Status Callback
              operationId: task_status_callback__request_body_callback_url__post
              requestBody:
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/VideoTaskOut'
                required: true
              responses:
                '200':
                  description: Successful Response
                  content:
                    application/json:
                      schema: {}
                '422':
                  description: Validation Error
                  content:
                    application/json:
                      schema:
                        $ref: '#/components/schemas/HTTPValidationError'
              method: post
              type: path
            path: '{$request.body.callback_url}'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateTemplate2VideoTaskIn:
      properties:
        callback_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Callback Url
          description: >-
            Callback notification URL for task results. If configured, the
            server will actively send notifications when the task status
            changes. 

            The message schema of the notification can be found in the [Callback
            Protocol](/api-reference/callback/callback-protocol) section.
          examples:
            - https://example.com/callback
            - null
        prompt:
          type: string
          maxLength: 2000
          title: Prompt
          default: ''
        template:
          $ref: '#/components/schemas/Template2VideoTemplate'
        images:
          items:
            $ref: '#/components/schemas/ImageInput'
          type: array
          minItems: 1
          title: Images
          description: >-
            Array of input images. Currently supports only one image. Multiple
            images may be supported in the future.
          examples:
            - - domoai_uri: >-
                  domoai://eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmdhbml6YXRpb25faWQiOiIwNjhmZWViMy1hYmVkLTcyYTItODAwMC1hZDM1ZTg0ZGIxNDAiLCJ1cGxvYWRfYnVja2V0IjoiZW50LWFwaS10ZXN0LTEzMzYyODM0MDgiLCJ1cGxvYWRfa2V5IjoiZXBoZW1lcmFsLXVwbG9hZHMvMDY4ZmVlYjMtYWJlZC03MmEyLTgwMDAtYWQzNWU4NGRiMTQwLzI1YjhmOTgwLWM2MzEtNGQ1NC05Y2VhLTU0ZGFiYjhiMjYwNy9maWxlLm1wMyIsInR5cGUiOiJlcGhlbWVyYWwiLCJjb250ZW50X3R5cGUiOiJhdWRpby9tcGVnIiwiZmlsZV9zaXplIjoxMjU2MzIsImlhdCI6MTc2ODM4NzA3MCwiZXhwIjoxNzY4NDczNDcwLCJpc3MiOiJodHRwOi8vemhtLWFwaS5mcnAtZGV2LmRvbW8uY29vbC8ifQ.E60fIHPeDtEE0NmKaPGRYtyQJtaEQI9I0aNEwgtsLrg
            - - bytes_base64_encoded: /9j/4AAQSkZJRgABAQAAAQABAAD/2w...
        seconds:
          type: integer
          maximum: 10
          minimum: 1
          title: Seconds
          description: Output video duration in seconds.
        aspect_ratio:
          anyOf:
            - $ref: '#/components/schemas/AspectRatio'
            - type: 'null'
          description: >-
            Output video aspect ratio. If `null` or not provided, the system
            will automatically detect and use the closest matching ratio based
            on the input image.
          examples:
            - '16:9'
            - '9:16'
            - '1:1'
            - '4:3'
            - '3:4'
      type: object
      required:
        - template
        - images
        - seconds
      title: CreateTemplate2VideoTaskIn
    DomoOut_TaskOut_:
      properties:
        code:
          type: integer
          title: Code
          default: 0
        data:
          $ref: '#/components/schemas/TaskOut'
      type: object
      required:
        - data
      title: DomoOut[TaskOut]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VideoTaskOut:
      properties:
        task_id:
          type: string
          format: uuid
          title: Task Id
        id:
          type: string
          format: uuid
          title: Id
        status:
          $ref: '#/components/schemas/TaskStatus'
        category:
          $ref: '#/components/schemas/TaskCategory'
        callback_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Callback Url
        seconds:
          type: integer
          title: Seconds
        output_videos:
          items:
            $ref: '#/components/schemas/DomoVideoOut'
          type: array
          title: Output Videos
        credits:
          type: integer
          title: Credits
        inputs:
          additionalProperties: true
          type: object
          title: Inputs
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
      type: object
      required:
        - task_id
        - id
        - status
        - category
        - callback_url
        - seconds
        - output_videos
        - credits
        - inputs
        - created_at
      title: VideoTaskOut
    Template2VideoTemplate:
      type: string
      enum:
        - kissing_screen
        - looping_animation
        - hug
        - groove_dance
        - kiss
        - french_kiss
        - 360_view
        - zoom_in
        - zoom_out
        - crane_up
      title: Template2VideoTemplate
    ImageInput:
      properties:
        domoai_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Domoai Uri
        bytes_base64_encoded:
          anyOf:
            - type: string
            - type: 'null'
          title: Bytes Base64 Encoded
      type: object
      title: ImageInput
    AspectRatio:
      type: string
      enum:
        - '16:9'
        - '9:16'
        - '1:1'
        - '4:3'
        - '3:4'
      title: AspectRatio
    TaskOut:
      properties:
        task_id:
          type: string
          format: uuid
          title: Task Id
      type: object
      required:
        - task_id
      title: TaskOut
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TaskStatus:
      type: string
      enum:
        - PENDING
        - QUEUING
        - PROCESSING
        - SUCCESS
        - FAILED
        - CANCELED
      title: TaskStatus
    TaskCategory:
      type: string
      enum:
        - TEXT_TO_VIDEO
        - IMAGE_TO_VIDEO
        - VIDEO_TO_VIDEO
        - TEMPLATE_TO_VIDEO
        - TALKING_AVATAR
      title: TaskCategory
    DomoVideoOut:
      properties:
        url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url
        width:
          type: integer
          title: Width
        height:
          type: integer
          title: Height
      type: object
      required:
        - url
        - width
        - height
      title: DomoVideoOut
  securitySchemes:
    HTTPBearer:
      type: http
      description: API Key Bearer Token
      scheme: bearer

````