---
agentTools:
  projectIndex: https://elai.readme.io/llms.txt
---

# Create a video

Request to create a new video.

> 📘 How to create proper structure
>
> The structure of the video is quite complex, so If you want to create/update the structure of the slide from API, the best way to do it would be to create the layout in the **Elai UI**, retrieve it using [GET /videos/:videoId](https://elai.readme.io/reference/retrieve-video), and use the structure from response JSON body.

Quick request example

```curl Request
curl --request POST \
     --url https://apis.elai.io/api/v1/videos \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer API_TOKEN' \
     --header 'Content-Type: application/json' \
     --data @- <<EOF
{
     "name": "Hello from API!",
     "slides": [
        {
          "id": 1,
          "canvas": {
            "objects": [
              {
                "type": "avatar",
                "left": 151.5,
                "top": 36,
                "fill": "#4868FF",
                "scaleX": 0.3,
                "scaleY": 0.3,
                "width": 1080,
                "height": 1080,
                "src": "https://elai-avatars.s3.us-east-2.amazonaws.com/common/gia/casual/gia_casual.png",
                "avatarType": "transparent",
                "animation": {
                  "type": null,
                  "exitType": null
                }
              }
            ],
            "background": "#ffffff",
            "version": "4.4.0"
          },
          "avatar": {
              "code": "gia.casual",
              "gender": "female",
              "canvas": "https://elai-avatars.s3.us-east-2.amazonaws.com/common/gia/casual/gia_casual.png"
          },
          "animation": "fade_in",
          "language": "English",
          "speech": "Hi there! It's my first video created by Elai API.",
          "voice": "en-US-AriaNeural",
          "voiceType": "text",
          "voiceProvider": "azure"
        }
     ],
     "tags": [
          "test"
     ]
}
EOF
```

> 👍 Slide structure
>
> Make sure you have added all nested objects to each slide. More details about slide structure can be found [here](https://elai.readme.io/reference/slide-structure)

Response:

```json Response example
{
  "_id": "420c6769343dc7bb51513e63",
  "name": "Hello from API!",
  "slides": [
    {
      "id": 1,
      "canvas": {
        "objects": [
         {
           "type": "avatar",
           "left": 151.5,
           "top": 36,
           "fill": "#4868FF",
           "scaleX": 0.3,
           "scaleY": 0.3,
           "src": "https://elai-avatars.s3.us-east-2.amazonaws.com/common/gia/casual/gia_casual.png",
           "avatarType": "transparent",
           "animation": {
             "type": null,
             "exitType": null
           }
         }
        ],
        "background": "#ffffff",
        "version": "4.4.0"
      },
      "avatar": {
        "code": "gia.casual",
        "name": "Gia Casual",
        "gender": "female",
        "canvas": "https://elai-avatars.s3.us-east-2.amazonaws.com/common/gia/casual/gia_casual.png"
      },
      "animation": "fade_in",
      "language": "English",
      "speech": "Hi there! It's my first video created by Elai API.",
      "voice": "en-US-AriaNeural",
      "voiceType": "text",
      "voiceProvider": "azure"
    }
  ],
  "tags": [
    "api",
    "test"
  ],
  "deleted": false,
  "status": "draft",
  "verified": false,
  "public": false,
  "userId": "4261bf7aff1213b4bae2f10b",
  "accountId": "4261bf7aff124ab4bae2f10c",
  "createdAt": "2022-08-29T07:14:49.354Z",
  "updatedAt": "2022-08-29T07:14:49.354Z"
}
```

# OpenAPI definition

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Elai Public API",
    "version": "1.0",
    "description": "Every endpoint below is served under `https://apis.elai.io/api/v1`.\n\n## Authentication\n\nSend your workspace API token as a bearer token on every request:\n\n```\nAuthorization: Bearer <your-api-token>\n```\n\nGenerate and rotate the token in the Elai web app under **Settings → API**, or through\n`POST /generateToken`. The token is scoped to one **workspace** and authenticates as that\nworkspace's admin user — it is not tied to an individual person, and it carries admin rights\ninside that workspace.\n\nA request with a missing, unknown or revoked token gets a bare `401` with no response body.\n\n> **Organizations on the Unlimited plan cannot use the API.** Their requests are rejected with the\n> same bare `401` as an invalid token, with nothing to distinguish the two. If a valid, freshly\n> generated token returns `401` on every endpoint, check the plan first.\n\n## Errors\n\nFailures carry a JSON body of the shape `{ \"message\": \"...\" }`. Validation failures on the newer\nendpoints may add an `errors` array naming the offending fields. `401` is the exception: it has no\nbody at all.\n\nBoth render endpoints are **fire-and-forget** — they queue work and return immediately, so a\n`200` means \"accepted\", not \"rendered\". Render failures surface only through the `video_error`\nwebhook, never as an HTTP error on the call that started the render.\n\n## Scope\n\nThis reference is generated from the running code rather than maintained by hand, so it cannot\nquietly fall behind the API it describes. It documents 94 operations across the\n`/api/v1` surface.\n\nEndpoints are grouped by subject in the sidebar. If something you need is missing, or an endpoint\ndoes not behave as described here, tell us.\n\n---\n\n_Generated from `HEAD` at `2a2222fdbe` on 2026-11-25._"
  },
  "servers": [
    {
      "url": "https://apis.elai.io/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer",
        "x-default": "SECRET_KEY"
      }
    },
    "schemas": {
      "Slide": {
        "type": "object",
        "description": "One slide. The model stores slides as an untyped array, so this lists the keys the API and the renderer actually read rather than a closed contract — extra keys are preserved. See [Slide structure](ref:slide-structure) for the canvas in full.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique within the video, and must be a number."
          },
          "canvas": {
            "type": "object",
            "additionalProperties": true,
            "description": "Fabric.js canvas: `objects[]`, `background`, `version`."
          },
          "avatar": {
            "type": "object",
            "additionalProperties": true,
            "description": "The speaking avatar. A flat object — `code` identifies it (`id` is accepted but deprecated).",
            "properties": {
              "code": {
                "type": "string",
                "example": "gia.casual"
              },
              "name": {
                "type": "string",
                "example": "Gia Casual"
              },
              "gender": {
                "type": "string",
                "example": "female"
              },
              "version": {
                "type": "integer",
                "example": 2
              },
              "canvas": {
                "type": "string",
                "description": "Preview image for the avatar."
              }
            }
          },
          "speech": {
            "type": "string",
            "description": "What the avatar says. Stripped from `GET /videos` list responses."
          },
          "voice": {
            "type": "string",
            "example": "en-US-AriaNeural"
          },
          "voiceType": {
            "type": "string",
            "description": "How the speech is produced, e.g. `text`, `audio`, `silence`."
          },
          "voiceProvider": {
            "type": "string",
            "enum": [
              "azure",
              "google",
              "elevenlabs"
            ]
          },
          "language": {
            "type": "string",
            "example": "English"
          },
          "animation": {
            "type": "string",
            "example": "fade_in"
          },
          "status": {
            "type": "string",
            "description": "Set on story and outline slides while they are still placeholders."
          },
          "duration": {
            "type": [
              "number",
              "null"
            ],
            "description": "Seconds. `null` until the slide's speech has been synthesised."
          }
        }
      },
      "Video": {
        "type": "object",
        "description": "A video. Fields are as stored, so a draft carries far fewer of them than a rendered video.",
        "additionalProperties": true,
        "properties": {
          "_id": {
            "type": "string",
            "example": "420c6769343dc7bb51513e63"
          },
          "name": {
            "type": "string",
            "example": "Hello from API!"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "validating",
              "rendering",
              "moderation",
              "error",
              "ready"
            ],
            "description": "Only `ready` means the MP4 exists. `error` carries no reason here — that arrives on the `video_error` webhook."
          },
          "url": {
            "type": "string",
            "description": "The rendered MP4. Absent until `status` is `ready`."
          },
          "audioUrl": {
            "type": "string",
            "description": "Rendered audio track, when one was produced separately."
          },
          "thumbnail": {
            "type": "string"
          },
          "duration": {
            "type": "number",
            "description": "Seconds. Known once the speech has been synthesised."
          },
          "slides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Slide"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Videos created over the API always carry `api`."
          },
          "public": {
            "type": "boolean",
            "default": false
          },
          "deleted": {
            "type": "boolean",
            "default": false
          },
          "verified": {
            "type": "boolean",
            "default": false
          },
          "version": {
            "type": "integer",
            "default": 0
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "description": "Render settings — subtitles, background music, and similar. Passed through to the renderer untouched."
          },
          "template": {
            "type": "object",
            "additionalProperties": true,
            "description": "Present only on templates.",
            "properties": {
              "enabled": {
                "type": "boolean",
                "default": false
              },
              "private": {
                "type": "boolean",
                "default": true
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "order": {
                "type": "integer",
                "default": 1
              }
            }
          },
          "sourceId": {
            "type": "string",
            "description": "The template this video was created or copied from."
          },
          "userId": {
            "type": "string"
          },
          "accountId": {
            "type": "string",
            "description": "The workspace that owns it."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/videos": {
      "post": {
        "summary": "Create a video",
        "description": "Request to create a new video.",
        "operationId": "create-video",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "slides"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Video name",
                    "default": "Hello from API!"
                  },
                  "slides": {
                    "type": "array",
                    "description": "Video slides initial configuration",
                    "items": {
                      "properties": {
                        "id": {
                          "type": "integer",
                          "default": 1,
                          "format": "int32"
                        },
                        "canvas": {
                          "type": "object",
                          "required": [
                            "background",
                            "version"
                          ],
                          "properties": {
                            "objects": {
                              "type": "array",
                              "items": {
                                "properties": {
                                  "id": {
                                    "type": "integer",
                                    "default": 1,
                                    "format": "int32"
                                  },
                                  "type": {
                                    "type": "string",
                                    "default": "avatar"
                                  },
                                  "src": {
                                    "type": "string",
                                    "default": "https://elai-media.s3.eu-west-2.amazonaws.com/avatars/jade.png"
                                  },
                                  "top": {
                                    "type": "number",
                                    "default": 20,
                                    "format": "float"
                                  },
                                  "left": {
                                    "type": "number",
                                    "default": 150,
                                    "format": "float"
                                  },
                                  "scaleX": {
                                    "type": "number",
                                    "default": 0.37,
                                    "format": "float"
                                  },
                                  "scaleY": {
                                    "type": "number",
                                    "default": 0.37,
                                    "format": "float"
                                  },
                                  "avatarType": {
                                    "type": "string",
                                    "default": "transparent"
                                  },
                                  "version": {
                                    "type": "integer",
                                    "default": 2,
                                    "format": "int32"
                                  }
                                },
                                "required": [
                                  "id",
                                  "type",
                                  "src",
                                  "top",
                                  "left",
                                  "scaleX",
                                  "scaleY",
                                  "avatarType"
                                ],
                                "type": "object"
                              }
                            },
                            "background": {
                              "type": "string",
                              "description": "Background color",
                              "default": "#ffffff"
                            },
                            "version": {
                              "type": "string",
                              "default": "4.4.0"
                            }
                          }
                        },
                        "avatar": {
                          "type": "object",
                          "required": [
                            "code",
                            "gender"
                          ],
                          "properties": {
                            "code": {
                              "type": "string",
                              "default": "jade"
                            },
                            "name": {
                              "type": "string",
                              "default": "Jade"
                            },
                            "gender": {
                              "type": "string",
                              "default": "female"
                            }
                          }
                        },
                        "animation": {
                          "type": "string",
                          "default": "fade_in"
                        },
                        "language": {
                          "type": "string",
                          "default": "English"
                        },
                        "speech": {
                          "type": "string",
                          "default": "Hi there! It's my first video created by Elai API."
                        },
                        "voiceType": {
                          "type": "string",
                          "description": "Text - we generate audio from text, file - audio grabbed from uploaded file, silence - no audio at all",
                          "default": "text",
                          "enum": [
                            "text",
                            "file",
                            "silence"
                          ]
                        },
                        "voice": {
                          "type": "string",
                          "description": "Voice id that you can grab from https://elai.readme.io/reference/voices-list",
                          "default": "en-US-AriaNeural"
                        },
                        "voiceProvider": {
                          "type": "string",
                          "description": "Provider ID for specific voice. More here: https://elai.readme.io/reference/voices-list",
                          "default": "azure"
                        }
                      },
                      "required": [
                        "id",
                        "animation",
                        "language",
                        "speech",
                        "voiceType",
                        "voice",
                        "voiceProvider"
                      ],
                      "type": "object"
                    }
                  },
                  "tags": {
                    "type": "array",
                    "description": "Extra tags",
                    "default": [
                      "test"
                    ],
                    "items": {
                      "type": "string"
                    }
                  },
                  "public": {
                    "type": "boolean",
                    "description": "If true, video will be publicly available using https://app.elai.io/v/{videoId} link.",
                    "default": false
                  },
                  "data": {
                    "type": "object",
                    "description": "Additional params and settings",
                    "properties": {
                      "skipEmails": {
                        "type": "boolean",
                        "description": "If set to true emails about video ready/error won't be sent",
                        "default": false
                      },
                      "subtitlesEnabled": {
                        "type": "string",
                        "description": "'vtt' - generate subtitles in WebVTT format, 'srt' - generate subtitles in SRT format, 'burn' - add subtitles directly to video mp4 file and generate SRT file. Skip this parameter or set to false, if you don't need subtitles. After video is ready, subtitles file will be available under data.subtitlesUrl param",
                        "default": "false",
                        "enum": [
                          "vtt",
                          "srt",
                          "burn"
                        ]
                      },
                      "format": {
                        "type": "string",
                        "description": "Video aspect ratio. By default it's 16x9 (horizontal) - '16_9'. Also supports values '1_1' for square videos and '9_16' for vertical.",
                        "default": "16_9"
                      },
                      "musicName": {
                        "type": "string",
                        "description": "Name of music track"
                      },
                      "musicUrl": {
                        "type": "string",
                        "description": "Url of music file",
                        "default": "https://elai-media.s3.eu-west-2.amazonaws.com/music/mixkit-driving-ambition-32.mp3"
                      },
                      "musicVolume": {
                        "type": "number",
                        "description": "Volume of music track compared to speech. Float from 0 to 1.",
                        "default": 0.17,
                        "format": "float"
                      },
                      "resolution": {
                        "type": "string",
                        "description": "Resolution of your video. Supports 2 values: \"FullHD\" for videos 1080px height and \"4K\" for 2160px height.",
                        "default": "FullHD"
                      },
                      "screenshotTime": {
                        "type": "string",
                        "description": "Number in seconds in a final video on when a screenshot for a thumbnail should be taken. Eg. \"1.5\" means thumbnail will be generated from frame on 1.5 second of final video."
                      }
                    }
                  },
                  "folderId": {
                    "type": "string",
                    "description": "Id of the folder where to put your video to. By default video will be created in the root ."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "_id": "420c6769343dc7bb51513e63",
                      "name": "Hello from API!",
                      "slides": [
                        {
                          "id": 1,
                          "canvas": {
                            "objects": [
                              {
                                "type": "avatar",
                                "version": 2,
                                "left": 151.5,
                                "top": 36,
                                "fill": "#4868FF",
                                "scaleX": 0.3,
                                "scaleY": 0.3,
                                "src": "https://elai-avatars.s3.us-east-2.amazonaws.com/common/gia/casual/gia_casual.png",
                                "avatarType": "transparent",
                                "animation": {
                                  "type": null,
                                  "exitType": null
                                }
                              }
                            ],
                            "background": "#ffffff",
                            "version": "4.4.0"
                          },
                          "avatar": {
                            "code": "gia.casual",
                            "version": 2,
                            "name": "Gia Casual",
                            "gender": "female",
                            "canvas": "https://elai-avatars.s3.us-east-2.amazonaws.com/common/gia/casual/gia_casual.png"
                          },
                          "animation": "fade_in",
                          "language": "English",
                          "speech": "Hi there! It's my first video created by Elai API.",
                          "voice": "en-US-AriaNeural",
                          "voiceType": "text",
                          "voiceProvider": "azure"
                        }
                      ],
                      "tags": [
                        "api",
                        "test"
                      ],
                      "deleted": false,
                      "status": "draft",
                      "verified": false,
                      "public": false,
                      "userId": "1",
                      "accountId": "1",
                      "createdAt": "2022-08-29T07:14:49.354Z",
                      "updatedAt": "2022-08-29T07:14:49.354Z"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Video"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "message": "Name required"
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Name required"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "500",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "message": "Slide 1 is too long. Please limit speech to 60s for this avatar."
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Slide 1 is too long. Please limit speech to 60s for this avatar."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "tags": [
          "Videos"
        ]
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "tags": [
    {
      "name": "Videos",
      "description": "Create, read, update and delete videos, and read their exports, history and player payload."
    }
  ],
  "_id": {
    "buffer": {
      "0": 106,
      "1": 154,
      "2": 229,
      "3": 101,
      "4": 201,
      "5": 178,
      "6": 243,
      "7": 252,
      "8": 223,
      "9": 58,
      "10": 69,
      "11": 151
    }
  }
}
````