1. Create a workflow from shots
curl --request POST \
--url https://lavendly.ai/api/v1/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Ocean facts",
"project_name": "API",
"aspect": "9:16",
"shots": [
{
"prompt": "Slow push-in on a coral reef at dawn",
"duration": 6
},
{
"prompt": "A sea turtle glides past the camera",
"duration": 6
}
]
}
'import requests
url = "https://lavendly.ai/api/v1/workflows"
payload = {
"name": "Ocean facts",
"project_name": "API",
"aspect": "9:16",
"shots": [
{
"prompt": "Slow push-in on a coral reef at dawn",
"duration": 6
},
{
"prompt": "A sea turtle glides past the camera",
"duration": 6
}
]
}
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({
name: 'Ocean facts',
project_name: 'API',
aspect: '9:16',
shots: [
{prompt: 'Slow push-in on a coral reef at dawn', duration: 6},
{prompt: 'A sea turtle glides past the camera', duration: 6}
]
})
};
fetch('https://lavendly.ai/api/v1/workflows', 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",
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([
'name' => 'Ocean facts',
'project_name' => 'API',
'aspect' => '9:16',
'shots' => [
[
'prompt' => 'Slow push-in on a coral reef at dawn',
'duration' => 6
],
[
'prompt' => 'A sea turtle glides past the camera',
'duration' => 6
]
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"Ocean facts\",\n \"project_name\": \"API\",\n \"aspect\": \"9:16\",\n \"shots\": [\n {\n \"prompt\": \"Slow push-in on a coral reef at dawn\",\n \"duration\": 6\n },\n {\n \"prompt\": \"A sea turtle glides past the camera\",\n \"duration\": 6\n }\n ]\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://lavendly.ai/api/v1/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ocean facts\",\n \"project_name\": \"API\",\n \"aspect\": \"9:16\",\n \"shots\": [\n {\n \"prompt\": \"Slow push-in on a coral reef at dawn\",\n \"duration\": 6\n },\n {\n \"prompt\": \"A sea turtle glides past the camera\",\n \"duration\": 6\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lavendly.ai/api/v1/workflows")
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 \"name\": \"Ocean facts\",\n \"project_name\": \"API\",\n \"aspect\": \"9:16\",\n \"shots\": [\n {\n \"prompt\": \"Slow push-in on a coral reef at dawn\",\n \"duration\": 6\n },\n {\n \"prompt\": \"A sea turtle glides past the camera\",\n \"duration\": 6\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"project_id": "<string>",
"nodes": "<array>",
"edges": "<array>",
"duration": 123,
"created_at": 123,
"updated_at": 123
}{
"error": {
"code": "invalid_args",
"message": "..."
}
}{
"error": {
"code": "unauthenticated",
"message": "..."
}
}{
"error": {
"code": "file_too_large",
"message": "..."
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded for mutation requests. Retry in ~12s.",
"retry_after_ms": 11480,
"limit": 20,
"window_seconds": 60,
"class": "mutation"
}
}Create to publish
1. Create a workflow from shots
Free. A workflow is one video. Pass shots and the server builds the scenes. Filed into project_name (created if missing) or project_id.
POST
/
v1
/
workflows
1. Create a workflow from shots
curl --request POST \
--url https://lavendly.ai/api/v1/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Ocean facts",
"project_name": "API",
"aspect": "9:16",
"shots": [
{
"prompt": "Slow push-in on a coral reef at dawn",
"duration": 6
},
{
"prompt": "A sea turtle glides past the camera",
"duration": 6
}
]
}
'import requests
url = "https://lavendly.ai/api/v1/workflows"
payload = {
"name": "Ocean facts",
"project_name": "API",
"aspect": "9:16",
"shots": [
{
"prompt": "Slow push-in on a coral reef at dawn",
"duration": 6
},
{
"prompt": "A sea turtle glides past the camera",
"duration": 6
}
]
}
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({
name: 'Ocean facts',
project_name: 'API',
aspect: '9:16',
shots: [
{prompt: 'Slow push-in on a coral reef at dawn', duration: 6},
{prompt: 'A sea turtle glides past the camera', duration: 6}
]
})
};
fetch('https://lavendly.ai/api/v1/workflows', 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",
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([
'name' => 'Ocean facts',
'project_name' => 'API',
'aspect' => '9:16',
'shots' => [
[
'prompt' => 'Slow push-in on a coral reef at dawn',
'duration' => 6
],
[
'prompt' => 'A sea turtle glides past the camera',
'duration' => 6
]
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"Ocean facts\",\n \"project_name\": \"API\",\n \"aspect\": \"9:16\",\n \"shots\": [\n {\n \"prompt\": \"Slow push-in on a coral reef at dawn\",\n \"duration\": 6\n },\n {\n \"prompt\": \"A sea turtle glides past the camera\",\n \"duration\": 6\n }\n ]\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://lavendly.ai/api/v1/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ocean facts\",\n \"project_name\": \"API\",\n \"aspect\": \"9:16\",\n \"shots\": [\n {\n \"prompt\": \"Slow push-in on a coral reef at dawn\",\n \"duration\": 6\n },\n {\n \"prompt\": \"A sea turtle glides past the camera\",\n \"duration\": 6\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lavendly.ai/api/v1/workflows")
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 \"name\": \"Ocean facts\",\n \"project_name\": \"API\",\n \"aspect\": \"9:16\",\n \"shots\": [\n {\n \"prompt\": \"Slow push-in on a coral reef at dawn\",\n \"duration\": 6\n },\n {\n \"prompt\": \"A sea turtle glides past the camera\",\n \"duration\": 6\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"project_id": "<string>",
"nodes": "<array>",
"edges": "<array>",
"duration": 123,
"created_at": 123,
"updated_at": 123
}{
"error": {
"code": "invalid_args",
"message": "..."
}
}{
"error": {
"code": "unauthenticated",
"message": "..."
}
}{
"error": {
"code": "file_too_large",
"message": "..."
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded for mutation requests. Retry in ~12s.",
"retry_after_ms": 11480,
"limit": 20,
"window_seconds": 60,
"class": "mutation"
}
}Body
application/json
Was this page helpful?