REST API

API Documentation

Integrate the Zenflow AI engine programmatically. Build complex workflow executions, manage generative nodes, and orchestrate creative tasks directly through our REST interface.

Base URLhttps://api.zenflow.in

Authentication

The Zenflow API uses API keys for authentication. When using the API endpoints, ensure requests include the active x-api-key header obtained from your project settings.

Note: API Keys for programmatic server-to-server access are currently in development.

Endpoint Reference

GET/api/projects

List Projects

Retrieves a list of all your Zenflow projects.

Response Map

json
{
  "projects": [
    {
      "id": "uuid",
      "name": "string",
      "description": "string | null",
      "userId": "string",
      "createdAt": "date-time",
      "updatedAt": "date-time"
    }
  ],
  "meta": {
    "total": 1
  }
}
POST/api/projects

Create Project

Creates a new empty project.

Request Body

json
{
  "name": "string (Required, max 100 chars)",
  "description": "string (Optional, max 500 chars)"
}

Response Map

json
{
  "project": {
    "id": "uuid",
    "name": "string",
    "description": "string | null",
    "userId": "string"
  }
}
POST/api/execute

Execute Graph

Executes a full node workflow graph and returns a stream of Server-Sent Events (SSE).

Request Body

json
{
  "nodes": [
    // Array of React Flow node definitions
  ],
  "edges": [
    // Array of React Flow edge definitions
  ],
  "projectId": "uuid (Optional)"
}

Response Map

json
// Returns a Server-Sent Events (text/event-stream) response

data: {"type": "update", "nodeId": "123", "status": "running"}
data: {"type": "update", "nodeId": "123", "status": "done", "data": {...}}
data: {"type": "complete", "durationMs": 1500}
PUT/api/execute

Execute Single Node

Executes an individual node action within a specific project context.

Request Body

json
{
  "nodeId": "uuid (Required)",
  "projectId": "uuid (Required)"
}

Response Map

json
{
  "result": {
    "status": "done | pending | error | manual",
    "data": {
      // Node specific output data
    },
    "error": "string (if status is error)"
  }
}