curl --request POST \
--url https://api.framelane.io/v1/projects/{project_id}/ops \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ops": [
{
"op": "shift_element",
"id": "<string>",
"by_seconds": 123,
"by_frames": 123
}
],
"if_version": 3,
"author": "agent",
"run_id": "<string>"
}
'import requests
url = "https://api.framelane.io/v1/projects/{project_id}/ops"
payload = {
"ops": [
{
"op": "shift_element",
"id": "<string>",
"by_seconds": 123,
"by_frames": 123
}
],
"if_version": 3,
"author": "agent",
"run_id": "<string>"
}
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({
ops: [{op: 'shift_element', id: '<string>', by_seconds: 123, by_frames: 123}],
if_version: 3,
author: 'agent',
run_id: '<string>'
})
};
fetch('https://api.framelane.io/v1/projects/{project_id}/ops', 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.framelane.io/v1/projects/{project_id}/ops",
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([
'ops' => [
[
'op' => 'shift_element',
'id' => '<string>',
'by_seconds' => 123,
'by_frames' => 123
]
],
'if_version' => 3,
'author' => 'agent',
'run_id' => '<string>'
]),
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.framelane.io/v1/projects/{project_id}/ops"
payload := strings.NewReader("{\n \"ops\": [\n {\n \"op\": \"shift_element\",\n \"id\": \"<string>\",\n \"by_seconds\": 123,\n \"by_frames\": 123\n }\n ],\n \"if_version\": 3,\n \"author\": \"agent\",\n \"run_id\": \"<string>\"\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.framelane.io/v1/projects/{project_id}/ops")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ops\": [\n {\n \"op\": \"shift_element\",\n \"id\": \"<string>\",\n \"by_seconds\": 123,\n \"by_frames\": 123\n }\n ],\n \"if_version\": 3,\n \"author\": \"agent\",\n \"run_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.framelane.io/v1/projects/{project_id}/ops")
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 \"ops\": [\n {\n \"op\": \"shift_element\",\n \"id\": \"<string>\",\n \"by_seconds\": 123,\n \"by_frames\": 123\n }\n ],\n \"if_version\": 3,\n \"author\": \"agent\",\n \"run_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"version": 123,
"ok": true,
"diff": {
"added_ids": [
"<string>"
],
"removed_ids": [
"<string>"
],
"transitions_changed": false
},
"changed_ids": [
"<string>"
],
"violations": [
{
"code": "<string>",
"message": "<string>",
"severity": "error",
"path": "<string>",
"bbox": [
123
],
"time": 123
}
]
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Apply targeted edits
Apply an atomic batch of ops to the project head. Returns the new version, the ids touched, a compact diff, and validation that rides along for free. Pass if_version for optimistic concurrency (409 on mismatch).
curl --request POST \
--url https://api.framelane.io/v1/projects/{project_id}/ops \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ops": [
{
"op": "shift_element",
"id": "<string>",
"by_seconds": 123,
"by_frames": 123
}
],
"if_version": 3,
"author": "agent",
"run_id": "<string>"
}
'import requests
url = "https://api.framelane.io/v1/projects/{project_id}/ops"
payload = {
"ops": [
{
"op": "shift_element",
"id": "<string>",
"by_seconds": 123,
"by_frames": 123
}
],
"if_version": 3,
"author": "agent",
"run_id": "<string>"
}
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({
ops: [{op: 'shift_element', id: '<string>', by_seconds: 123, by_frames: 123}],
if_version: 3,
author: 'agent',
run_id: '<string>'
})
};
fetch('https://api.framelane.io/v1/projects/{project_id}/ops', 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.framelane.io/v1/projects/{project_id}/ops",
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([
'ops' => [
[
'op' => 'shift_element',
'id' => '<string>',
'by_seconds' => 123,
'by_frames' => 123
]
],
'if_version' => 3,
'author' => 'agent',
'run_id' => '<string>'
]),
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.framelane.io/v1/projects/{project_id}/ops"
payload := strings.NewReader("{\n \"ops\": [\n {\n \"op\": \"shift_element\",\n \"id\": \"<string>\",\n \"by_seconds\": 123,\n \"by_frames\": 123\n }\n ],\n \"if_version\": 3,\n \"author\": \"agent\",\n \"run_id\": \"<string>\"\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.framelane.io/v1/projects/{project_id}/ops")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ops\": [\n {\n \"op\": \"shift_element\",\n \"id\": \"<string>\",\n \"by_seconds\": 123,\n \"by_frames\": 123\n }\n ],\n \"if_version\": 3,\n \"author\": \"agent\",\n \"run_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.framelane.io/v1/projects/{project_id}/ops")
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 \"ops\": [\n {\n \"op\": \"shift_element\",\n \"id\": \"<string>\",\n \"by_seconds\": 123,\n \"by_frames\": 123\n }\n ],\n \"if_version\": 3,\n \"author\": \"agent\",\n \"run_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"version": 123,
"ok": true,
"diff": {
"added_ids": [
"<string>"
],
"removed_ids": [
"<string>"
],
"transitions_changed": false
},
"changed_ids": [
"<string>"
],
"violations": [
{
"code": "<string>",
"message": "<string>",
"severity": "error",
"path": "<string>",
"bbox": [
123
],
"time": 123
}
]
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Targeted edits applied in order; the batch is atomic.
1- ShiftElementOp
- SetFieldsOp
- TrimElementOp
- SwapSourceOp
- AddElementOp
- RemoveElementOp
- ReorderOp
- SetTransitionOp
- RemoveTransitionOp
- SetRequestFieldsOp
- ReplaceRequestOp
Show child attributes
Show child attributes
Optimistic concurrency: reject with 409 if the head version differs.
3
Who authored this edit, for version provenance.
user, agent Agent run correlation id, stamped on the new version.
128Response
Successful Response
The result of an ops batch: never echoes the whole request.
The new head version.
True when the new head has no error-severity violations.
A structural delta between the previous head and the new head.
Show child attributes
Show child attributes
Element ids the ops touched.
Validation riding along free: cross-element and whole-timeline invariant checks. Truncated to the first 40 findings (errors first) on very large compositions, with a VIOLATIONS_TRUNCATED marker carrying the full count; the free dry run is never truncated.
Show child attributes
Show child attributes

