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

# Create Video From Template

> Create video from Your Template.



## OpenAPI

````yaml POST /create_video_with_template
openapi: 3.0.1
info:
  title: OpenAPI Render API
  description: A sample API that demonstrates features in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.jogg.ai/v1
security:
  - apiKeyAuth: []
tags:
  - name: Create Video from URL
    description: |-



      Product video generation workflow:



        1. First call POST /product to crawl product information



        2. Optionally call PUT /product to modify product details using the product_id from step 1



        3. Finally call POST /create_video_from_url to generate video using the product_id from step 1
  - name: Webhook
    description: Webhook configuration and management
paths:
  /create_video_with_template:
    post:
      tags:
        - Create Video from Template
      summary: Create video with template
      description: Create video from Your Template.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - template_id
                - lang
                - template_type
                - variables
              properties:
                template_id:
                  type: integer
                  description: Template ID
                  example: 1234
                lang:
                  type: string
                  description: Language for text-to-speech conversion
                  example: english
                template_type:
                  type: string
                  description: |



                    Template source type:



                    * common - Template from template library



                    * user - Template from user templates
                  enum:
                    - common
                    - user
                  example: common
                avatar_id:
                  type: integer
                  description: Digital person ID
                  example: 1
                avatar_type:
                  type: integer
                  description: |



                    Avatar source type:



                    * 0 - Public avatars



                    * 1 - Custom avatars
                  enum:
                    - 0
                    - 1
                  example: 0
                voice_id:
                  type: string
                  description: Voice ID for text-to-speech
                  example: en-US-ChristopherNeural
                caption:
                  type: boolean
                  description: Whether to enable captions
                  example: true
                music_id:
                  type: integer
                  description: Background music ID
                  example: 1
                video_name:
                  type: string
                  description: >-
                    If you want to specify the name of the generated video,
                    please use this parameter.
                  example: My Video
                variables:
                  type: array
                  description: Variables to replace in the template
                  items:
                    type: object
                    required:
                      - type
                      - name
                      - properties
                    properties:
                      type:
                        type: string
                        description: |



                          Variable type:



                          * text - Text content



                          * image - Image content



                          * video - Video content



                          * script - Script content
                        enum:
                          - text
                          - image
                          - video
                          - script
                      name:
                        type: string
                        description: Name of the variable to replace
                      properties:
                        type: object
                        properties:
                          content:
                            type: string
                            description: Text content (for text type)
                          url:
                            type: string
                            description: URL for media content (for image/video type)
                          asset_id:
                            type: integer
                            format: int64
                            description: Asset ID for media content (for image/video type)
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/BaseResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          project_id:
                            type: string
                            description: Created project ID
                            example: '12345'
components:
  schemas:
    BaseResponse:
      type: object
      required:
        - code
        - msg
      properties:
        code:
          type: integer
          description: |



            Business status code:



            * 0 - Success



            * 10104 - Record not found



            * 10105 - Invalid API key



            * 18020 - Insufficient credit



            * 18025 - No permission to call APIs.



            * 40000 - Parameter error



            * 50000 - System error
        msg:
          type: string
          description: Response message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````