> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dubformer.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Project Video

> Add a new video to an existing project

This endpoint allows you to add a new video to an existing project. The video will be uploaded to the pipeline for processing.

## Path Parameters

<ParamField path="projectId" type="string" required>
  The unique identifier of the project.
</ParamField>

## Request Body

<ParamField body="name" type="string" required>
  Name of the video.
</ParamField>

<ParamField body="workflowType" type="string" required>
  Type of video processing (e.g., `dubbing`, `voiceover`, `audio_description`, `transcription`, `translation`, `subtitling`).
</ParamField>

<ParamField body="sourceArtifactId" type="string" required>
  Artifact ID of the source video (must be uploaded beforehand).
</ParamField>

<ParamField body="sourceLanguage" type="string" required>
  Source language code in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format (e.g., `en`, `ru`, `de`).

  You can also pass `multi` to enable multi-language source mode, where the source video contains speech in multiple languages. In this mode, the system will automatically detect the language of each segment.

  <Note>
    The `multi` option must be enabled for your organization by an administrator. Contact your account manager to activate multi-language source support.
  </Note>
</ParamField>

<ParamField body="targetLanguages" type="array" required>
  Array of target language codes in [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) format — a combination of an ISO 639-1 language code and an ISO 3166-1 Alpha-2 region code (e.g., `es-ES`, `fr-FR`, `en-US`).
</ParamField>

<ParamField body="backgroundWavArtifactId" type="string">
  Artifact ID of the background audio (optional).
</ParamField>

<ParamField body="internationalMixWavArtifactId" type="string">
  Artifact ID of the international mix audio (optional).
</ParamField>

<ParamField body="vocalsHitlWavArtifactId" type="string">
  Artifact ID of the vocals HITL audio (optional).
</ParamField>

<ParamField body="remark" type="string">
  Additional remarks about the video (optional).
</ParamField>

<ParamField body="stringVariables" type="array">
  Optional array of key-value pairs for storing video metadata. Useful for storing external system references like backlinks, identifiers, or other custom metadata.

  Each item should be an object with `key` and `value` properties (both strings).

  Example:

  ```json theme={null}
  [
    { "key": "storyTitleId", "value": "12345" },
    { "key": "storyDeeplink", "value": "https://..." }
  ]
  ```
</ParamField>

<ParamField body="pipelineOptions" type="object">
  Pipeline configuration options (see below, all fields optional):

  <ul>
    <li>shouldAutomateTranscription: boolean</li>
    <li>shouldAutomateTranslation: boolean</li>
    <li>shouldAutomateVoiceSelection: boolean</li>
  </ul>
</ParamField>

<ParamField body="subtitlingParams" type="object">
  Subtitling parameters per destination language. Used only when `workflowType` is `subtitling`.

  This is an object where keys are language codes (e.g., 'en-US', 'es-ES') and values are objects with the following optional fields:

  <ul>
    <li>`maxLinesPerSubtitle` (number): Maximum number of lines per subtitle (default: 2, range: 1-5)</li>
    <li>`maxCharsPerLine` (number): Maximum number of characters per line (CPL) (default: 30, range: 1-1000)</li>
    <li>`maxCharsPerSecond` (number): Maximum reading speed in characters per second (CPS) (default: 20, range: 1-100)</li>
    <li>`minDurationMs` (number): Minimum subtitle duration in milliseconds (default: 1000, range: 100-60000)</li>
    <li>`maxDurationMs` (number): Maximum subtitle duration in milliseconds (default: 6000, range: 100-60000)</li>
  </ul>

  Example:

  ```json theme={null}
  {
    "en-US": {
      "maxLinesPerSubtitle": 2,
      "maxCharsPerLine": 30,
      "maxCharsPerSecond": 20,
      "minDurationMs": 1000,
      "maxDurationMs": 6000
    },
    "es-ES": {
      "maxLinesPerSubtitle": 2,
      "maxCharsPerLine": 35,
      "maxCharsPerSecond": 18,
      "minDurationMs": 1000,
      "maxDurationMs": 6000
    }
  }
  ```
</ParamField>

<Note>
  If you automate transcription, you won't be able to edit the generated transcription in the future. The transcription phase will be skipped, and the result of the AI's work will be used.
</Note>

<RequestExample>
  ```bash cURL (Dubbing) theme={null}
  curl -X POST \
    https://studio.dubformer.ai/api/v1/projects/proj_5f83a14b2ec1b/videos/create \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
      "name": "New Marketing Video",
      "workflowType": "dubbing",
      "sourceArtifactId": "artifact_1234567890",
      "sourceLanguage": "en",
      "targetLanguages": ["es-ES", "fr-FR"],
      "pipelineOptions": {
        "shouldAutomateTranscription": true,
        "shouldAutomateTranslation": true,
        "shouldAutomateVoiceSelection": false
      },
      "remark": "Optional comment",
      "stringVariables": [
        { "key": "storyTitleId", "value": "12345" },
        { "key": "storyDeeplink", "value": "https://pyramid.dalet.euronews.tech?titleId=12345&kanbanViewId=7KV6cv" }
      ]
    }'
  ```

  ```bash cURL (Subtitling) theme={null}
  curl -X POST \
    https://studio.dubformer.ai/api/v1/projects/proj_5f83a14b2ec1b/videos/create \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
      "name": "Video with Subtitles",
      "workflowType": "subtitling",
      "sourceArtifactId": "artifact_1234567890",
      "sourceLanguage": "en",
      "targetLanguages": ["es-ES", "fr-FR"],
      "subtitlingParams": {
        "es-ES": {
          "maxLinesPerSubtitle": 2,
          "maxCharsPerLine": 35,
          "maxCharsPerSecond": 18,
          "minDurationMs": 1000,
          "maxDurationMs": 6000
        },
        "fr-FR": {
          "maxLinesPerSubtitle": 2,
          "maxCharsPerLine": 30,
          "maxCharsPerSecond": 20,
          "minDurationMs": 1000,
          "maxDurationMs": 6000
        }
      }
    }'
  ```

  ```typescript TypeScript (Dubbing) theme={null}
  import axios from 'axios';

  const response = await axios.post(
    'https://studio.dubformer.ai/api/v1/projects/proj_5f83a14b2ec1b/videos/create',
    {
      name: 'New Marketing Video',
      workflowType: 'dubbing',
      sourceArtifactId: 'artifact_1234567890',
      sourceLanguage: 'en',
      targetLanguages: ['es-ES', 'fr-FR'],
      pipelineOptions: {
        shouldAutomateTranscription: true,
        shouldAutomateTranslation: true,
        shouldAutomateVoiceSelection: false
      },
      remark: 'Optional comment',
      stringVariables: [
        { key: "storyTitleId", value: "12345" },
        { key: "storyDeeplink", value: "https://pyramid.dalet.euronews.tech?titleId=12345&kanbanViewId=7KV6cv" }
      ]
    },
    {
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      }
    }
  );

  console.log(response.data);
  ```

  ```typescript TypeScript (Subtitling) theme={null}
  import axios from 'axios';

  const response = await axios.post(
    'https://studio.dubformer.ai/api/v1/projects/proj_5f83a14b2ec1b/videos/create',
    {
      name: 'Video with Subtitles',
      workflowType: 'subtitling',
      sourceArtifactId: 'artifact_1234567890',
      sourceLanguage: 'en',
      targetLanguages: ['es-ES', 'fr-FR'],
      subtitlingParams: {
        'es-ES': {
          maxLinesPerSubtitle: 2,
          maxCharsPerLine: 35,
          maxCharsPerSecond: 18,
          minDurationMs: 1000,
          maxDurationMs: 6000
        },
        'fr-FR': {
          maxLinesPerSubtitle: 2,
          maxCharsPerLine: 30,
          maxCharsPerSecond: 20,
          minDurationMs: 1000,
          maxDurationMs: 6000
        }
      }
    },
    {
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      }
    }
  );

  console.log(response.data);
  ```
</RequestExample>

## Response

<ResponseField name="id" type="string">
  Unique identifier of the created video.
</ResponseField>

<ResponseField name="videoUrl" type="string">
  URL to the created video resource.
</ResponseField>

<ResponseField name="name" type="string">
  Name of the video.
</ResponseField>

<ResponseField name="status" type="string">
  Status of the video (e.g., 'new').
</ResponseField>

<ResponseField name="workflowType" type="string">
  Type of the video processing (e.g., 'dubbing').
</ResponseField>

<ResponseField name="srcLang" type="string">
  Source language code.
</ResponseField>

<ResponseField name="dstLangs" type="array">
  Array of target language codes.
</ResponseField>

<ResponseField name="videoDuration" type="number">
  Duration of the video in seconds (if available).
</ResponseField>

<ResponseField name="remark" type="string">
  Additional remarks about the video (if any).
</ResponseField>

<ResponseField name="stringVariables" type="array | null">
  Array of key-value pairs containing video metadata, if provided.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO timestamp of creation.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO timestamp of last update.
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "vid_7a92c36d4fe3c",
    "videoUrl": "https://studio.dubformer.ai/api/v1/projects/proj_5f83a14b2ec1b/videos/vid_7a92c36d4fe3c",
    "name": "New Marketing Video",
    "status": "new",
    "workflowType": "dubbing",
    "srcLang": "en",
    "dstLangs": ["es-ES", "fr-FR"],
    "videoDuration": 123.45,
    "remark": "Optional comment",
    "stringVariables": [
      { "key": "storyTitleId", "value": "12345" },
      { "key": "storyDeeplink", "value": "https://pyramid.dalet.euronews.tech?titleId=12345&kanbanViewId=7KV6cv" }
    ],
    "createdAt": "2024-06-30T12:00:00.000Z",
    "updatedAt": "2024-06-30T12:00:00.000Z"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json Error Response theme={null}
  {
    "error": "Bad Request"
  }
  ```
</ResponseExample>
