> ## 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 a source video using product images and placement instructions.

Use a Darwin API key with `tools:execute`. Send the source video, one to three product images, and specific editing instructions. Source and output videos are limited to 45 seconds. Keep the same `Idempotency-Key` when retrying the exact request.

See the [Video Editing guide](/docs/agents/video-editing) for preparing assets and reviewing the result.


## OpenAPI

````yaml openapi-agents.json POST /v3/agents/video-editing
openapi: 3.1.0
info:
  title: Agents
  version: 3.0.0
  description: Run specialized marketing agents with an authenticated Darwin API key.
servers:
  - url: https://api.darwin.so/api
security: []
paths:
  /v3/agents/video-editing:
    post:
      tags:
        - Marketing
      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.