API Reference
Ironflow provides multiple ways to interact with the platform:
| Interface | Use Case |
|---|---|
| REST API | HTTP endpoints for triggers, runs, and management |
| JavaScript SDK | Full-featured SDK for browser and Node.js |
| Go SDK | Native Go SDK for workers and clients |
| Python SDK | Experimental Python HTTP client (no worker runtime yet) |
| Configuration | Environment variables, defaults, and SDK configuration |
| Platform API | Multi-tenant platform management — users, keys, roles, tenants, audit |
Quick Links
Section titled “Quick Links”REST API
Section titled “REST API”POST /api/v1/events- Emit an eventGET /api/v1/functions- List registered functionsGET /api/v1/runs- List runsGET /api/v1/runs/{id}- Get run detailsGET /api/v1/streams- List all entity streamsPOST /api/v1/sql- Execute read-only SQL queryPOST /api/v1/projections/{name}/pause- Pause projectionPOST /api/v1/projections/{name}/resume- Resume projectionDELETE /api/v1/projections/{name}- Delete projectionPOST /api/v1/events/schemas- Register event schemaGET /api/v1/events/schemas- List event schemasPOST /api/v1/config/{name}- Set config (full replacement)PATCH /api/v1/config/{name}- Patch config (shallow merge)GET /api/v1/config/{name}- Get configGET /api/v1/config- List configsPOST /api/v1/kv/buckets- Create a KV bucketGET /api/v1/kv/buckets/{bucket}/keys/{key}- Get a KV entryPUT /api/v1/kv/buckets/{bucket}/keys/{key}- Set a KV entryDELETE /api/v1/kv/buckets/{bucket}/keys/{key}- Delete a KV entryPOST /api/v1/secrets- Create a secretGET /api/v1/secrets- List secrets (metadata only)GET /api/v1/secrets/{name}- Get secret metadataPUT /api/v1/secrets/{name}- Update a secretDELETE /api/v1/secrets/{name}- Delete a secret
JavaScript SDK
Section titled “JavaScript SDK”Browser (real-time subscriptions, triggers):
import { ironflow } from "@ironflow/browser";
ironflow.configure({ serverUrl: "http://localhost:9123" });
// Subscribe to eventsconst sub = await ironflow.subscribe("events:order.*", { onEvent: (event) => console.log(event),});
// Invoke a functionconst run = await ironflow.invoke("process-order", { data: { orderId: "123" } });Node.js (workers, serve handlers):
import { ironflow, serve, createWorker } from "@ironflow/node";
// Define a functionconst processOrder = ironflow.createFunction( { id: "process-order", triggers: [{ event: "order.placed" }] }, async ({ event, step }) => { const result = await step.run("process", async () => ({ processed: true })); return result; });
// Push mode (serverless)export const POST = serve({ functions: [processOrder] });
// Pull mode (worker)const worker = createWorker({ serverUrl: "http://localhost:9123", functions: [processOrder] });await worker.start();Go SDK
Section titled “Go SDK”import "github.com/sahina/ironflow/sdk/go/ironflow"
// Define functionsvar myFunction = ironflow.CreateFunction(...)
// Interact with serverclient := ironflow.NewClient(ironflow.ClientConfig{})client.Emit(ctx, "event.name", map[string]any{"data": "value"})Platform API
Section titled “Platform API”POST /api/v1/platform/auth/login— Platform authenticationGET /api/v1/platform/users— List platform usersGET /api/v1/platform/tenants— List tenants
Server Endpoints
Section titled “Server Endpoints”The server runs on port 9123 by default and exposes:
| Endpoint | Description |
|---|---|
/ | Dashboard UI |
/api/v1/* | REST API |
/ws | WebSocket subscriptions |
/health | Liveness probe (database only) |
/ready | Readiness probe (database + NATS) |
/metrics | Prometheus metrics (when IRONFLOW_METRICS_ENABLED=true) |
/ironflow.v1.IronflowService/* | ConnectRPC: functions, events, runs, scoped injection (PauseRun, InjectStepOutput, PatchStep) |
/ironflow.v1.WorkerService/* | ConnectRPC: pull-mode worker bidirectional streaming |
/ironflow.v1.EntityStreamService/* | ConnectRPC: entity stream event sourcing |
/ironflow.v1.ProjectionService/* | ConnectRPC: projection management and queries |
/ironflow.v1.PubSubService/* | ConnectRPC: pub/sub subscriptions and consumer groups |
/ironflow.v1.QueryService/* | ConnectRPC: SQL queries |
/ironflow.v1.EventSchemaService/* | ConnectRPC: event schema registry |
/ironflow.v1.WebhookService/* | ConnectRPC: webhook source management |
/ironflow.v1.AuditService/* | ConnectRPC: history inspection (audit trail) queries |
/ironflow.v1.TimeTravelService/* | ConnectRPC: history navigation (time-travel debugging) |
/ironflow.v1.AgentToolsService/* | ConnectRPC: agent tool registry (exposeMcp runtime, issue #595) |
See Configuration for environment variables, defaults, and SDK configuration.