API & Integration -> Quick Start

Create a video by template

This example show how to use the API to generate a video or image based on a template from your project.

Step 1
Create a template

Start by creating a new template in your account. You can create your own templates using the online editor.For this example, we'll use one of the pre-made templates. Click the
Open in editor
button below to copy an example template into your account:

Step 2
Render a video or image

Generating a video or image is as simple as sending an API request to
https://api.creatomate.com/v2/renders
.
Select the template using the
template_id
parameter. Replace content inside the template with the
modifications
parameter. Here, we're replacing the elements named
Primary-Text
and
Background-Video
.
curl -X POST https://api.creatomate.com/v2/renders \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_API_KEY_HERE" \
     -d '{
  "template_id": "YOUR_TEMPLATE_ID_HERE",
  "modifications": {
    "Primary-Text": "This text is placed in the video",
    "Background-Video": "https://cdn.creatomate.com/demo/video1.mp4"
  }
}'

Step 3
Change any template attribute

Any aspect of the template can be overridden through the
modifications
parameter.
Use dot notation to change specific attributes; refer to the element's name, followed by a dot and the RenderScript property you want to replace. This example sets the
font_family
of a text element to
Montserrat
.
It is even possible to remove elements, as demonstrated by how the outro scene is removed entirely.
curl -X POST https://api.creatomate.com/v2/renders \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_API_KEY_HERE" \
     -d '{
  "template_id": "YOUR_TEMPLATE_ID_HERE",
  "modifications": {
    "Primary-Text.font_family": "Montserrat",
    "Secondary-Text.time": 4.53,
    "Background-Color-2.fill_color": "#c3c615",
    "Outro-Composition": {}
  }
}'

Step 4
Use RenderScript for more flexibility

Some situations require more control over the output than a template can provide. Think about a video whose scenes are completely dynamic. These cases can be handled using RenderScript.RenderScript is a JSON-based format for describing videos from start to finish. You can think of it as HTML for creating videos and images.Creatomate allows you to edit RenderScript within its interactive video editor – just drag and drop a design into place and see its RenderScript in real time. This makes it easy to start with, without having to know every detail.