Templates Api | Moovly Online Video Maker

Intro

Both the creation of videos through the API and the creation of projects through the API, begin by having a template to start from. Lots of templates are made available for you but you can of course create your own as well. On this page we will assume you already have a template that you want to create a video (or project) from. If this is not the case, go check out our tutorial on how to create templates.

1. Authentication

All API calls need to be authenticated with an access token. To generate an access token, head to our Developer Portal and use the token as a bearer token in the Authentication header of each API call.

2. Credits

Each render will cost you one of your credits. Your amount of available credits can be found on the dashboard under your profile.

To read more about credits, check out our FAQ.

When you run out of credits, you’ll get the following response from us when trying to create a video:

3. Getting Template Variables

All template fields that can be used during your (automated) video creation have a uuid that you’ll need to reference to when creating a video from your template. Therefore you need to know where to find the uuids for those variables. You’ll get the variables when you fetch the details of your template based on your template uuid (which you can find in the url bar of your browser when in the dashboard, or through a call to GET https://api.moovly.com/generator/v1/templates).

Get a template

Get a template

Input parameters

Id of the template

Response 200 (Successful operation)

string
name
duration
number
thumb
preview
original_moov_id
original_project_id
public
boolean
category
tags
array
variables
clips
archived
created_by
created_at
quick_editable
allow_updates
premium_assets_price
owner
has_comments

In the response, you’ll find an array property variables that contains the list of all variables that can be changed during the creation of your video. Here, two properties of each variable are most important: the id (uuid) and the type.

Example response

4. Create Video From Template

Start video creation job

Start video creation job

Request body (application/json)

template_id

The template uuid

options
values

The values of the template variables

Values to create a job

external_id
title
template_variables
object
notifications

An array of all the notifications that need to be triggered when the video is rendered

Notifications to create a job

type
payload

Response 200 (successful operation)

Type: Array

Id of the job you created

Id of the template you used

status

Status of the job

videos

Array containing the videos

url
error

Request properties explained

template_id

required, string

The id of the template you want to use. This can be retrieved from the url bar in the dashboard or from the GET https://api.moovly.com/generator/v1/templates call.

options

required, object

A collection of options that can be given to the api

  • quality: default, 480p, 720p or 1080p. Defines the quality of your video, and hence only applicable when creating a video.
  • create_render: boolean that specifies whether a video has to be created.
  • create_project: boolean that specifies whether a project has to be created.

values

required, array of objects

It is possible to create multiple videos from a template in a single API call. Therefore this values property is an array with one object per requested video. Usually it makes more sense to make one API call per video you want to create. Hence, the array usually contains only one object.

The object should contain the variable ids or identifiers and their desired values in the template_variables property. Additionally, an external reference to your own system can be provided in the external_id property for administrative purposes.

Variable id or identifier

There are 2 ways to assign variables to a value:

  • The first way is to work with the variable id that you can find in the template response. (See an example here).
  • The second way is to work with identifiers, identifiers is a self-chosen string that you assign in the editor (object => template => unique identifier).

Currently we support four different types of template variables:

  • Text
  • Image
  • Video
  • Sound

Text

For basic text replacement, you can put your text in the value.

In case you want to replace your text in a more advanced way, you can also add basic HTML in your field. But instead of passing a string, you now need to provide an object with a property type set to rich-text and a property value that contains text with optional HTML formatting.

Be aware that this not only gives you a lot of flexibility, but also an easy way to break your video. So be careful with this usage. Supported tags are

  • <i>text</i> for italic text,
  • <b>text</b> for bold text,
  • <br/> for a line break,
  • <li>text</li> for a list item,
  • <color value=”red”>text</color> for coloured text.

Image and Video

To replace an image or video in your video you can either use the url of a public accessible file or pass an object id of one of your assets.

Supported image types are GIF, JPEG, JPG, PNG, SVG, WEBP and HEIC. Supported video types are MP4, MKV, FLV, WMV, M4V, MPEG, AVI, WEBM, MOV and 3GP.

To get the id of an asset, you can follow this guide. Using your assets instead of public accessible files will be faster, because we do not need to process your file. If speed is important we advise the second option.

Sound

Sound is handled similarly to images and video. You either provide a url to a public accessible file or you specify an asset id. Supported file types are FLAC, M4A, MP3, WAV, OGG, WMA, AIFF and OPUS.

An extension to basic sound variables though, is the Text-To-Speech (tts) service. To make use of it, you’ll need to provide an object for your template variable instead of a basic url reference to your file.

Available providers are AWS and Google. Sample voices can be found on this page. For both providers, the value and the voice properties are required. For AWS, the engine and language_code are required as well.

An AWS example looks like:

A Google example looks like:

modifications

change fonts & colors

It is possible to change the fonts and colors of a template video. You can change fonts and colors by adding modifications in the value entry. See example request:

Specifying fonts & colors in editor

In the Editor under global tab => template, you can choose the colors and fonts that can be changed in a template video, after you specify those and save the template. These modifications are also returned from the template response as template_settings, see the template response example here

Changing fonts & colors

Once you specified the changeable fonts and colors in the editor. You can change the color or font by specifying the current value as object key and the new value as object value see:

notifications

not required

Notifications are there to inform you when the creation of your video is finished. We support multiple channels and they can be combined in case you want to be notified on more than one channel.

We support following types:

  • Callback
  • Upload to Youtube
  • Upload to Google Drive
  • Upload to Instagram
  • Email

Callback

The callback notification has a required url property and will make an HTTP POST call towards the url you provide.

On successful creation of your video, we will let you know via an HTTP POST call with a json body like:

In the unfortunate event that something goes wrong during the creation of your video, you’ll also receive a callback from us.

Upload to Youtube

This notification immediately uploads your video to Youtube when the creation of it is finished. For this to work though, your Moovly account has to be linked to your Youtube account. You can do this in the integration window in our dashboard.

A title and description property are required while a playlist_id is optional. Additionally we support an extra (optional) callback property to let you know when the upload to youtube has finished.

If a callback url is provided, we’ll let you know with an HTTP POST call and following json body. Which allows you to extract the Youtube id of the newly uploaded video:

Upload to Google Drive

This notification immediately uploads your video to Google Drive when the creation of it is finished. For this to work though, your Moovly account has to be linked to your Google account. You can do this in the integration window in our dashboard.

The title property will be the file name of your video and the path property is the name of the folder you want to upload to. That name can be found in the url bar of your browser when you visit your Google Drive.

Upload to Instagram

This notification immediately uploads your video to your Instagram account when the creation of it is finished. For this to work though, your Moovly account has to be linked to your Instagram account. You can do this in the integration window in our dashboard.

Email

The email notification type sends you an email when your video is created. The email will contain a link to your video so you can download it.

The only required payload property is email. But the email can optionally be tweaked with a subject, a message and/or a logo.

Full request example