> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.videogen.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.videogen.io/_mcp/server.

# Apply project edits

POST https://api.videogen.io/v1/projects/{projectId}/mutations
Content-Type: application/json

Atomically edit project presentation, artifact names or supported saved workflow settings. Each changed document requires its inspected revision. Settings changes do not generate or alter existing output videos.

Reference: https://docs.videogen.io/rest-api-reference/projects/apply-project-edits

## Authentication

- `Authorization` header (bearer token, required) — API key from [app.videogen.io/api](https://app.videogen.io/api). The full key is only shown once when you create it.

## Request

### Path parameters

- `projectId` (string, required)

### Body (application/json)

This endpoint expects an ApplyProjectEditsRequest.

- `mutationId` (string, required)
- `commands` (list of ApplyProjectEditsRequestCommandsItems, required)
- `expectedDocuments` (list of ApplyProjectEditsRequestExpectedDocumentsItems, required)

## Response

### 200

Current authorized result.

- `projectId` (string, required)
- `mutationId` (string, required)
- `outcome` (enum, required)
  - Allowed values: `APPLIED`, `NO_OP`, `CONFLICT`, `STARTED`
- `projectRevision` (integer, required)
- `editableVideoId` (string, optional)
- `videoEditId` (string, optional) — Present when outcome is STARTED. Follow this id in GET /v1/projects/\{projectId}/video-edits.

## Types

### ApplyProjectEditsRequestCommandsItems

- ApplyProjectEditsRequestCommandsItems0
- ApplyProjectEditsRequestCommandsItems1
- ApplyProjectEditsRequestCommandsItems2
- ApplyProjectEditsRequestCommandsItems3
- ApplyProjectEditsRequestCommandsItems4
- ApplyProjectEditsRequestCommandsItems5
- ApplyProjectEditsRequestCommandsItems6
- ApplyProjectEditsRequestCommandsItems7
- ApplyProjectEditsRequestCommandsItems8
- ApplyProjectEditsRequestCommandsItems9
- ApplyProjectEditsRequestCommandsItems10
- ApplyProjectEditsRequestCommandsItems11
- ApplyProjectEditsRequestCommandsItems12
- ApplyProjectEditsRequestCommandsItems13
- ApplyProjectEditsRequestCommandsItems14
- ApplyProjectEditsRequestCommandsItems15
- ApplyProjectEditsRequestCommandsItems16
- ApplyProjectEditsRequestCommandsItems17
- ApplyProjectEditsRequestCommandsItems18
- ApplyProjectEditsRequestCommandsItems19
- ApplyProjectEditsRequestCommandsItems20
- ApplyProjectEditsRequestCommandsItems21
- ApplyProjectEditsRequestCommandsItems22
- ApplyProjectEditsRequestCommandsItems23
- ApplyProjectEditsRequestCommandsItems24
- ApplyProjectEditsRequestCommandsItems25

### ApplyProjectEditsRequestExpectedDocumentsItems

- ApplyProjectEditsRequestExpectedDocumentsItems0
- ApplyProjectEditsRequestExpectedDocumentsItems1
- ApplyProjectEditsRequestExpectedDocumentsItems2

### ApplyProjectEditsRequestCommandsItems0

- `type` ("INSERT_STORYBOARD_SCENE", required)
- `workflowId` (string, required)
- `atIndex` (integer, required)
- `title` (string, required)
- `prompt` (string, required)
- `voiceoverScript` (string, required, nullable)
- `durationSeconds` (double, required, nullable)

### ApplyProjectEditsRequestCommandsItems1

- `type` ("DUPLICATE_STORYBOARD_SCENE", required)
- `workflowId` (string, required)
- `sceneId` (string, required)

### ApplyProjectEditsRequestCommandsItems2

- `type` ("INSERT_GENERATIVE_SLIDESHOW_SLIDE", required)
- `workflowId` (string, required)
- `atIndex` (integer, required)
- `narration` (string, required)
- `imagePrompt` (string, required)

### ApplyProjectEditsRequestCommandsItems3

- `type` ("DUPLICATE_SLIDESHOW_SLIDE", required)
- `workflowId` (string, required)
- `slideId` (string, required)

### ApplyProjectEditsRequestCommandsItems4

- `type` ("DELETE_SLIDESHOW_SLIDE", required)
- `workflowId` (string, required)
- `slideId` (string, required)

### ApplyProjectEditsRequestCommandsItems5

- `type` ("MOVE_SLIDESHOW_SLIDE", required)
- `workflowId` (string, required)
- `slideId` (string, required)
- `toIndex` (integer, required)

### ApplyProjectEditsRequestCommandsItems6

- `type` ("SET_SLIDESHOW_SLIDE_NARRATION", required)
- `workflowId` (string, required)
- `slideId` (string, required)
- `narration` (string, required)

### ApplyProjectEditsRequestCommandsItems7

- `type` ("SET_SLIDESHOW_SLIDE_IMAGE_PROMPT", required)
- `workflowId` (string, required)
- `slideId` (string, required)
- `imagePrompt` (string, required)

### ApplyProjectEditsRequestCommandsItems8

- `type` ("SET_STORYBOARD_SCENE_TITLE", required)
- `workflowId` (string, required)
- `sceneId` (string, required)
- `title` (string, required)

### ApplyProjectEditsRequestCommandsItems9

- `type` ("SET_STORYBOARD_SCENE_PROMPT", required)
- `workflowId` (string, required)
- `sceneId` (string, required)
- `prompt` (string, required)

### ApplyProjectEditsRequestCommandsItems10

- `type` ("SET_STORYBOARD_SCENE_VOICEOVER", required)
- `workflowId` (string, required)
- `sceneId` (string, required)
- `script` (string, required, nullable)

### ApplyProjectEditsRequestCommandsItems11

- `type` ("SET_STORYBOARD_SCENE_DURATION", required)
- `workflowId` (string, required)
- `sceneId` (string, required)
- `durationSeconds` (double, required, nullable)

### ApplyProjectEditsRequestCommandsItems12

- `type` ("SET_STORYBOARD_SCENE_STYLE", required)
- `workflowId` (string, required)
- `sceneId` (string, required)
- `style` (string, required, nullable)

### ApplyProjectEditsRequestCommandsItems13

- `type` ("DELETE_STORYBOARD_SCENE", required)
- `workflowId` (string, required)
- `sceneId` (string, required)

### ApplyProjectEditsRequestCommandsItems14

- `type` ("MOVE_STORYBOARD_SCENE", required)
- `workflowId` (string, required)
- `sceneId` (string, required)
- `toIndex` (integer, required)

### ApplyProjectEditsRequestCommandsItems15

- `type` ("SET_PROJECT_TITLE", required)
- `title` (string, required)

### ApplyProjectEditsRequestCommandsItems16

- `type` ("SET_PROJECT_DESCRIPTION", required)
- `description` (string, required, nullable)

### ApplyProjectEditsRequestCommandsItems17

- `type` ("RENAME_ARTIFACT", required)
- `artifactId` (string, required)
- `name` (string, required)

### ApplyProjectEditsRequestCommandsItems18

- `type` ("SET_WORKFLOW_SCRIPT", required)
- `workflowId` (string, required)
- `script` (string, required)

### ApplyProjectEditsRequestCommandsItems19

- `type` ("EDIT_WORKFLOW_SCRIPT_PASSAGE", required)
- `workflowId` (string, required)
- `start` (integer, required)
- `end` (integer, required)
- `expectedText` (string, required)
- `replacement` (string, required)

### ApplyProjectEditsRequestCommandsItems20

- `type` ("SET_WORKFLOW_CAPTIONS", required)
- `workflowId` (string, required)
- `enabled` (boolean, required)

### ApplyProjectEditsRequestCommandsItems21

- `type` ("SET_WORKFLOW_BACKGROUND_MUSIC", required)
- `workflowId` (string, required)
- `enabled` (boolean, required)

### ApplyProjectEditsRequestCommandsItems22

- `type` ("SET_WORKFLOW_VOICE_SPEED", required)
- `workflowId` (string, required)
- `speed` (double, required)

### ApplyProjectEditsRequestCommandsItems23

- `type` ("SET_WORKFLOW_ASPECT_RATIO", required)
- `workflowId` (string, required)
- `width` (integer, required)
- `height` (integer, required)

### ApplyProjectEditsRequestCommandsItems24

- `type` ("SET_WORKFLOW_QUALITY", required)
- `workflowId` (string, required)
- `target` (enum, required)
  - Allowed values: `IMAGE`, `VIDEO`
- `quality` (enum, required)
  - Allowed values: `LOW`, `STANDARD`, `HIGH`, `MAX`

### ApplyProjectEditsRequestCommandsItems25

- `type` ("SET_WORKFLOW_SLIDE_SCRIPTS", required)
- `workflowId` (string, required)
- `scripts` (list of string, required)

### ApplyProjectEditsRequestExpectedDocumentsItems0

- `kind` ("PROJECT", required)
- `revision` (integer, required)

### ApplyProjectEditsRequestExpectedDocumentsItems1

- `kind` ("ARTIFACT", required)
- `artifactId` (string, required)
- `revision` (integer, required)

### ApplyProjectEditsRequestExpectedDocumentsItems2

- `kind` ("WORKFLOW", required)
- `workflowId` (string, required)
- `revision` (integer, required)

## Examples

**Request**

```json
{
  "mutationId": "string",
  "commands": [
    {
      "atIndex": 1,
      "durationSeconds": 1.1,
      "prompt": "string",
      "title": "string",
      "type": "string",
      "voiceoverScript": "string",
      "workflowId": "string"
    }
  ],
  "expectedDocuments": [
    {
      "kind": "string",
      "revision": 1
    }
  ]
}
```

**Response**

```json
{
  "projectId": "string",
  "mutationId": "string",
  "outcome": "APPLIED",
  "projectRevision": 1,
  "editableVideoId": "string",
  "videoEditId": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.videogen.io/v1/projects/projectId/mutations"

payload = {
    "mutationId": "string",
    "commands": [
        {
            "atIndex": 1,
            "durationSeconds": 1.1,
            "prompt": "string",
            "title": "string",
            "type": "string",
            "voiceoverScript": "string",
            "workflowId": "string"
        }
    ],
    "expectedDocuments": [
        {
            "kind": "string",
            "revision": 1
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```