> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.synthesia.io/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.synthesia.io/docs/_mcp/server.

# Create a video from a template

POST https://api.synthesia.io/v2/videos/fromTemplate
Content-Type: application/json

Create a video based on a template created in Synthesia.

Reference: https://developers.synthesia.io/docs/video-api-reference/videos/create-a-video-from-a-template

## Authentication

- `Authorization` header (required) — API Key authentication via header

## Request

### Body (application/json)

This endpoint expects a VideoFromTemplate.

- `templateId` (string, required) — Unique identifier of the template from which to create this video. This may be retrieved from the templates page in STUDIO.
- `templateData` (VideoFromTemplateTemplateData, required)
- `folderId` (string, optional, nullable) — Optional folder ID. If provided, the new video will be created under this folder and inherit its permissions.
- `callbackId` (string, optional) — A callback ID that you may attach to the Video object. This is useful in the scenario where you need to store additional metadata on the video.
- `ctaSettings` (CtaSettings, optional)
- `description` (string, optional) — Description of the video (used on the video's share page). Defaults to the template description.
- `test` (boolean, optional, default: false) — Describes if the video is a test video. Test videos do not count towards your quota but are rendered with a watermark.
- `title` (string, optional) — Title of the video (used on the video's share page). Defaults to the template title.
- `visibility` (enum, optional, default: private) — Describes the private settings of the video. - If public, the video's share page is active. - If private, the video's share page is not active; visitors will receive a 404 Not Found response.
  - Allowed values: `private`, `public`
- `brandKitId` (string, optional, nullable) — Brand kit ID for the video. Defaults to 'workspace_default' if not set. Use 'no_brand_kit' for no branding, or a UUID for a custom brand kit.

## Response

### 201

Created.

- `callbackId` (string, optional) — Use callback ID to link videos back to the initial request. For example, if you are making a personalized video for a customer, you could enter the customer's email as a callback ID. This way, you can tell who the video is for, once its generated..
- `createdAt` (integer, optional) — UNIX timestamp representing the time video was created.
- `ctaSettings` (CtaSettings, optional) — Settings for a call-to-action button.
- `description` (string, optional, default: ) — Description of the video to be shown on the share page.
- `test` (boolean, optional, default: false) — Test videos are free and not counted towards your quota. If you create a video in the “test” mode, we will overlay a watermark over your video.
- `download` (string, optional) — Withheld for rejected videos and videos held for moderation review.
- `duration` (string, optional)
- `id` (string, optional)
- `lastUpdatedAt` (integer, optional)
- `status` (enum, optional) — Video status. A rendered video that is still awaiting moderation review is reported as `in_progress` until the review is final.
  - Allowed values: `complete`, `deleted`, `error`, `in_progress`, `rejected`, `approved`
- `thumbnail` (VideoThumbnailTypesResponse, optional, nullable)
- `title` (string, optional, default: ) — Title of the video to be shown on the share page.
- `visibility` (enum, optional, default: private) — Public videos will be visible to anyone with a share URL. Private videos can only be downloaded via a time-limited download link. See Retrieve a video for details. Visibility can be changed also once the video is created via Update a video.
  - Allowed values: `private`, `public`
- `captions` (VideoAssetCaptionTypesResponse, optional) — Downloadable captions files. Omitted when no captions are available, and for videos that are rejected or held for moderation review.
- `contentProvenance` (ContentProvenanceResponse, optional, nullable) — Content provenance (C2PA) information for the video. Only present when the video has been signed.

## Errors

### 400 Bad Request Error

Bad Request.

- `error` (string, required)
- `context` (string, optional)

### 403 Forbidden Error

Forbidden - Wrong API key.

- `error` (string, required)
- `context` (string, optional)

## Types

### VideoFromTemplateTemplateData

### CtaSettings

- `label` (string, required) — Label for a call-to-action button.
- `url` (string, required) — URL to navigate to, when the call-to-action button is clicked.

### VideoThumbnailTypesResponse

- `image` (string, optional, nullable)
- `gif` (string, optional, nullable)

### VideoAssetCaptionTypesResponse

- `srt` (string, optional, nullable)
- `vtt` (string, optional, nullable)

### ContentProvenanceResponse

- `c2pa` (C2PAContentProvenanceResponse, optional, nullable)

### C2PAContentProvenanceResponse

- `signedAt` (string, required)
- `claimGenerator` (string, required)

## Examples

**Request**

```json
{
  "templateId": "string"
}
```

**Response**

```json
{
  "callbackId": "string",
  "createdAt": 1,
  "ctaSettings": {
    "label": [
      "Learn More",
      "Sign up"
    ],
    "url": [
      "https://example.com",
      "https://signup.example.com"
    ]
  },
  "description": "",
  "test": false,
  "download": "string",
  "duration": "string",
  "id": "string",
  "lastUpdatedAt": 1,
  "status": "complete",
  "thumbnail": {
    "image": "string",
    "gif": "string"
  },
  "title": "",
  "visibility": "private",
  "captions": {
    "srt": "string",
    "vtt": "string"
  },
  "contentProvenance": {
    "c2pa": {
      "signedAt": "string",
      "claimGenerator": "string"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.synthesia.io/v2/videos/fromTemplate"

payload = { "templateId": "string" }
headers = {
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.synthesia.io/v2/videos/fromTemplate';
const options = {
  method: 'POST',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"templateId":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.synthesia.io/v2/videos/fromTemplate"

	payload := strings.NewReader("{\n  \"templateId\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.synthesia.io/v2/videos/fromTemplate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"templateId\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.synthesia.io/v2/videos/fromTemplate")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"templateId\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.synthesia.io/v2/videos/fromTemplate', [
  'body' => '{
  "templateId": "string"
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.synthesia.io/v2/videos/fromTemplate");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"templateId\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["templateId": "string"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthesia.io/v2/videos/fromTemplate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```