> 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.

# Undo an edit

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

Apply the stored guarded inverse as a new mutation. Preserve other edits and never replay generation or billing. Undo the resulting mutation to redo.

Reference: https://docs.videogen.io/rest-api-reference/projects/undo-project-edit

## 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)
- `mutationId` (string, required)

### Body (application/json)

This endpoint expects an UndoProjectEditRequest.

- `mutationId` (string, 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.

## Examples

**Request**

```json
{
  "mutationId": "string"
}
```

**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/mutationId/undo"

payload = { "mutationId": "string" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```