Skip to main content
POST
/
v1
/
workflows
/
trigger
/
{workflowID}
/
{versionID}
Trigger workflow execution
curl --request POST \
  --url https://api.eachlabs.ai/v1/workflows/trigger/{workflowID}/{versionID} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --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 = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', '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 => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);

$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("X-API-Key", "<api-key>")
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("X-API-Key", "<api-key>")
.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["X-API-Key"] = '<api-key>'
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

X-API-Key
string
header
required

API key for authentication

Path Parameters

workflowID
string
required

Workflow ID or slug to execute.

versionID
string
required

Workflow version ID to execute.

Query Parameters

webhook_url
string<uri>

Optional compatibility query parameter for execution completion webhooks. The request body field takes precedence when both are present.

Body

application/json
inputs
object

Input values defined by the workflow version. May be omitted for workflows with no inputs.

Example:
{
"prompt": "A cinematic establishing shot of a mountain lake"
}
webhook_url
string<uri>

Optional webhook URL for workflow execution completion.

Example:

"https://your-app.com/webhook"

webhook_secret
string

Optional secret used to sign workflow webhook requests.

Example:

"your-secret-key"

Response

Workflow execution queued

execution_id
string

Queued workflow execution identifier.

Example:

"exec_xyz789"

status
enum<string>

Execution queue status returned immediately after triggering.

Available options:
queued
Example:

"queued"

Last modified on June 17, 2026