Edit a timeline
Apply edit operations as one atomic commit. Any failing operation rejects the whole edit and leaves the timeline unchanged. Send expected_head (the revision you edited) so a retry can’t apply twice. summary is the revision’s line in history (default: written from the operations); the author is you, as history and the editor’s Activity name you (send author to override). See Editing.
curl --request POST \
--url https://api.vidjutsu.ai/projects/{project}/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operations": [
{}
],
"author": null,
"branch": null,
"expected_head": null,
"idempotency_key": null,
"summary": null
}
'import requests
url = "https://api.vidjutsu.ai/projects/{project}/edits"
payload = {
"operations": [{}],
"author": None,
"branch": None,
"expected_head": None,
"idempotency_key": None,
"summary": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [{}],
author: null,
branch: null,
expected_head: null,
idempotency_key: null,
summary: null
})
};
fetch('https://api.vidjutsu.ai/projects/{project}/edits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vidjutsu.ai/projects/{project}/edits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'operations' => [
[
]
],
'author' => null,
'branch' => null,
'expected_head' => null,
'idempotency_key' => null,
'summary' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vidjutsu.ai/projects/{project}/edits"
payload := strings.NewReader("{\n \"operations\": [\n {}\n ],\n \"author\": null,\n \"branch\": null,\n \"expected_head\": null,\n \"idempotency_key\": null,\n \"summary\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vidjutsu.ai/projects/{project}/edits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {}\n ],\n \"author\": null,\n \"branch\": null,\n \"expected_head\": null,\n \"idempotency_key\": null,\n \"summary\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidjutsu.ai/projects/{project}/edits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {}\n ],\n \"author\": null,\n \"branch\": null,\n \"expected_head\": null,\n \"idempotency_key\": null,\n \"summary\": null\n}"
response = http.request(request)
puts response.read_body{
"branch": "<string>",
"duration_seconds": 123,
"parent": "<string>",
"project": "<string>",
"revision": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}Authorizations
Headers
The API version you wrote your integration against, a date. Without it you get the latest version. The current version is 2026-11-03. See https://docs.vidjutsu.ai/api-reference/introduction#versioning.
^\d{4}-\d{2}-\d{2}$"2026-11-03"
Body
- object
- object[]
Edit operations applied to a branch head as one atomic commit. The body is a list of operations, or an object with operations and optionally branch and, for safe retries, expected_head and idempotency_key. Times are seconds (12, "12.5") or fractions ("1001/30000").
Edit operations, each named by op: add_media, add_track, insert_clip, delete_clip, move_clip, trim_clip, swap_media, set_gain, set_fade, cut_pauses, set_layout. Each operation sees the result of the ones before it. See https://docs.vidjutsu.ai/guides/editing.
curl --request POST \
--url https://api.vidjutsu.ai/projects/{project}/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operations": [
{}
],
"author": null,
"branch": null,
"expected_head": null,
"idempotency_key": null,
"summary": null
}
'import requests
url = "https://api.vidjutsu.ai/projects/{project}/edits"
payload = {
"operations": [{}],
"author": None,
"branch": None,
"expected_head": None,
"idempotency_key": None,
"summary": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [{}],
author: null,
branch: null,
expected_head: null,
idempotency_key: null,
summary: null
})
};
fetch('https://api.vidjutsu.ai/projects/{project}/edits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vidjutsu.ai/projects/{project}/edits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'operations' => [
[
]
],
'author' => null,
'branch' => null,
'expected_head' => null,
'idempotency_key' => null,
'summary' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vidjutsu.ai/projects/{project}/edits"
payload := strings.NewReader("{\n \"operations\": [\n {}\n ],\n \"author\": null,\n \"branch\": null,\n \"expected_head\": null,\n \"idempotency_key\": null,\n \"summary\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vidjutsu.ai/projects/{project}/edits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {}\n ],\n \"author\": null,\n \"branch\": null,\n \"expected_head\": null,\n \"idempotency_key\": null,\n \"summary\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidjutsu.ai/projects/{project}/edits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {}\n ],\n \"author\": null,\n \"branch\": null,\n \"expected_head\": null,\n \"idempotency_key\": null,\n \"summary\": null\n}"
response = http.request(request)
puts response.read_body{
"branch": "<string>",
"duration_seconds": 123,
"parent": "<string>",
"project": "<string>",
"revision": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}{
"code": "unauthenticated",
"message": "<string>",
"request_id": "<string>",
"reason": "<string>",
"checkout_url": "<string>",
"top_up_url": "<string>",
"upgrade_url": "<string>",
"media_deletes_at": "2023-11-07T05:31:56Z",
"contact_url": "<string>",
"retry_after_seconds": 123,
"latest_version": "<string>"
}