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

# Edit a clip

> Non-destructive edits wrapped in `edits`. null clears a field; omitted fields are kept. The timeline box follows, like a Studio drag.



## OpenAPI

````yaml https://lavendly.ai/openapi.json patch /v1/workflows/{id}/nodes/{node_id}/edits
openapi: 3.1.0
info:
  title: Lavendly API
  version: 1.1.0
  description: >-
    The Lavendly v1 API: build a video from shots, price it, generate the
    scenes, render the film, and publish it. Authenticate with a Bearer API key
    (lv_...) from Settings > API. Rate limits are per account per minute: 20
    writes, 60 render polls, 120 other reads; a 429 carries Retry-After and
    retry_after_ms. Errors are { error: { code, message } }; 5xx adds a ref. The
    same API is an MCP server at https://mcp.lavendly.ai/mcp and in the
    @lavendly/mcp npm package.
  contact:
    name: Lavendly
    email: hello@lavendly.ai
servers:
  - url: https://lavendly.ai/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Create to publish
    description: The main loop, in order.
  - name: Workflows
  - name: Edit
  - name: Audio
  - name: Assets
  - name: Renders
  - name: Account
  - name: Single clips
paths:
  /v1/workflows/{id}/nodes/{node_id}/edits:
    parameters:
      - name: id
        in: path
        required: true
        description: Workflow id
        schema:
          type: string
      - name: node_id
        in: path
        required: true
        description: Clip node id
        schema:
          type: string
    patch:
      tags:
        - Edit
      summary: Edit a clip
      description: >-
        Non-destructive edits wrapped in `edits`. null clears a field; omitted
        fields are kept. The timeline box follows, like a Studio drag.
      operationId: editClip
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - edits
              properties:
                edits:
                  type: object
                  properties:
                    trim:
                      type: object
                      properties:
                        start_ms:
                          type: integer
                        end_ms:
                          type: integer
                      description: Source milliseconds
                    speed:
                      type: number
                      description: 0.1 to 8
                    volume:
                      type: number
                      description: 0 to 4
                    mute:
                      type: boolean
                    fade_in_ms:
                      type: integer
                    fade_out_ms:
                      type: integer
                    crop:
                      type: object
                      properties:
                        x:
                          type: number
                        'y':
                          type: number
                        w:
                          type: number
                        h:
                          type: number
                    rotate:
                      type: number
                    flip:
                      type: string
                    reverse:
                      type: boolean
                    loop:
                      type: boolean
                    color:
                      type: object
                    stabilize:
                      type: boolean
            example:
              edits:
                trim:
                  start_ms: 500
                  end_ms: 4200
                speed: 1.5
                fade_out_ms: 400
      responses:
        '200':
          description: Edits applied
          content:
            application/json:
              schema:
                type: object
                properties:
                  node_id:
                    type: string
                  edits:
                    type: object
                  duration:
                    type:
                      - number
                      - 'null'
                  timeline_start:
                    type:
                      - number
                      - 'null'
              example:
                node_id: vid_1
                edits:
                  trim:
                    start_ms: 500
                    end_ms: 4200
                  speed: 1.5
                  fade_out_ms: 400
                duration: 2.467
                timeline_start: 0
        '400':
          $ref: '#/components/responses/E400'
        '401':
          $ref: '#/components/responses/E401'
        '403':
          $ref: '#/components/responses/E403'
        '404':
          $ref: '#/components/responses/E404'
components:
  responses:
    E400:
      description: Bad request (invalid_args, invalid_edits, invalid_split, video_too_long)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_args
              message: ...
    E401:
      description: Missing or revoked key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthenticated
              message: ...
    E403:
      description: forbidden, unverified, viewer_read_only
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: viewer_read_only
              message: ...
    E404:
      description: >-
        workflow_not_found, node_not_found, job_not_found, channel_not_found,
        track_not_found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: workflow_not_found
              message: ...
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            ref:
              type: string
              description: '5xx only: quote to support'
            retry_after_ms:
              type: integer
              description: 429 rate_limited only
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key from Settings > API, e.g. lv_...

````