Zeal provides a comprehensive REST API for managing workflows, nodes, and related resources. All API endpoints are prefixed with /api and return JSON responses.
Most API endpoints require authentication. Include the authentication token in the Authorization header:
Authorization: Bearer <your-token>https://your-domain.com/api
{
"success": true,
"data": {
// Response data
}
}{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {} // Optional additional details
}
}GET /workflowsQuery Parameters:
page(number): Page number (default: 1)limit(number): Items per page (default: 20)search(string): Search termnamespace(string): Filter by namespace
Response:
{
"success": true,
"data": {
"workflows": [
{
"id": "workflow-123",
"name": "My Workflow",
"description": "Workflow description",
"namespace": "default",
"isPublished": false,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 100,
"pages": 5
}
}
}GET /workflows/:idResponse:
{
"success": true,
"data": {
"id": "workflow-123",
"name": "My Workflow",
"description": "Workflow description",
"namespace": "default",
"version": 1,
"isPublished": false,
"data": {
"nodes": [...],
"connections": [...],
"groups": [...],
"metadata": {...}
},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
}POST /workflowsRequest Body:
{
"name": "New Workflow",
"description": "Description",
"namespace": "default",
"data": {
"nodes": [],
"connections": [],
"groups": []
}
}PUT /workflows/:idRequest Body:
{
"name": "Updated Name",
"description": "Updated description",
"data": {
"nodes": [...],
"connections": [...],
"groups": [...]
}
}DELETE /workflows/:idPOST /workflows/:id/publishRequest Body:
{
"version": "1.0.0",
"changelog": "Initial release"
}POST /workflows/:id/executeRequest Body:
{
"inputs": {
"param1": "value1",
"param2": "value2"
},
"options": {
"timeout": 30000,
"trace": true
}
}GET /nodesQuery Parameters:
category(string): Filter by categorysearch(string): Search term
Response:
{
"success": true,
"data": {
"nodes": [
{
"id": "node-template-1",
"category": "data-sources",
"type": "api-request",
"title": "API Request",
"description": "Make HTTP requests",
"metadata": {...}
}
]
}
}GET /nodes/categoriesResponse:
{
"success": true,
"data": {
"categories": [
{
"id": "data-sources",
"name": "Data Sources",
"description": "Input nodes for data",
"icon": "Database",
"count": 15
}
]
}
}POST /nodes/validateRequest Body:
{
"nodeType": "api-request",
"configuration": {
"url": "https://api.example.com",
"method": "GET"
}
}GET /env-varsResponse:
{
"success": true,
"data": {
"variables": [
{
"id": "var-123",
"key": "API_KEY",
"value": "***hidden***",
"description": "API key for external service",
"isEncrypted": true
}
]
}
}POST /env-varsRequest Body:
{
"key": "NEW_VAR",
"value": "value",
"description": "Description",
"isEncrypted": false
}PUT /env-vars/:idDELETE /env-vars/:idGET /flow-tracesQuery Parameters:
workflowId(string): Filter by workflowsessionId(string): Filter by sessionstatus(string): Filter by status (running, completed, failed)startDate(string): ISO date stringendDate(string): ISO date string
GET /flow-traces/:idResponse:
{
"success": true,
"data": {
"id": "trace-123",
"workflowId": "workflow-123",
"sessionId": "session-456",
"startedAt": "2024-01-01T00:00:00Z",
"completedAt": "2024-01-01T00:01:00Z",
"status": "completed",
"nodes": [
{
"nodeId": "node-1",
"startedAt": "2024-01-01T00:00:00Z",
"completedAt": "2024-01-01T00:00:10Z",
"status": "completed",
"inputData": {...},
"outputData": {...}
}
]
}
}POST /flow-traces/sessionsRequest Body:
{
"workflowId": "workflow-123",
"metadata": {
"triggeredBy": "manual",
"user": "user-123"
}
}GET /flow-traces/sessions/:sessionIdResponse:
{
"success": true,
"data": {
"id": "session-456",
"workflowId": "workflow-123",
"workflowVersion": 5,
"startedAt": "2024-01-01T00:00:00Z",
"completedAt": "2024-01-01T00:01:00Z",
"duration": 60000,
"status": "completed",
"metadata": {
"triggeredBy": "schedule",
"user": "system"
},
"stats": {
"totalNodes": 15,
"executedNodes": 15,
"failedNodes": 0,
"averageNodeDuration": 4000
}
}
}GET /flow-traces/sessions/:sessionId/replayQuery Parameters:
search(string): Filter traces by node/port namesstatus(string): Filter by trace status
Response includes filtered traces with timing information for replay visualization.
GET /flow-traces/sessions/:sessionId/reportQuery Parameters:
search(string): Filter traces by node/port namesstatus(string): Filter by trace statusformat(string): Output format - "json" or "text" (default: json)
Generates a detailed report of the trace session.
GET /flow-traces/analyticsQuery Parameters:
workflowId(string): Filter by workflowstartDate(string): Start dateendDate(string): End date
Response:
{
"success": true,
"data": {
"summary": {
"totalTraces": 1543,
"totalSessions": 234,
"totalWorkflows": 15,
"successRate": 0.95,
"avgDuration": 45000,
"totalDataProcessed": 1048576
},
"performance": {
"slowestTraces": [...],
"fastestTraces": [...],
"avgDurationByNode": {
"node-1": 5000,
"node-2": 3000
},
"avgDurationByWorkflow": {
"workflow-1": 45000
}
},
"errors": {
"errorsByType": {
"TIMEOUT": 45,
"INVALID_INPUT": 12
},
"errorsByNode": {...},
"errorsByWorkflow": {...},
"recentErrors": [...]
},
"trends": {
"last7Days": [...],
"last30Days": [...],
"topNodes": [...],
"topWorkflows": [...]
}
}
}POST /flow-traces/cleanupRequest Body:
{
"olderThan": "30d",
"keepFailed": true,
"keepSnapshots": true
}GET /workflows/:id/historyQuery Parameters:
page(number): Page number (default: 1)limit(number): Items per page (default: 20)
Response:
{
"success": true,
"data": {
"versions": [
{
"id": "version-123",
"version": 2,
"createdAt": "2024-01-01T00:00:00Z",
"createdBy": "user-123",
"workflowId": "workflow-123"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 15
}
}
}POST /workflows/:id/snapshotsRequest Body:
{
"name": "Pre-refactor backup",
"description": "Snapshot before major refactoring"
}GET /workflows/:id/snapshots/:snapshotIdResponse includes the complete workflow data at that snapshot.
POST /workflows/:id/rollbackRequest Body:
{
"versionId": "version-123"
}Note: Can only rollback to published versions. Returns the updated workflow after rollback.
Connect to the CRDT server for real-time synchronization:
const socket = io('wss://your-domain.com', {
auth: {
userId: 'user-123',
userName: 'John Doe',
},
})
// Join a workflow room
socket.emit('join-room', 'workflow-123')
// Listen for updates
socket.on('crdt:update', data => {
// Handle CRDT updates
})
// Send updates
socket.emit('crdt:message', roomId, crdtMessage)join-room: Join a workflow roomleave-room: Leave a workflow roomcrdt:message: Send CRDT updatecursor:update: Update cursor position
crdt:update: Receive CRDT updatespresence:update: User presence changescursor:position: Other users' cursor positionsroom:user-joined: User joined the roomroom:user-left: User left the room
API endpoints are rate-limited to prevent abuse:
- General endpoints: 30 requests per minute
- API endpoints: 10 requests per minute
- Execute endpoint: 5 requests per minute
Rate limit headers:
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 25
X-RateLimit-Reset: 1640995200| Code | Description |
|---|---|
UNAUTHORIZED |
Missing or invalid authentication |
FORBIDDEN |
Insufficient permissions |
NOT_FOUND |
Resource not found |
VALIDATION_ERROR |
Invalid request data |
RATE_LIMITED |
Too many requests |
INTERNAL_ERROR |
Server error |
WORKFLOW_EXECUTION_ERROR |
Error during workflow execution |
RESOURCE_LOCKED |
Resource is being edited by another user |
import { ZealClient } from '@zeal/sdk'
const client = new ZealClient({
apiKey: 'your-api-key',
baseUrl: 'https://your-domain.com/api',
})
// List workflows
const workflows = await client.workflows.list({
page: 1,
limit: 20,
})
// Execute workflow
const result = await client.workflows.execute('workflow-123', {
inputs: { data: 'test' },
})from zeal_sdk import ZealClient
client = ZealClient(
api_key='your-api-key',
base_url='https://your-domain.com/api'
)
# List workflows
workflows = client.workflows.list(page=1, limit=20)
# Execute workflow
result = client.workflows.execute(
'workflow-123',
inputs={'data': 'test'}
)# List workflows
curl -X GET https://your-domain.com/api/workflows \
-H "Authorization: Bearer your-token"
# Execute workflow
curl -X POST https://your-domain.com/api/workflows/workflow-123/execute \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-d '{"inputs": {"data": "test"}}'