curl --request POST \
--url https://api.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {
"prompt": "A cinematic establishing shot of a mountain lake"
},
"webhook_url": "https://your-app.com/webhook",
"webhook_secret": "your-secret-key"
}
'import requests
url = "https://api.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}"
payload = {
"inputs": { "prompt": "A cinematic establishing shot of a mountain lake" },
"webhook_url": "https://your-app.com/webhook",
"webhook_secret": "your-secret-key"
}
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({
inputs: {prompt: 'A cinematic establishing shot of a mountain lake'},
webhook_url: 'https://your-app.com/webhook',
webhook_secret: 'your-secret-key'
})
};
fetch('https://api.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}', 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.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}",
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([
'inputs' => [
'prompt' => 'A cinematic establishing shot of a mountain lake'
],
'webhook_url' => 'https://your-app.com/webhook',
'webhook_secret' => 'your-secret-key'
]),
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.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}"
payload := strings.NewReader("{\n \"inputs\": {\n \"prompt\": \"A cinematic establishing shot of a mountain lake\"\n },\n \"webhook_url\": \"https://your-app.com/webhook\",\n \"webhook_secret\": \"your-secret-key\"\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.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {\n \"prompt\": \"A cinematic establishing shot of a mountain lake\"\n },\n \"webhook_url\": \"https://your-app.com/webhook\",\n \"webhook_secret\": \"your-secret-key\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}")
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 \"inputs\": {\n \"prompt\": \"A cinematic establishing shot of a mountain lake\"\n },\n \"webhook_url\": \"https://your-app.com/webhook\",\n \"webhook_secret\": \"your-secret-key\"\n}"
response = http.request(request)
puts response.read_body{
"execution_id": "exec_xyz789",
"status": "queued"
}{
"error": "slug parameter is required"
}{
"error": "Invalid or missing API key"
}{
"error": "insufficient balance"
}{
"error": "forbidden"
}{
"error": "Failed to fetch model: model not found"
}{
"error": "Request timeout"
}{
"error": "conflict"
}{
"error": "Failed to fetch models: internal error"
}{
"error": "workflows-engine unavailable"
}Trigger workflow execution
Start an asynchronous workflow execution through api-service. This route forwards to workflows-engine and requires callers to pin the workflow version in the path.
The immediate response only confirms the workflow was queued. Downstream workflow
lifecycle statuses are running, completed, failed, and cancelled.
To queue several executions of the same version in one call, use the bulk trigger route.
curl --request POST \
--url https://api.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {
"prompt": "A cinematic establishing shot of a mountain lake"
},
"webhook_url": "https://your-app.com/webhook",
"webhook_secret": "your-secret-key"
}
'import requests
url = "https://api.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}"
payload = {
"inputs": { "prompt": "A cinematic establishing shot of a mountain lake" },
"webhook_url": "https://your-app.com/webhook",
"webhook_secret": "your-secret-key"
}
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({
inputs: {prompt: 'A cinematic establishing shot of a mountain lake'},
webhook_url: 'https://your-app.com/webhook',
webhook_secret: 'your-secret-key'
})
};
fetch('https://api.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}', 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.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}",
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([
'inputs' => [
'prompt' => 'A cinematic establishing shot of a mountain lake'
],
'webhook_url' => 'https://your-app.com/webhook',
'webhook_secret' => 'your-secret-key'
]),
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.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}"
payload := strings.NewReader("{\n \"inputs\": {\n \"prompt\": \"A cinematic establishing shot of a mountain lake\"\n },\n \"webhook_url\": \"https://your-app.com/webhook\",\n \"webhook_secret\": \"your-secret-key\"\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.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {\n \"prompt\": \"A cinematic establishing shot of a mountain lake\"\n },\n \"webhook_url\": \"https://your-app.com/webhook\",\n \"webhook_secret\": \"your-secret-key\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID}")
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 \"inputs\": {\n \"prompt\": \"A cinematic establishing shot of a mountain lake\"\n },\n \"webhook_url\": \"https://your-app.com/webhook\",\n \"webhook_secret\": \"your-secret-key\"\n}"
response = http.request(request)
puts response.read_body{
"execution_id": "exec_xyz789",
"status": "queued"
}{
"error": "slug parameter is required"
}{
"error": "Invalid or missing API key"
}{
"error": "insufficient balance"
}{
"error": "forbidden"
}{
"error": "Failed to fetch model: model not found"
}{
"error": "Request timeout"
}{
"error": "conflict"
}{
"error": "Failed to fetch models: internal error"
}{
"error": "workflows-engine unavailable"
}Authorizations
API key passed as Authorization: Bearer <api_key>
Path Parameters
Workflow ID or slug to execute.
Workflow version ID to execute.
Query Parameters
Optional compatibility query parameter for execution completion webhooks. The request body field takes precedence when both are present.
Body
Input values defined by the workflow version. May be omitted for workflows with no inputs.
{
"prompt": "A cinematic establishing shot of a mountain lake"
}
Optional webhook URL for workflow execution completion.
"https://your-app.com/webhook"
Optional secret used to sign workflow webhook requests.
"your-secret-key"