Create or update workflow version
curl --request PUT \
--url https://api.eachlabs.ai/v1/workflows/{workflowID}/versions/{versionID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version_id": "v2",
"definition": {
"version": "v2",
"steps": [
{
"id": "write_prompt",
"type": "model",
"model": "eachlabs-llm-router",
"params": {
"model": "google/gemini-3.6-flash",
"messages": [
{
"role": "system",
"content": "Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only."
},
{
"role": "user",
"content": "$.inputs.prompt"
}
]
}
},
{
"id": "generate_image",
"type": "model",
"model": "nano-banana-2-text-to-image",
"params": {
"prompt": "$.write_prompt.primary.choices[0].message.content",
"aspect_ratio": "16:9"
}
}
],
"input_schema": {
"properties": {
"prompt": {
"type": "string",
"required": true
}
}
},
"metadata": {}
},
"output_mapping": {
"image": "$.generate_image.output"
},
"published": true,
"locked": true,
"production": true,
"allowed_to_share": true
}
'import requests
url = "https://api.eachlabs.ai/v1/workflows/{workflowID}/versions/{versionID}"
payload = {
"version_id": "v2",
"definition": {
"version": "v2",
"steps": [
{
"id": "write_prompt",
"type": "model",
"model": "eachlabs-llm-router",
"params": {
"model": "google/gemini-3.6-flash",
"messages": [
{
"role": "system",
"content": "Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only."
},
{
"role": "user",
"content": "$.inputs.prompt"
}
]
}
},
{
"id": "generate_image",
"type": "model",
"model": "nano-banana-2-text-to-image",
"params": {
"prompt": "$.write_prompt.primary.choices[0].message.content",
"aspect_ratio": "16:9"
}
}
],
"input_schema": { "properties": { "prompt": {
"type": "string",
"required": True
} } },
"metadata": {}
},
"output_mapping": { "image": "$.generate_image.output" },
"published": True,
"locked": True,
"production": True,
"allowed_to_share": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
version_id: 'v2',
definition: {
version: 'v2',
steps: [
{
id: 'write_prompt',
type: 'model',
model: 'eachlabs-llm-router',
params: {
model: 'google/gemini-3.6-flash',
messages: [
{
role: 'system',
content: 'Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only.'
},
{role: 'user', content: '$.inputs.prompt'}
]
}
},
{
id: 'generate_image',
type: 'model',
model: 'nano-banana-2-text-to-image',
params: {
prompt: '$.write_prompt.primary.choices[0].message.content',
aspect_ratio: '16:9'
}
}
],
input_schema: {properties: {prompt: {type: 'string', required: true}}},
metadata: {}
},
output_mapping: {image: '$.generate_image.output'},
published: true,
locked: true,
production: true,
allowed_to_share: true
})
};
fetch('https://api.eachlabs.ai/v1/workflows/{workflowID}/versions/{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/{workflowID}/versions/{versionID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'version_id' => 'v2',
'definition' => [
'version' => 'v2',
'steps' => [
[
'id' => 'write_prompt',
'type' => 'model',
'model' => 'eachlabs-llm-router',
'params' => [
'model' => 'google/gemini-3.6-flash',
'messages' => [
[
'role' => 'system',
'content' => 'Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only.'
],
[
'role' => 'user',
'content' => '$.inputs.prompt'
]
]
]
],
[
'id' => 'generate_image',
'type' => 'model',
'model' => 'nano-banana-2-text-to-image',
'params' => [
'prompt' => '$.write_prompt.primary.choices[0].message.content',
'aspect_ratio' => '16:9'
]
]
],
'input_schema' => [
'properties' => [
'prompt' => [
'type' => 'string',
'required' => true
]
]
],
'metadata' => [
]
],
'output_mapping' => [
'image' => '$.generate_image.output'
],
'published' => true,
'locked' => true,
'production' => true,
'allowed_to_share' => true
]),
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/{workflowID}/versions/{versionID}"
payload := strings.NewReader("{\n \"version_id\": \"v2\",\n \"definition\": {\n \"version\": \"v2\",\n \"steps\": [\n {\n \"id\": \"write_prompt\",\n \"type\": \"model\",\n \"model\": \"eachlabs-llm-router\",\n \"params\": {\n \"model\": \"google/gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"$.inputs.prompt\"\n }\n ]\n }\n },\n {\n \"id\": \"generate_image\",\n \"type\": \"model\",\n \"model\": \"nano-banana-2-text-to-image\",\n \"params\": {\n \"prompt\": \"$.write_prompt.primary.choices[0].message.content\",\n \"aspect_ratio\": \"16:9\"\n }\n }\n ],\n \"input_schema\": {\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"required\": true\n }\n }\n },\n \"metadata\": {}\n },\n \"output_mapping\": {\n \"image\": \"$.generate_image.output\"\n },\n \"published\": true,\n \"locked\": true,\n \"production\": true,\n \"allowed_to_share\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.eachlabs.ai/v1/workflows/{workflowID}/versions/{versionID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version_id\": \"v2\",\n \"definition\": {\n \"version\": \"v2\",\n \"steps\": [\n {\n \"id\": \"write_prompt\",\n \"type\": \"model\",\n \"model\": \"eachlabs-llm-router\",\n \"params\": {\n \"model\": \"google/gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"$.inputs.prompt\"\n }\n ]\n }\n },\n {\n \"id\": \"generate_image\",\n \"type\": \"model\",\n \"model\": \"nano-banana-2-text-to-image\",\n \"params\": {\n \"prompt\": \"$.write_prompt.primary.choices[0].message.content\",\n \"aspect_ratio\": \"16:9\"\n }\n }\n ],\n \"input_schema\": {\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"required\": true\n }\n }\n },\n \"metadata\": {}\n },\n \"output_mapping\": {\n \"image\": \"$.generate_image.output\"\n },\n \"published\": true,\n \"locked\": true,\n \"production\": true,\n \"allowed_to_share\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eachlabs.ai/v1/workflows/{workflowID}/versions/{versionID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version_id\": \"v2\",\n \"definition\": {\n \"version\": \"v2\",\n \"steps\": [\n {\n \"id\": \"write_prompt\",\n \"type\": \"model\",\n \"model\": \"eachlabs-llm-router\",\n \"params\": {\n \"model\": \"google/gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"$.inputs.prompt\"\n }\n ]\n }\n },\n {\n \"id\": \"generate_image\",\n \"type\": \"model\",\n \"model\": \"nano-banana-2-text-to-image\",\n \"params\": {\n \"prompt\": \"$.write_prompt.primary.choices[0].message.content\",\n \"aspect_ratio\": \"16:9\"\n }\n }\n ],\n \"input_schema\": {\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"required\": true\n }\n }\n },\n \"metadata\": {}\n },\n \"output_mapping\": {\n \"image\": \"$.generate_image.output\"\n },\n \"published\": true,\n \"locked\": true,\n \"production\": true,\n \"allowed_to_share\": true\n}"
response = http.request(request)
puts response.read_body{
"version_id": "v1",
"slug": "text-to-image-generator",
"published": false,
"locked": false,
"production": true,
"allowed_to_share": false,
"trigger_count": 15,
"created_at": "2025-12-01T10:00:00Z",
"updated_at": "2025-12-05T14:20:00Z",
"status": "active",
"visibility": "private",
"is_popular": false,
"updated_by": "[email protected]",
"definition": {},
"public_description": "Generates images from text prompts",
"public_thumbnail": "https://storage.googleapis.com/uploads/thumb.png",
"public_popular_sort_order": 1,
"public_example_output": "https://storage.googleapis.com/uploads/example.png"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Create or update workflow version
Create a new workflow version or update an existing one.
Patch semantics: omitted body fields keep their stored values. definition is required to create a new version; omit it (or send null) to keep the stored one.
This operation will:
- Create the version if it doesn’t exist, or patch the stored one
- Set this version as the latest version for the workflow
Important: Once a version is locked, it cannot be modified.
PUT
/
workflows
/
{workflowID}
/
versions
/
{versionID}
Create or update workflow version
curl --request PUT \
--url https://api.eachlabs.ai/v1/workflows/{workflowID}/versions/{versionID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version_id": "v2",
"definition": {
"version": "v2",
"steps": [
{
"id": "write_prompt",
"type": "model",
"model": "eachlabs-llm-router",
"params": {
"model": "google/gemini-3.6-flash",
"messages": [
{
"role": "system",
"content": "Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only."
},
{
"role": "user",
"content": "$.inputs.prompt"
}
]
}
},
{
"id": "generate_image",
"type": "model",
"model": "nano-banana-2-text-to-image",
"params": {
"prompt": "$.write_prompt.primary.choices[0].message.content",
"aspect_ratio": "16:9"
}
}
],
"input_schema": {
"properties": {
"prompt": {
"type": "string",
"required": true
}
}
},
"metadata": {}
},
"output_mapping": {
"image": "$.generate_image.output"
},
"published": true,
"locked": true,
"production": true,
"allowed_to_share": true
}
'import requests
url = "https://api.eachlabs.ai/v1/workflows/{workflowID}/versions/{versionID}"
payload = {
"version_id": "v2",
"definition": {
"version": "v2",
"steps": [
{
"id": "write_prompt",
"type": "model",
"model": "eachlabs-llm-router",
"params": {
"model": "google/gemini-3.6-flash",
"messages": [
{
"role": "system",
"content": "Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only."
},
{
"role": "user",
"content": "$.inputs.prompt"
}
]
}
},
{
"id": "generate_image",
"type": "model",
"model": "nano-banana-2-text-to-image",
"params": {
"prompt": "$.write_prompt.primary.choices[0].message.content",
"aspect_ratio": "16:9"
}
}
],
"input_schema": { "properties": { "prompt": {
"type": "string",
"required": True
} } },
"metadata": {}
},
"output_mapping": { "image": "$.generate_image.output" },
"published": True,
"locked": True,
"production": True,
"allowed_to_share": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
version_id: 'v2',
definition: {
version: 'v2',
steps: [
{
id: 'write_prompt',
type: 'model',
model: 'eachlabs-llm-router',
params: {
model: 'google/gemini-3.6-flash',
messages: [
{
role: 'system',
content: 'Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only.'
},
{role: 'user', content: '$.inputs.prompt'}
]
}
},
{
id: 'generate_image',
type: 'model',
model: 'nano-banana-2-text-to-image',
params: {
prompt: '$.write_prompt.primary.choices[0].message.content',
aspect_ratio: '16:9'
}
}
],
input_schema: {properties: {prompt: {type: 'string', required: true}}},
metadata: {}
},
output_mapping: {image: '$.generate_image.output'},
published: true,
locked: true,
production: true,
allowed_to_share: true
})
};
fetch('https://api.eachlabs.ai/v1/workflows/{workflowID}/versions/{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/{workflowID}/versions/{versionID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'version_id' => 'v2',
'definition' => [
'version' => 'v2',
'steps' => [
[
'id' => 'write_prompt',
'type' => 'model',
'model' => 'eachlabs-llm-router',
'params' => [
'model' => 'google/gemini-3.6-flash',
'messages' => [
[
'role' => 'system',
'content' => 'Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only.'
],
[
'role' => 'user',
'content' => '$.inputs.prompt'
]
]
]
],
[
'id' => 'generate_image',
'type' => 'model',
'model' => 'nano-banana-2-text-to-image',
'params' => [
'prompt' => '$.write_prompt.primary.choices[0].message.content',
'aspect_ratio' => '16:9'
]
]
],
'input_schema' => [
'properties' => [
'prompt' => [
'type' => 'string',
'required' => true
]
]
],
'metadata' => [
]
],
'output_mapping' => [
'image' => '$.generate_image.output'
],
'published' => true,
'locked' => true,
'production' => true,
'allowed_to_share' => true
]),
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/{workflowID}/versions/{versionID}"
payload := strings.NewReader("{\n \"version_id\": \"v2\",\n \"definition\": {\n \"version\": \"v2\",\n \"steps\": [\n {\n \"id\": \"write_prompt\",\n \"type\": \"model\",\n \"model\": \"eachlabs-llm-router\",\n \"params\": {\n \"model\": \"google/gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"$.inputs.prompt\"\n }\n ]\n }\n },\n {\n \"id\": \"generate_image\",\n \"type\": \"model\",\n \"model\": \"nano-banana-2-text-to-image\",\n \"params\": {\n \"prompt\": \"$.write_prompt.primary.choices[0].message.content\",\n \"aspect_ratio\": \"16:9\"\n }\n }\n ],\n \"input_schema\": {\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"required\": true\n }\n }\n },\n \"metadata\": {}\n },\n \"output_mapping\": {\n \"image\": \"$.generate_image.output\"\n },\n \"published\": true,\n \"locked\": true,\n \"production\": true,\n \"allowed_to_share\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.eachlabs.ai/v1/workflows/{workflowID}/versions/{versionID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version_id\": \"v2\",\n \"definition\": {\n \"version\": \"v2\",\n \"steps\": [\n {\n \"id\": \"write_prompt\",\n \"type\": \"model\",\n \"model\": \"eachlabs-llm-router\",\n \"params\": {\n \"model\": \"google/gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"$.inputs.prompt\"\n }\n ]\n }\n },\n {\n \"id\": \"generate_image\",\n \"type\": \"model\",\n \"model\": \"nano-banana-2-text-to-image\",\n \"params\": {\n \"prompt\": \"$.write_prompt.primary.choices[0].message.content\",\n \"aspect_ratio\": \"16:9\"\n }\n }\n ],\n \"input_schema\": {\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"required\": true\n }\n }\n },\n \"metadata\": {}\n },\n \"output_mapping\": {\n \"image\": \"$.generate_image.output\"\n },\n \"published\": true,\n \"locked\": true,\n \"production\": true,\n \"allowed_to_share\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eachlabs.ai/v1/workflows/{workflowID}/versions/{versionID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version_id\": \"v2\",\n \"definition\": {\n \"version\": \"v2\",\n \"steps\": [\n {\n \"id\": \"write_prompt\",\n \"type\": \"model\",\n \"model\": \"eachlabs-llm-router\",\n \"params\": {\n \"model\": \"google/gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Rewrite the idea as one vivid, detailed image prompt. Reply with the prompt only.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"$.inputs.prompt\"\n }\n ]\n }\n },\n {\n \"id\": \"generate_image\",\n \"type\": \"model\",\n \"model\": \"nano-banana-2-text-to-image\",\n \"params\": {\n \"prompt\": \"$.write_prompt.primary.choices[0].message.content\",\n \"aspect_ratio\": \"16:9\"\n }\n }\n ],\n \"input_schema\": {\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"required\": true\n }\n }\n },\n \"metadata\": {}\n },\n \"output_mapping\": {\n \"image\": \"$.generate_image.output\"\n },\n \"published\": true,\n \"locked\": true,\n \"production\": true,\n \"allowed_to_share\": true\n}"
response = http.request(request)
puts response.read_body{
"version_id": "v1",
"slug": "text-to-image-generator",
"published": false,
"locked": false,
"production": true,
"allowed_to_share": false,
"trigger_count": 15,
"created_at": "2025-12-01T10:00:00Z",
"updated_at": "2025-12-05T14:20:00Z",
"status": "active",
"visibility": "private",
"is_popular": false,
"updated_by": "[email protected]",
"definition": {},
"public_description": "Generates images from text prompts",
"public_thumbnail": "https://storage.googleapis.com/uploads/thumb.png",
"public_popular_sort_order": 1,
"public_example_output": "https://storage.googleapis.com/uploads/example.png"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Path Parameters
Body
application/json
Toggle unlisted sharing for this version.
true→ makes the version "unlisted" (accessible via link, hidden from public listings)false→ makes the version "private" (organization only)- No effect on public versions
- Omitted keeps the stored value (new versions default to private)
Response
Workflow version created or updated successfully
Summary information about a workflow version
Identifier of the user who last updated the version
Example: