Skip to main content
POST
/
api
/
v1
/
projects
/
{project_id}
/
validate-translation-request
curl -X POST https://app.dubformer.ai/api/v1/projects/{project_id}/validate-translation-request \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "target_script": [
      {
        "start_ms": 100,
        "end_ms": 1544,
        "text": "Au revoir le monde!",
        "speaker_id": 1
      }
    ],
    "target_speakers": [
      {
        "speaker_id": 1,
        "voice_key": "53f154:fr-FR-DeniseNeural",
        "style": "feminine"
      }
    ]
  }'
import requests

url = 'https://app.dubformer.ai/api/v1/projects/{project_id}/validate-translation-request'
headers = {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
}
data = {
    "target_script": [
        {
            "start_ms": 100,
            "end_ms": 1544,
            "text": "Au revoir le monde!",
            "speaker_id": 1
        }
    ],
    "target_speakers": [
        {
            "speaker_id": 1,
            "voice_key": "53f154:fr-FR-DeniseNeural",
            "style": "feminine"
        }
    ]
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const url = 'https://app.dubformer.ai/api/v1/projects/{project_id}/validate-translation-request';
const headers = {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
};
const data = {
    target_script: [
        {
            start_ms: 100,
            end_ms: 1544,
            text: "Au revoir le monde!",
            speaker_id: 1
        }
    ],
    target_speakers: [
        {
            speaker_id: 1,
            voice_key: "53f154:fr-FR-DeniseNeural",
            style: "feminine"
        }
    ]
};

fetch(url, {
    method: 'POST',
    headers,
    body: JSON.stringify(data),
})
.then(response => response.json())
.then(data => console.log(data));
{
  "valid": true
}
curl -X POST https://app.dubformer.ai/api/v1/projects/{project_id}/validate-translation-request \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "target_script": [
      {
        "start_ms": 100,
        "end_ms": 1544,
        "text": "Au revoir le monde!",
        "speaker_id": 1
      }
    ],
    "target_speakers": [
      {
        "speaker_id": 1,
        "voice_key": "53f154:fr-FR-DeniseNeural",
        "style": "feminine"
      }
    ]
  }'
import requests

url = 'https://app.dubformer.ai/api/v1/projects/{project_id}/validate-translation-request'
headers = {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
}
data = {
    "target_script": [
        {
            "start_ms": 100,
            "end_ms": 1544,
            "text": "Au revoir le monde!",
            "speaker_id": 1
        }
    ],
    "target_speakers": [
        {
            "speaker_id": 1,
            "voice_key": "53f154:fr-FR-DeniseNeural",
            "style": "feminine"
        }
    ]
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const url = 'https://app.dubformer.ai/api/v1/projects/{project_id}/validate-translation-request';
const headers = {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
};
const data = {
    target_script: [
        {
            start_ms: 100,
            end_ms: 1544,
            text: "Au revoir le monde!",
            speaker_id: 1
        }
    ],
    target_speakers: [
        {
            speaker_id: 1,
            voice_key: "53f154:fr-FR-DeniseNeural",
            style: "feminine"
        }
    ]
};

fetch(url, {
    method: 'POST',
    headers,
    body: JSON.stringify(data),
})
.then(response => response.json())
.then(data => console.log(data));

Path Parameters

project_id
string
required
The unique identifier of the project to validate against.

Request Body

The request body uses the same format as Create Re-translation. All the same parameters are accepted:
target_script
array
required
Array of target language script segments for dubbing.
target_speakers
array
required
Array of target speaker configurations for dubbing.
mixing_mode
string
Audio mixing mode for validation.
use_fixed_timings
boolean
Whether to use fixed timings from the target script.
tts_volume
string
TTS volume level for validation.

Response

Valid Request

valid
boolean
Always true when validation passes.
{
  "valid": true
}

Invalid Request

When validation fails, the response includes error details:
error
string
Error type (e.g., “ValidationError”).
message
string
Detailed error message explaining what’s wrong.
{
  "error": "ValidationError",
  "message": "Unknown voice unknown-voice"
}
{
  "error": "ValidationError",
  "message": "Speaker ID 2 referenced in script but not found in target_speakers"
}
{
  "error": "ValidationError",
  "message": "Invalid timing: start_ms must be less than end_ms"
}

Common Validation Errors

Voice Validation

  • Unknown voice keys that don’t exist in the system
  • Voice keys not compatible with the project’s target language
  • Missing voice_key in speaker configuration

Speaker Validation

  • Speaker IDs in script don’t match any target_speakers entries
  • Duplicate speaker IDs in target_speakers array
  • Missing required speaker fields (speaker_id, voice_key, style)

Script Validation

  • Invalid timing values (start_ms >= end_ms)
  • Empty or missing text content
  • Invalid speaker_id references
  • Overlapping time segments

Language Compatibility

  • Voice doesn’t support the project’s target language
  • Special voice keys (soundalike, emotional_transfer) used with unsupported languages