Endpoint
POST https://api.eachlabs.ai/v1/workflows
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Human-readable workflow name |
definition | object | No | Workflow definition with steps and input schema |
Definition Object
| Field | Type | Description |
|---|---|---|
version | string | Version identifier (e.g., "v1") |
steps | array | Array of step definitions |
input_schema | object | JSON Schema for workflow inputs |
metadata | object | Additional metadata (e.g., output mapping) |
Code Examples
curl -X POST https://api.eachlabs.ai/v1/workflows \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"name": "Text to Image Generator",
"definition": {
"version": "v1",
"input_schema": {
"type": "object",
"required": ["prompt"],
"properties": {
"prompt": {"type": "string", "description": "Text prompt"}
}
},
"steps": [
{
"step_id": "generate",
"type": "model",
"model": "flux-1-1-pro",
"params": {
"prompt": "{{inputs.prompt}}"
}
}
]
}
}'
import requests
response = requests.post(
"https://api.eachlabs.ai/v1/workflows",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
json={
"name": "Text to Image Generator",
"definition": {
"version": "v1",
"input_schema": {
"type": "object",
"required": ["prompt"],
"properties": {
"prompt": {"type": "string"}
}
},
"steps": [
{
"step_id": "generate",
"type": "model",
"model": "flux-1-1-pro",
"params": {"prompt": "{{inputs.prompt}}"}
}
]
}
}
)
workflow = response.json()
print(f"Created: {workflow['workflow_id']}")
const response = await fetch(
"https://api.eachlabs.ai/v1/workflows",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
body: JSON.stringify({
name: "Text to Image Generator",
definition: {
version: "v1",
input_schema: {
type: "object",
required: ["prompt"],
properties: { prompt: { type: "string" } },
},
steps: [
{
step_id: "generate",
type: "model",
model: "flux-1-1-pro",
params: { prompt: "{{inputs.prompt}}" },
},
],
},
}),
}
);
const workflow = await response.json();
console.log(`Created: ${workflow.workflow_id}`);
Response
Status:201 Created
{
"workflow_id": "50741f40-8621-4d46-8a91-dff4d873be98",
"slug": "text-to-image-generator",
"name": "Text to Image Generator",
"categories": ["general"],
"tags": null,
"status": "active",
"trigger_count": 0,
"clone_count": 0,
"is_public": false,
"production": false,
"created_at": "2025-12-01T10:00:00Z",
"updated_at": "2025-12-01T10:00:00Z",
"versions": [
{
"version_id": "v1",
"slug": "text-to-image-generator",
"published": true,
"locked": false,
"production": false,
"allowed_to_share": false,
"trigger_count": 0,
"created_at": "2025-12-01T10:00:00Z",
"updated_at": "2025-12-01T10:00:00Z",
"definition": {},
"status": "active"
}
]
}
Error Responses
| Status | Body | Description |
|---|---|---|
400 | {"error": "name is required"} | Missing required fields |
401 | {"error": "Invalid or missing API key"} | Authentication failure |