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

# Create personalized videos

Using this API, you can generate multiple videos from just one video as a source. Just pass your customers' names and/or other important data via an API request or Zapier and get a personalized video for each.

[block:callout]
{
  "type": "info",
  "title": "What excatly can I customize in videos?",
  "body": "You can customize the name of the video, texts, images, and videos on canvas, and, of course, speech text.\n\nFor more deep customization please use [Video API](https://elai.readme.io/reference/create-video)."
}
[/block]

[block:api-header]
{
  "title": "Replace text blocks, speech and title"
}
[/block]

First, you should go to [Elai](https://app.elai.io/videos) and create a new video.

Start creating a new video as you usually do (from a template, blank, or from another source), but this time, insert special **{{}}** brackets placeholders (next **tags**) in all places where you want to have personalized information.

For example, this speech text:

`Hi {{Name}}, thank you for purchasing {{product title}}!`

can be transformed into a batch of videos with the following narration:

Hi **Kate**, thank you for purchasing **Playstation 5**!
Hi **Dan**, thank you for purchasing **GoPro**!
Hi **John**, thank you for purchasing **iPhone 13**!

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/2477b66-Screenshot_2022-05-20_at_17.31.31.png",
        "Screenshot 2022-05-20 at 17.31.31.png",
        1752,
        1428,
        "#dde0e0"
      ],
      "sizing": "full",
      "caption": ""
    }
  ]
}
[/block]

You can add **tags** to:

* Video title (you can create an entirely new title for each new video or just a part of the title);
* Speech text (replace whole speech text or specific words in it);
* Any text block on the canvas.

[block:callout]
{
  "type": "warning",
  "title": "Tags naming convention",
  "body": "Tags support only english letters, numbers, underscores, dashes and spaces."
}
[/block]

[block:api-header]
{
  "title": "Replace images/videos on a canvas"
}
[/block]

Moreover, you can **replace any image or video** on your canvas with a personalized one. As soon as you have your *API key generated*, you will see the API Id on a sidebar for each image or video.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/b55bb4e-Screen_Shot_2022-08-24_at_9.53.39_AM.png",
        "Screen Shot 2022-08-24 at 9.53.39 AM.png",
        2148,
        866,
        "#c2c2d9"
      ],
      "caption": ""
    }
  ]
}
[/block]

Then when you make your [render request](https://elai.readme.io/reference/render-personalized) add key-value pair in your **templateData** body param as described:

* Key - API Id of your object (can be found on a sidebar when you select a particular image/video)
* Value - URL of an image/video that will replace one in your template. Make sure the URL is publicly available and can be downloaded by any server.

As soon as your template is ready, make a [render request](https://elai.readme.io/reference/render-personalized) with your video ID. You can get a video link using a [webhook](https://elai.readme.io/reference/webhooks-overview), separate [API call](https://elai.readme.io/reference/retrieve-video), or just from an email.

[block:api-header]
{
  "title": "Replace whole text block on canvas"
}
[/block]

Personalization API can also fit whole sentences or small text into a text block, keeping the dimensions of a text block and automatically adjusting the text font size and breaking lines. Hence, it perfectly fits a specific area on a slide.

For example, you want to add a title to your slide like this:

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/5306106-Screen_Shot_2023-01-16_at_2.47.21_PM.png",
        "Screen Shot 2023-01-16 at 2.47.21 PM.png",
        816,
        572,
        "#000000"
      ]
    }
  ]
}
[/block]

But you don't know how big the text would be. So in this case you can add your tag in text block and fill all free space in a text block with random text, so your text block has the proper position and maximum size:

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/020dd45-Screen_Shot_2023-01-16_at_2.47.37_PM.png",
        "Screen Shot 2023-01-16 at 2.47.37 PM.png",
        848,
        758,
        "#000000"
      ]
    }
  ]
}
[/block]

So when you use text like "A good shampoo and conditioner" Elai will automatically adjust the text to fit your text box and replace whole text, not only your tag.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/d300b0e-Screen_Shot_2023-01-16_at_2.53.45_PM.png",
        "Screen Shot 2023-01-16 at 2.53.45 PM.png",
        934,
        436,
        "#000000"
      ]
    }
  ]
}
[/block]

To make Elai adjust text, you need to send the "fitTextBox: true" as param.