How to create videos using an API [Complete guide]

  -  
November 20, 2026
  -  
Google Add Plainly as your preferred source
create videos using an API thumbnail
Relja profile picture
Relja Denic
This article was written by Relja, Growth Specialist at Plainly. He has over 6 years of experience in driving growth for B2B companies, SaaS products, and marketing agencies. His expertise includes scaling businesses through targeted growth strategies, optimizing customer acquisition channels, and leveraging data-driven insights for sustainable growth.

Summarize with

Creating videos using an API means sending instructions and data to a video platform that automatically creates the videos for you. 

Yes, that means you can generate 100s or 1000s of video versions without manually opening the same project over and over again only to change a name, image, price, or any other variable. And sure, making one small edit is easy enough. But repeating it a hundred times can really test your patience. Trust us, we know.

Now, automating video production this way requires knowing your way around the code, so it’s best suited to developers and technical marketers, or anyone else who wants to automate video creation through an API, really.

If you happen to be one of those people, you’re in luck, as in this guide, we’ll show you how to set up that video creation process using none other than the industry standard for motion graphics, Adobe After Effects, and our very own Plainly Videos. We’ll walk you through each and every step, starting from preparing your template to rendering, and finally, delivering your high-quality videos.

What is a video creation API?

A video creation API is an application programming interface that lets your software create videos and edit individual video elements through code. Depending on the platform, the API lets you programmatically replace text, swap images and footage, change colors, or add different audio.

There are 4 main types of video creation APIs, and they all work in a different way:

  1. Template-based video creation APIs
  2. Programmatic video frameworks
  3. AI video generation APIs
  4. AI avatar APIs

A template-based video editing API, like Plainly’s, lets you take one video template and automatically change its text, images, colors, or other elements based on your data.

For our client Tapni, a company that makes digital business cards, that data came from customers’ business card designs. Namely, whenever someone designed a card but left without buying it, Tapni used our API to generate a personalized video showing their design, then sent the video link in a follow-up email to give them a little nudge to complete the purchase. And it worked! The result was a 10% increase in conversions among customers who abandoned their cart.

Types of video creation APIs

As we mentioned above, there are 4 main types of video creation APIs and tools. The best video API for you depends on what you actually want to create. The table below covers their key features to help you find the right API for your project.

‍

Type What they do Tool examples
Template-based video creation APIs Create dynamic video content by replacing selected elements in an existing design with your data. From our experience, these are best used for creating personalized videos, product promos, and other content that requires consistency across all versions. Plainly Videos, Creatomate
Programmatic video frameworks Let you build videos or automate video processing through code, with a rendering setup you build or deploy yourself. These are development tools you can use behind your own API. Remotion, FFmpeg
AI video generation APIs Generate AI-powered videos from text prompts or use a reference image as the starting point for image-to-video generation. The API generates new footage from those inputs, while the controls you get with these AI tools depend on the model. Google Veo 3.1, Seedance 2.5
AI avatar APIs Turn your script into a video delivered by a digital presenter, using an avatar and voice. Useful for training, onboarding, and personalized messages. HeyGen API, Synthesia

‍

Step-by-step guide on how to create videos using an API

Now that you know how these APIs work, let’s get to the practical side of this guide.

In the sections ahead, we’ll walk you through the workflow we use to generate a video programmatically. More specifically, we’ll show you how to upload your own After Effects template to Plainly and use our template-based API to create and render new video versions.

That’s exactly what our client, WPP Production, did. They connected our API to WPP Open Production, a platform they already used to produce images, banners, and HTML5 videos, so their teams could also set up templates and render After Effects videos from the same place.

And to help you do the same, we’ll include code examples along the way, so you have a starting point for your own API integration.

If you don’t have a template of your own just yet, don’t worry, as you can also pick one of the ready-to-use designs from our template library - they work through the API as well.

1. Create your API key

First things first, you’ll need to set up API access for your application. For that, you need to create an API key so Plainly can authenticate the requests you send.

To create one, log in to your Plainly account and navigate to Settings in the left sidebar menu. This opens the Organization settings, where you will find the Add new API key button you need to click. 

Add new API key in Plainly

Once you do, the pop up will appear, where you need to enter a nickname for your key. If you want, you can also choose an expiration date and set storage or rendering minute limits. There is also a Personal access token option if you want the key to belong to your user account rather than the whole organization.

New API key pop up menu

After you’ve filled everything in, click Save. And just like that, you’ll have a brand new key you can copy whenever you need it for your API requests. 

It’s important to know that Plainly’s REST API uses HTTP Basic authentication, which means your API key goes in the username field, while the password stays empty. Also, all requests use https://api.plainlyvideos.com as the base URL. 

2. Create your master template with dynamic layers

Next, you’ll need to create your master template in After Effects, which will be the base for your  After Effects automation. If you need different aspect ratios for different platforms, plan those compositions here, too.

At this stage, you also need to decide which layers you want to make editable and add a common prefix to their names. For example, you can use a prefix "edit". 

Say you want to make the text and logo layers editable. In that case, you should rename the layers to: 

  • editText
  • editLogo

This nifty little naming trick will save you time when creating the template in Plainly, as the tool will use that prefix to automatically identify and parametrize the matching layers later on, rather than you doing it manually.

When you are finally happy with the design (and after you’ve renamed the editable layers), package the entire project with all assets into a zip file. Or, if you’d rather skip collecting the files yourself, use our After Effects plugin to do it for you.

3. Upload your project

With your project zipped up and ready, it’s time to upload it to Plainly. 

You can do this through the web app or plugin, sure. But since everything you can do in the app, you can also do through the API,  we’ll stick with the API for this guide.

To upload the file, you will use the POST Create Project endpoint, which accepts these fields:

  • file
  • fileUrl (a URL pointing to your zip, which Plainly can download if the file is hosted online)
  • name, description, and tags
  • folder
  • aeVersion
  • ignoreMissingFiles

You’ll need to provide file or fileUrl, whereas the other fields are optional. 

For the purpose of this guide, let’s say we uploaded a file called my_project.zip, gave it a name My Project, and the description ‘’My video template for API video creation’’. 

In that case, here’s what our Bash/cURL request would look like: 

curl -u "YOUR_API_KEY:" \
-F file=@my_project.zip \
-F name="My Project" \
-F description="My video template for API video creation" \
<https://api.plainlyvideos.com/api/v2/projects>

For your own video workflows, simply replace YOUR_API_KEY with the key you created earlier and my_project.zip with the actual name of your zip file.

After the upload succeeds, you will get a JSON response containing your project’s details. Grab the project ID and keep it handy, as you’ll need it to reference this project when creating the template and rendering your videos.

Plainly will analyze the project after upload, which may take anywhere from a few seconds to around a minute, depending on its size.

Before moving on, use the GET Single Project endpoint to check its status.

And if you have any issues, you can also check out our analysis troubleshooting guide, which covers the most common ones.

4. Create the template

Now that your project has been uploaded and analyzed, you need to create a template from it using the POST Auto Create Templates endpoint.

This is where the edit prefix we added earlier comes in handy. In fact, Plainly will use it to find the layers you want to make editable, so you won’t have to set up each one manually. 

The available fields depend on whether you use prefix or the all type, but we’ll focus on the former here: 

  • type (prefix)
  • prefixes (prefixes used to match composition and layer names)
  • stripPrefix (removes the prefix from generated parameter names)
  • targetCompositionName
  • applyTextAutoScale (automatically scales text to fit the original text dimensions)
  • applyMediaAutoScale (automatically scales images/videos to fit the original media area while keeping the aspect ratio intact)
  • excludeGuideLayers (skips guide layers used as visual references while designing your template)
  • excludeAdjustmentLayers (skips adjustment layers, which apply effects to the layers below them)
  • excludeDisabledLayers (skips layers you’ve switched off in After Effects)
  • excludeShyLayers (skips layers marked as shy)
  • applyExclusionsToCompositions
  • parametrizeInAllCompositions (looks for matching layers across all project compositions in prefix mode)

That said, here’s the request for a project whose rendering composition and editable layers use the edit prefix:

curl -X POST https://api.plainlyvideos.com/api/v2/projects/YOUR_PROJECT_ID/templates/auto-generate \
  -u "YOUR_API_KEY:" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "prefix",
    "prefixes": ["edit"],
    "stripPrefix": true,
    "applyTextAutoScale": true,
    "applyMediaAutoScale": true,
    "excludeGuideLayers": true
  }'

Once the request succeeds, find your newly created template in the response and grab its ID. Keep that, as you’ll need it when rendering your video.

You’ll also get the parametrized layers, so keep their parameter names handy, too, as you’ll need them in the next step.

5. Render your video

With the template set up, you can now start generating videos using the POST New Render endpoint.

We’ll create a single video for this example. But if you need multiple versions, you can also batch render through the API.

The fields you can pass are:

  • projectId and templateId
  • parameters (replacement values for your template’s dynamic elements)
  • properties (overrides for supported properties of parametrized layers)
  • outputFormat
  • options (additional settings, such as captions, thumbnails, watermark, download options, upload options, integration options)
  • attributes (your own render metadata)
  • webhook (to notify your application when rendering finishes)

For the request below, we’ll use a sports video where the team names and logos change for each match. These parameter names are just examples, though, so use the ones returned for your own template in the previous step.

curl -X POST https://api.plainlyvideos.com/api/v2/renders \
  -u "YOUR_API_KEY:" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "YOUR_PROJECT_ID",
    "templateId": "YOUR_TEMPLATE_ID",
    "parameters": {
      "Team1": "Riverside Hawks",
      "Logo1": "https://example.com/logos/hawks.png",
      "Team2": "Northside Wolves",
      "Logo2": "https://example.com/logos/wolves.png"
    },
    "options": {
      "thumbnails": {
        "atSeconds": [2],
        "format": "JPG"
      }
    },
    "webhook": {
      "url": "https://your-app.com/api/webhook",
      "passthrough": "matchup-42",
      "onFailure": true
    }
  }'

As before, replace the API key, project ID, and template ID. You’ll also need actual image URLs that Plainly can access and a working webhook URL for receiving notifications.

6. Download and distribute your videos

Speaking of webhooks, once your videos are rendered, Plainly will send a webhook notification with the download URL.

Now, keep in mind that the tool  doesn’t store your videos forever. The storage period depends on your plan, so make sure you check the plan details and the video expiration date on time.

And if you’d like to automate delivery as well, you can use our native integrations to send finished videos straight to Google Drive, Dropbox, Frame.io, or YouTube.

For a custom storage destination, you can also use signed URL uploads, where you provide a pre-authorized upload URL when submitting the render request, and Plainly uploads the finished video there. Just make sure the destination accepts that upload method, and the URL stays valid long enough for rendering and upload to finish.

Create videos using an API with Plainly

And that’s how you go from an After Effects project to a setup that can create and deliver new video versions through an API. You prepare the template, define which layers should change, and set up the requests that handle rendering and delivery.

There’s some prep work involved, sure. But once it’s done, you can reuse the same template with new data without going through extensive editing each time. That could mean changing a customer’s name, updating a product image and price, or anything else really.

So, if you’d like to see how this would work with your own project, book your Plainly demo. We’ll walk you through the setup for your particular use case and help you get started with automated content creation on the right foot.

Relja profile picture
Relja Denic
This article was written by Relja, Growth Specialist at Plainly. He has over 6 years of experience in driving growth for B2B companies, SaaS products, and marketing agencies. His expertise includes scaling businesses through targeted growth strategies, optimizing customer acquisition channels, and leveraging data-driven insights for sustainable growth.

Start automating video creation now.

a mesh of elegant lines transparent image

Frequently asked questions

How long does it take to render a video through a video generation API?

Render time depends on video length, composition complexity, assets, output settings, and queue load. With Plainly, the rough guideline is 2-3 times the video’s length for simple projects. More complex and longer videos can be created as well, with them taking approximately 5-10 times the video length to render. These are only estimates, however, since concurrency and waiting time also affect delivery.

Can I create videos in bulk through an API?

Yes, you can. Plainly’s batch renders API, for example, lets you reuse a template with different sets of data through POST /api/v2/batch. So, if you have 100 products listed in a spreadsheet, you can set up a CSV to video workflow. Your app would read the CSV file, turn each row into API parameters, and submit the data together to generate 100 video versions from the same template. How many render at the same time depends on your plan.

What video formats can video generation APIs output?

It depends on the API. When it comes to Plainly, it supports MP4, MOV, GIF, and MXF output, with MP4 as the default. You can choose your format through the output format settings in the render request.

Can I use After Effects templates with a video API?

Yes. With Plainly’s After Effects API, you upload your project, create a template, and parametrize the layers you want to change. Your application then sends replacement values for each new version. The design comes from your After Effects composition, while requests control the changing content.

Should I build my own rendering pipeline or use an API?

It depends on your technical requirements, budget, and whether you have developers who can maintain the rendering setup. Build your own pipeline if you need control over the infrastructure or have requirements that existing services can’t meet, and your team can handle the ongoing maintenance. But if you want a scalable setup without managing render servers and queues yourself, hosted APIs like Plainly’s can take care of that for you. When comparing providers, look for APIs with clear documentation and code examples, and check their rate limits before sending large batches of requests.

Read more similar articles

automate your video production

How to automate your video production [Complete guide]

Read more
Personalized video thumbnail

What is a personalized video and how does it work? [Complete guide]

Read more
Creatomate vs Shotstack: An honest comparison thumbnail

Creatomate vs Shotstack: An honest comparison

Read more