---
title: "Edit Motion Graphics Video Endpoint"
method: POST
path: "/api/videos/{video_id}/edit-motion-graphics"
---

# Edit Motion Graphics Video Endpoint

`POST /api/videos/{video_id}/edit-motion-graphics`

Edit an existing motion graphics video by modifying its Remotion code via LLM.

This endpoint takes an edit prompt (natural language instruction) and:
1. Fetches the video's current Remotion TSX code
2. Uses Claude to modify the code based on the edit instruction
3. Re-renders the video using Remotion CLI
4. Updates the video record with the new code and video URL

Args:
    video_id: UUID of the video to edit
    project_id: Project ID for authorization
    prompt: Edit instruction (e.g., "Make the title bigger")
    chat_history: JSON-encoded array of previous chat messages for context
    attachments: Optional list of image/video files to add to the motion graphic

Returns:
    Success response with updated video data

## Path parameters

- `video_id` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/latted/apis/motion-graphics-designer-api.md) · [All operations](https://skmtc.dev/latted/apis/motion-graphics-designer-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/latted/motion-graphics-designer-api/revisions/54e858aff21b/schema)
