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

# Video Editing

> Edit an existing video with a product placement or visual change. Provide one to three product images and clear placement instructions. Source and output videos are limited to 45 seconds. Use only media and likenesses you are authorized to use.

Authenticate with a Darwin API key carrying `tools:execute`. Supply an `Idempotency-Key` of 1 to 200 characters, and reuse it only when retrying the exact same request. Keys without access return `403 API_UNAVAILABLE` before request validation.

See the [Video Editing guide](https://darwin.so/docs/agents/video-editing) for the defined media inputs.


## OpenAPI

````yaml openapi-originals.json POST /v3/originals/video-editing
openapi: 3.1.0
info:
  title: Darwin Originals
  version: 3.0.0
  description: POST endpoints for Darwin Originals.
servers:
  - url: https://api.darwin.so/api
security: []
tags:
  - name: Marketing
  - name: Sales
  - name: Data
  - name: Intelligence
  - name: Video
  - name: Audio
  - name: Design
  - name: Shopping
paths:
  /v3/originals/video-editing:
    post:
      tags:
        - Video
      summary: Video Editing
      description: >-
        Edit an existing video with a product placement or visual change.
        Provide one to three product images and clear placement instructions.
        Source and output videos are limited to 45 seconds. Use only media and
        likenesses you are authorized to use.
      operationId: video_editing
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 200
          description: Reuse the same key only for an identical request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                videoUrl:
                  type: string
                  maxLength: 2048
                  format: uri
                  description: Source MP4 or MOV video, up to 45 seconds.
                instructions:
                  type: string
                  minLength: 1
                  maxLength: 4000
                  description: >-
                    Describe the requested changes and what should stay
                    consistent.
                productImages:
                  minItems: 1
                  maxItems: 3
                  type: array
                  items:
                    type: string
                    maxLength: 2048
                    format: uri
                  description: One to three JPG, PNG, or WebP images of the same product.
              required:
                - videoUrl
                - instructions
                - productImages
              additionalProperties: false
            example:
              videoUrl: https://media.example.com/source.mp4
              productImages:
                - https://media.example.com/product.png
              instructions: >-
                Place the product on the table, keeping the original camera
                motion and lighting.
      responses:
        '200':
          description: Generated video.
          content:
            application/json:
              schema:
                type: object
                required:
                  - video
                properties:
                  video:
                    type: object
                    required:
                      - url
                      - durationSeconds
                      - mimeType
                    properties:
                      url:
                        type: string
                        format: uri
                      durationSeconds:
                        type: number
                        maximum: 45
                      mimeType:
                        type: string
                        const: video/mp4
        '400':
          description: Invalid media references or instructions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  supportEmail:
                    type: string
        '401':
          description: API key missing or invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  supportEmail:
                    type: string
        '403':
          description: >-
            API_UNAVAILABLE: contact support@darwin.so for access, or
            insufficient scope.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  supportEmail:
                    type: string
        '422':
          description: Unsupported media or source video longer than 45 seconds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  supportEmail:
                    type: string
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  supportEmail:
                    type: string
        '503':
          description: 'API_UNAVAILABLE: contact support@darwin.so for access.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  supportEmail:
                    type: string
      security:
        - apiKey: []
        - apiKeyBearer: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
    apiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: Darwin API key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.