Edit a clip
curl --request PATCH \
--url https://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"edits": {
"trim": {
"start_ms": 500,
"end_ms": 4200
},
"speed": 1.5,
"fade_out_ms": 400
}
}
'import requests
url = "https://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits"
payload = { "edits": {
"trim": {
"start_ms": 500,
"end_ms": 4200
},
"speed": 1.5,
"fade_out_ms": 400
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({edits: {trim: {start_ms: 500, end_ms: 4200}, speed: 1.5, fade_out_ms: 400}})
};
fetch('https://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/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://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'edits' => [
'trim' => [
'start_ms' => 500,
'end_ms' => 4200
],
'speed' => 1.5,
'fade_out_ms' => 400
]
]),
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://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits"
payload := strings.NewReader("{\n \"edits\": {\n \"trim\": {\n \"start_ms\": 500,\n \"end_ms\": 4200\n },\n \"speed\": 1.5,\n \"fade_out_ms\": 400\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edits\": {\n \"trim\": {\n \"start_ms\": 500,\n \"end_ms\": 4200\n },\n \"speed\": 1.5,\n \"fade_out_ms\": 400\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"edits\": {\n \"trim\": {\n \"start_ms\": 500,\n \"end_ms\": 4200\n },\n \"speed\": 1.5,\n \"fade_out_ms\": 400\n }\n}"
response = http.request(request)
puts response.read_body{
"node_id": "vid_1",
"edits": {
"trim": {
"start_ms": 500,
"end_ms": 4200
},
"speed": 1.5,
"fade_out_ms": 400
},
"duration": 2.467,
"timeline_start": 0
}{
"error": {
"code": "invalid_args",
"message": "..."
}
}{
"error": {
"code": "unauthenticated",
"message": "..."
}
}{
"error": {
"code": "viewer_read_only",
"message": "..."
}
}{
"error": {
"code": "workflow_not_found",
"message": "..."
}
}Edit
Edit a clip
Non-destructive edits wrapped in edits. null clears a field; omitted fields are kept. The timeline box follows, like a Studio drag.
PATCH
/
v1
/
workflows
/
{id}
/
nodes
/
{node_id}
/
edits
Edit a clip
curl --request PATCH \
--url https://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"edits": {
"trim": {
"start_ms": 500,
"end_ms": 4200
},
"speed": 1.5,
"fade_out_ms": 400
}
}
'import requests
url = "https://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits"
payload = { "edits": {
"trim": {
"start_ms": 500,
"end_ms": 4200
},
"speed": 1.5,
"fade_out_ms": 400
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({edits: {trim: {start_ms: 500, end_ms: 4200}, speed: 1.5, fade_out_ms: 400}})
};
fetch('https://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/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://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'edits' => [
'trim' => [
'start_ms' => 500,
'end_ms' => 4200
],
'speed' => 1.5,
'fade_out_ms' => 400
]
]),
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://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits"
payload := strings.NewReader("{\n \"edits\": {\n \"trim\": {\n \"start_ms\": 500,\n \"end_ms\": 4200\n },\n \"speed\": 1.5,\n \"fade_out_ms\": 400\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edits\": {\n \"trim\": {\n \"start_ms\": 500,\n \"end_ms\": 4200\n },\n \"speed\": 1.5,\n \"fade_out_ms\": 400\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lavendly.ai/api/v1/workflows/{id}/nodes/{node_id}/edits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"edits\": {\n \"trim\": {\n \"start_ms\": 500,\n \"end_ms\": 4200\n },\n \"speed\": 1.5,\n \"fade_out_ms\": 400\n }\n}"
response = http.request(request)
puts response.read_body{
"node_id": "vid_1",
"edits": {
"trim": {
"start_ms": 500,
"end_ms": 4200
},
"speed": 1.5,
"fade_out_ms": 400
},
"duration": 2.467,
"timeline_start": 0
}{
"error": {
"code": "invalid_args",
"message": "..."
}
}{
"error": {
"code": "unauthenticated",
"message": "..."
}
}{
"error": {
"code": "viewer_read_only",
"message": "..."
}
}{
"error": {
"code": "workflow_not_found",
"message": "..."
}
}Authorizations
API key from Settings > API, e.g. lv_...
Body
application/json
Show child attributes
Show child attributes
Was this page helpful?