---
source: sighthound-developer-portal
url: https://dev.sighthound.com/redactor/examples/edit/
markdown-url: https://dev.sighthound.com/redactor/examples/edit.md
title: "Edit a Redactor Session"
description: "Use the Redactor EDIT feature to add audio regions and static tracks to a video session."
content-type: text/markdown
---

> For AI agents: a documentation index is available at [llms.txt](https://dev.sighthound.com/llms.txt). Markdown versions are available at matching `.md` URLs.

# Edit a Redactor Session

<div class="portal-doc-hero portal-doc-hero--compact" markdown>
<p class="portal-doc-kicker">Redactor example guide</p>
<p class="portal-doc-intro">Apply edits to an existing video session through the Redactor API: add audio redaction regions and create static tracks with pixel or relative coordinates.</p>
</div>

<div class="portal-feature-grid">
    <div class="portal-feature-card">
        <h3><i class="portal-icon" data-lucide="volume-x"></i> Audio regions</h3>
        <p>Append three <code>[start, end]</code> time ranges, in milliseconds, to the session's existing audio regions.</p>
    </div>
    <div class="portal-feature-card">
        <h3><i class="portal-icon" data-lucide="square"></i> Static tracks</h3>
        <p>Add full-video redaction boxes using source-pixel or normalized 0–1 coordinates.</p>
    </div>
    <div class="portal-feature-card">
        <h3><i class="portal-icon" data-lucide="list-ordered"></i> Ordered edits</h3>
        <p>Send multiple edit requests together and correlate each result with its optional tag.</p>
    </div>
</div>

Use the `EDIT` feature with `videoContext.editConfig.requests` to apply edits to a video session. This example first prepares a video with a known session ID, then targets that session with a `session://` URI. `addAudioRegions` appends and normalizes the provided ranges; it does not replace audio regions already in the session.

The `EDIT` operation updates the session but does not render a video. To export a redacted video, run a separate `MEDIA_RENDER` request after editing.

## Prepare the video session

Assign a stable `sessionId` when preparing the video. The next request uses that ID as `session://edit-demo-001`.

=== "curl"

```sh
curl --location --request POST 'http://localhost:9000/api/v1/videos:process' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YourRedactorApiToken' \
--data-raw '{
    "inputUri": "https://example.com/path/to/input.mp4",
    "features": ["MEDIA_PREPARE"],
    "videoContext": {
        "prepareConfig": {
            "sessionId": "edit-demo-001"
        }
    }
}'
```

=== "JSON Body"

```json
{
    "inputUri": "https://example.com/path/to/input.mp4",
    "features": ["MEDIA_PREPARE"],
    "videoContext": {
        "prepareConfig": {
            "sessionId": "edit-demo-001"
        }
    }
}
```

## Add three audio regions and static tracks

The `regions` values below are `[start, end]` pairs in milliseconds; adjust them to fit the duration of your video. The `staticTrack` request uses the two boxes from `addEditFeature()` in the [Redactor API playground](https://sh-io-downloads.s3.us-east-1.amazonaws.com/redactor/api-playground/redactor-api-playground.zip): the first uses source-pixel coordinates, and the second uses normalized coordinates because `relative` is `true`. Each box creates a static object across the video.

=== "curl"

```sh
curl --location --request POST 'http://localhost:9000/api/v1/videos:process' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YourRedactorApiToken' \
--data-raw '{
    "inputUri": "session://edit-demo-001",
    "features": ["EDIT"],
    "videoContext": {
        "editConfig": {
            "requests": [
                {
                    "request": "addAudioRegions",
                    "regions": [[1000, 2500], [6200, 7800], [12000, 13800]],
                    "tag": "audio-regions-demo"
                },
                {
                    "request": "staticTrack",
                    "boxes": [
                        { "x": 10, "y": 10, "width": 10, "height": 10 },
                        { "x": 0.01, "y": 0.125, "width": 0.05, "height": 0.75, "relative": true }
                    ],
                    "timestamp": 0,
                    "tag": "static-track-demo"
                }
            ]
        }
    }
}'
```

=== "JSON Body"

```json
{
    "inputUri": "session://edit-demo-001",
    "features": ["EDIT"],
    "videoContext": {
        "editConfig": {
            "requests": [
                {
                    "request": "addAudioRegions",
                    "regions": [[1000, 2500], [6200, 7800], [12000, 13800]],
                    "tag": "audio-regions-demo"
                },
                {
                    "request": "staticTrack",
                    "boxes": [
                        { "x": 10, "y": 10, "width": 10, "height": 10 },
                        { "x": 0.01, "y": 0.125, "width": 0.05, "height": 0.75, "relative": true }
                    ],
                    "timestamp": 0,
                    "tag": "static-track-demo"
                }
            ]
        }
    }
}
```

When the operation completes, `processResult.edited` contains one result per edit request in the same order. An `addAudioRegions` request returns an acknowledgement; a `staticTrack` response includes a UUID for each box.

If the video should be rendered with an audio mask, submit a render request after the edit and configure `videoContext.renderConfig.maskAudio` (for example, `SILENCE`).

---

# Agent Instructions

Use this Markdown page as context for Sighthound Developer Portal questions. For broader navigation, read https://dev.sighthound.com/llms.txt. Answer from Sighthound documentation, cite relevant source URLs, and do not ask users to paste secrets, tokens, license keys, or credentials into chat.
