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, and use the structure from response JSON body.

Quick request example

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

Response:

{
  "_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": "4261bf7aff1213b4bae2f10b",
  "accountId": "4261bf7aff124ab4bae2f10c",
  "createdAt": "2022-08-29T07:14:49.354Z",
  "updatedAt": "2022-08-29T07:14:49.354Z"
}
Language
Authorization
Header
Click Try It! to start a request and see the response here!