> 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 localization from a media asset

POST https://developers.synthesia.io/api/localizations/from-media-asset
Content-Type: application/json

Start localizing a video you uploaded with `POST /v2/assets`.

Poll `GET /localizations/{localization_id}` until `done` is true, then poll its locales until each is done.

**Required scope:** [`localization:write`](https://developers.synthesia.io/docs/scopes) (in Studio: Localization (write))

Reference: https://developers.synthesia.io/docs/api-reference/localization/create-localization-from-media-asset

## Authentication

- `Authorization` header (bearer token, required) — Your Synthesia API key. * Send it as `Authorization: Bearer <key>`; a bare key also works. * An endpoint that needs a scope names it in its description; [Scopes](https://developers.synthesia.io/docs/scopes) lists them all. * A `:write` scope also satisfies the same resource's `:read`. * Without the scope, the request fails with a 403 `insufficient_scope`.

## Request

### Body (application/json)

This endpoint expects a CreateLocalizationFromMediaAsset.

- `mediaAssetId` (string, required) — The video to localize: the `id` returned by `POST /v2/assets`, prefixed `asset_`. Videos uploaded in Studio aren't supported.
- `title` (string, required) — The title of the localized video.
- `sourceLanguage` (string, required) — The language spoken in the video, from `GET /localizations/languages?supports=dubbing_source`. `auto` is not supported for media assets yet.
- `targetLanguages` (list of string, required) — The languages to localize into, from `GET /localizations/languages?supports=dubbing_target`. Each language once.
- `lipsyncEnabled` (boolean, optional, default: true) — Whether to lip-sync the localized videos. Lip-sync costs extra credit and needs a plan that includes it: without it, adding locales is refused, and a new localization fails once processed.
- `burnedInCaptionsEnabled` (boolean, optional, default: false) — Whether to burn captions into the localized videos.
- `videoDuration` (enum, optional) — `adaptive` adjusts the video's speed to fit the translation; `original` keeps the source's duration.
  - Allowed values: `adaptive`, `original`
- `visibility` (enum, optional) — Who can view the localized videos.
  - Allowed values: `private`, `public`

## Response

### 202

Successful Response

- `id` (string, required) — The localization id, prefixed `l10n_…`.
- `status` (enum, required) — `queued` while the source video is fetched, `processing` while it's imported, then `completed` or `failed`. Tracks the import only: each locale has its own `status`, from `GET /localizations/{localization_id}/locales`.
  - Allowed values: `queued`, `processing`, `completed`, `failed`, `canceled`
- `error` (Problem, required, nullable) — Why the localization failed. Branch on its `code`: `moderation`, `no_credit`, `payment_required`, `user_credit_limit_reached` or `processing_error`. More codes may be added. Null unless the status is `failed`.
- `createdAt` (datetime, required, nullable) — Null while the status is `queued`, so always null in the create response. May stay null if the import fails.
- `done` (boolean, required) — True once `status` is terminal, whatever the outcome. Poll until it is true, then read `status`.

## Errors

### 400 Bad Request Error

The request is invalid, a language code is unknown, or the localization could not be created, for example because `mediaAssetId` is not a video or your workspace or plan can't dub it (validation_error). Also a refused target language (invalid_target_language), or a video not uploaded with `POST /v2/assets` (media_asset_not_supported): upload it there and use the new `mediaAssetId`.

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

### 401 Unauthorized Error

Unauthenticated

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

### 402 Payment Required Error

Your workspace has no valid payment plan (payment_required), or not enough credit to dub (no_credit). Or you've reached your own credit usage limit (user_credit_limit_reached). Or your plan doesn't include lip-sync (lipsync_not_in_plan) or a target language (target_language_not_in_plan).

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

### 403 Forbidden Error

Insufficiently scoped or forbidden, or AI dubbing is turned off for your workspace (ai_dubbing_disabled), or you can't create videos in this workspace (video_creation_not_allowed), or you asked for public videos and publishing is turned off for it (publishing_not_allowed).

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

### 404 Not Found Error

No video you uploaded has this `mediaAssetId`: it doesn't exist, isn't your upload, or was archived (unknown_reference).

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

### 409 Conflict Error

The video is still uploading or processing (media_asset_not_ready): retry once it's ready. Or its upload failed or it was rejected (media_asset_failed): upload it again and use the new `mediaAssetId`.

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

### 413 Content Too Large Error

Payload too large

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

### 415 Unsupported Media Type Error

Unsupported media type

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

### 429 Too Many Requests Error

Rate limited

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

### 500 Internal Server Error

Internal error

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

### 503 Service Unavailable Error

Service unavailable

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

### 504 Gateway Timeout Error

Upstream timeout

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

## Types

### Problem

An error response in RFC 9457 Problem Details format.

- `type` (string, required) — A URL identifying the error class — documentation, not a contract: branch on `code`, never parse `type`.
- `title` (string, required) — A human-readable summary of the error class.
- `status` (integer, required) — The HTTP status code, repeated from the response.
- `code` (string, required) — The stable, machine-readable error code to branch on. New codes may appear; treat an unknown one by its `status`.
- `detail` (string, optional, nullable) — Human-readable specifics; the wording may change without notice.
- `features` (list of string, optional, nullable) — On `feature_not_in_plan` only: the plan features this request needs.
- `instance` (string, optional, nullable) — The request path that produced the error.
- `requestId` (string, optional, nullable) — Identifies the request in Synthesia's logs (also the `Request-Id` header); quote it when contacting support.
- `sessionId` (string, optional, nullable) — Only on endpoints that create a session, on errors raised after its id was assigned: the same `sessionId` the success response returns. Quote it with `requestId` when contacting support.

## Examples

**Request**

```json
{
  "mediaAssetId": "asset_8c3b053b-9e64-4a0c-9dae-2c928af19891",
  "title": "Product onboarding",
  "sourceLanguage": "en-US",
  "targetLanguages": [
    "es-ES",
    "fr-FR"
  ],
  "lipsyncEnabled": true,
  "burnedInCaptionsEnabled": false
}
```

**Response**

```json
{
  "id": "string",
  "status": "queued",
  "error": {
    "type": "string",
    "title": "string",
    "status": 1,
    "code": "string",
    "detail": "string",
    "features": [
      "string"
    ],
    "instance": "string",
    "requestId": "string",
    "sessionId": "string"
  },
  "createdAt": "2024-01-15T09:30:00Z",
  "done": true
}
```

**SDK Code**

```python Create a localization from a media asset
import requests

url = "https://developers.synthesia.io/api/localizations/from-media-asset"

payload = {
    "mediaAssetId": "asset_8c3b053b-9e64-4a0c-9dae-2c928af19891",
    "title": "Product onboarding",
    "sourceLanguage": "en-US",
    "targetLanguages": ["es-ES", "fr-FR"],
    "lipsyncEnabled": True,
    "burnedInCaptionsEnabled": False
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Create a localization from a media asset
const url = 'https://developers.synthesia.io/api/localizations/from-media-asset';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"mediaAssetId":"asset_8c3b053b-9e64-4a0c-9dae-2c928af19891","title":"Product onboarding","sourceLanguage":"en-US","targetLanguages":["es-ES","fr-FR"],"lipsyncEnabled":true,"burnedInCaptionsEnabled":false}'
};

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

```go Create a localization from a media asset
package main

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

func main() {

	url := "https://developers.synthesia.io/api/localizations/from-media-asset"

	payload := strings.NewReader("{\n  \"mediaAssetId\": \"asset_8c3b053b-9e64-4a0c-9dae-2c928af19891\",\n  \"title\": \"Product onboarding\",\n  \"sourceLanguage\": \"en-US\",\n  \"targetLanguages\": [\n    \"es-ES\",\n    \"fr-FR\"\n  ],\n  \"lipsyncEnabled\": true,\n  \"burnedInCaptionsEnabled\": false\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 Create a localization from a media asset
require 'uri'
require 'net/http'

url = URI("https://developers.synthesia.io/api/localizations/from-media-asset")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"mediaAssetId\": \"asset_8c3b053b-9e64-4a0c-9dae-2c928af19891\",\n  \"title\": \"Product onboarding\",\n  \"sourceLanguage\": \"en-US\",\n  \"targetLanguages\": [\n    \"es-ES\",\n    \"fr-FR\"\n  ],\n  \"lipsyncEnabled\": true,\n  \"burnedInCaptionsEnabled\": false\n}"

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

```java Create a localization from a media asset
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://developers.synthesia.io/api/localizations/from-media-asset")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"mediaAssetId\": \"asset_8c3b053b-9e64-4a0c-9dae-2c928af19891\",\n  \"title\": \"Product onboarding\",\n  \"sourceLanguage\": \"en-US\",\n  \"targetLanguages\": [\n    \"es-ES\",\n    \"fr-FR\"\n  ],\n  \"lipsyncEnabled\": true,\n  \"burnedInCaptionsEnabled\": false\n}")
  .asString();
```

```php Create a localization from a media asset
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://developers.synthesia.io/api/localizations/from-media-asset', [
  'body' => '{
  "mediaAssetId": "asset_8c3b053b-9e64-4a0c-9dae-2c928af19891",
  "title": "Product onboarding",
  "sourceLanguage": "en-US",
  "targetLanguages": [
    "es-ES",
    "fr-FR"
  ],
  "lipsyncEnabled": true,
  "burnedInCaptionsEnabled": false
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Create a localization from a media asset
using RestSharp;

var client = new RestClient("https://developers.synthesia.io/api/localizations/from-media-asset");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"mediaAssetId\": \"asset_8c3b053b-9e64-4a0c-9dae-2c928af19891\",\n  \"title\": \"Product onboarding\",\n  \"sourceLanguage\": \"en-US\",\n  \"targetLanguages\": [\n    \"es-ES\",\n    \"fr-FR\"\n  ],\n  \"lipsyncEnabled\": true,\n  \"burnedInCaptionsEnabled\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a localization from a media asset
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "mediaAssetId": "asset_8c3b053b-9e64-4a0c-9dae-2c928af19891",
  "title": "Product onboarding",
  "sourceLanguage": "en-US",
  "targetLanguages": ["es-ES", "fr-FR"],
  "lipsyncEnabled": true,
  "burnedInCaptionsEnabled": false
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://developers.synthesia.io/api/localizations/from-media-asset")! 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()
```