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

# Copy/transform video

This API allows to duplicate videos and templates, as well as turn videos into templates and vice versa.

If you want to create a template from a video or another template please set the`createTemplate=true`. Otherwise, a video will be generated both from a template or another video.

If you create a video from a template, the video will be adjusted according to your plan possibilities.

# 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 96 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 `chore/web-4760/api-v1-reference-build` at `5289745d` on 2026-09-04._"
  },
  "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/copy": {
      "post": {
        "summary": "Copy/transform video",
        "description": "This API allows to duplicate videos and templates, as well as turn videos into templates and vice versa.",
        "operationId": "copy-video",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sourceId"
                ],
                "properties": {
                  "sourceId": {
                    "type": "string",
                    "description": "Id of a source video or template. You can find ID in your video URL when you open it in our app."
                  },
                  "folderId": {
                    "type": "string",
                    "description": "Id of a folder where you want to save your video. By default video will be stored in the root folder."
                  },
                  "createTemplate": {
                    "type": "boolean",
                    "description": "If you want to generate template from other template or video set this as true.",
                    "default": false
                  },
                  "templateId": {
                    "type": "string",
                    "deprecated": true,
                    "description": "Deprecated alias of `sourceId`, still accepted. Use `sourceId` instead."
                  }
                }
              },
              "examples": {
                "body": {
                  "value": {
                    "sourceId": "6433bee0b03ab38ca9d082d3"
                  }
                }
              }
            }
          }
        },
        "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
    }
  }
}
````