Edit a Redactor Session
Redactor example guide
Apply edits to an existing video session through the Redactor API: add audio redaction regions and create static tracks with pixel or relative coordinates.
Audio regions
Append three [start, end] time ranges, in milliseconds, to the session's existing audio regions.
Static tracks
Add full-video redaction boxes using source-pixel or normalized 0–1 coordinates.
Ordered edits
Send multiple edit requests together and correlate each result with its optional tag.
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 --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"
}
}
}'
{
"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: 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 --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"
}
]
}
}
}'
{
"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).