Complete reference for integrating with the Wormwood Engine API and building apps on the Nexus platform.
All information is sourced from the live API at api.nexus-dev.codezerogroup.com.
This guide covers direct REST integration, authentication, org/pipeline management, pipeline execution, SSE streams,
and app construction patterns.
Both endpoints are live behind an ALB on nexus-prod-alb, DNS in Route 53 (codezerogroup.com zone).
| Purpose | URL | Notes |
|---|---|---|
| Engine API | https://api.nexus-dev.codezerogroup.com | All REST calls. OpenAPI at /openapi.json, Swagger at /docs |
| Nexus SPA | https://app.nexus-dev.codezerogroup.com | Hub dashboard, pipeline canvas, app views |
| Local dev API | http://localhost:8010 | Run: uvicorn wormwood.api.app:app --port 8010 in Wormwood repo with venv active |
| Local dev SPA | http://localhost:8010/nexus-ui/ | SPA files served as static mount on engine (local only) |
MCP not available on this deployment. There is no /mcp route on api.nexus-dev.codezerogroup.com. MCP integration is a separate Nexus1 deployment on an unrelated system and is not documented here.
DB-backed API key authentication. Keys are stored as SHA-256 hashes in the engine database.
All protected endpoints require an API key. Two methods are accepted:
GET /orgs HTTP/1.1 Host: api.nexus-dev.codezerogroup.com X-API-Key: your-api-key-here
# curl example
curl https://api.nexus-dev.codezerogroup.com/orgs \
-H "X-API-Key: your-api-key-here"
Required for EventSource / SSE connections which cannot set custom headers.
GET /pipelines/{id}/runs/{run_id}/events?api_key=your-api-key-here
| Status | Condition |
|---|---|
401 Unauthorized | No key provided (header and query param both absent) |
403 Forbidden | Key is unknown, inactive, or expired |
On the first call to any protected endpoint when the key database is empty, the engine imports
the WORMWOOD_API_KEY environment variable as a full-privilege key with
client_id=bootstrap. This is the initial admin key for a fresh deployment.
Keys are associated with client_id, scopes, and optional expiry. The raw key value is returned exactly once at creation time and is never retrievable again.
| Endpoint | Purpose |
|---|---|
GET /health | Engine health + component versions |
GET /health/resources | Detailed resource metrics |
POST /orgs/authenticate and GET /orgs/login-list are technically unauthenticated but are explicitly marked for local dev use. Do not rely on them in production.
Keys are scoped to an org. One active admin key is required to manage keys for that org.
POST /orgs/{org_slug}/api-keys
X-API-Key: <admin-key>
Content-Type: application/json
{
"label": "ci-pipeline",
"scopes": ["read", "execute"]
}
Response includes api_key (raw value, returned once only), key_id, label, scopes, created_at.
GET /orgs/{org_slug}/api-keys
Returns key metadata. Raw key values are never returned in list responses.
PATCH /orgs/{org_slug}/api-keys/{key_id}
Content-Type: application/json
{ "label": "new-label" }
DELETE /orgs/{org_slug}/api-keys/{key_id}
Deactivates the key. Requests using a revoked key receive 403.
All pipelines and data are scoped to an Organisation. Teams are logical groups within an org. Users belong to teams.
POST /orgs X-API-Key: <admin-key> Content-Type: application/json { "slug": "my-org", "name": "My Organisation", "plan_tier": "enterprise" }
# Create team POST /orgs/{org_slug}/teams { "slug": "ops", "name": "Operations" } # Add user to team POST /orgs/{org_slug}/teams/{team_slug}/users { "email": "user@example.com", "role": "operator" } # List users in team GET /orgs/{org_slug}/teams/{team_slug}/users # List all users across all teams GET /orgs/{org_slug}/users
| Role | Capabilities |
|---|---|
admin | Full access: org management, pipeline CRUD, key management |
operator | Execute pipelines, view runs, approve HumanGate tokens |
viewer | Read-only: view pipelines, runs, and status |
Deployment environments are metadata attached to an org (e.g. dev / staging / prod). Used for pipeline routing context.
POST /orgs/{org_slug}/environments
{ "slug": "prod", "name": "Production", "app_url": "https://app.example.com" }
GET /orgs/{org_slug}/environments
GET /orgs/{org_slug}/environments/{env_slug}
Pipelines are directed graphs of typed nodes. Node types are registered in the engine's executor registry (40+ types).
POST /pipelines X-API-Key: <key> Content-Type: application/json { "org_slug": "my-org", "name": "Intake Form", "slug": "intake-form", "graph_json": { "nodes": [...], "edges": [...] } }
# List all registered node types GET /node-types # Get schema for a specific node type GET /node-types/{name}
Key node types available in this deployment:
| Type | Purpose |
|---|---|
FormInput | Renders a schema-driven form for user data entry |
HumanGate | Suspends execution pending manual approval/rejection |
AITransform | LLM-based data transformation step |
PDFGenerator | Generates a PDF from structured data |
ParallelSplit | Fans out to multiple parallel branches |
ParallelJoin | Waits for all parallel branches to complete |
RuleValidator | Applies Wormwood rules to a data payload |
NavMenu | Defines navigation structure for an app shell |
Dashboard | Renders a metrics/widget dashboard view |
# Fork active pipeline into new draft (bumps version) POST /pipelines/{pipeline_id}/fork # List all versions for a slug GET /pipelines/history?org_slug={org_slug}&slug={slug} # Deactivate (active -> archived) POST /pipelines/{pipeline_id}/deactivate # Export as self-contained descriptor JSON GET /pipelines/{pipeline_id}/descriptor # Import from descriptor POST /pipelines/import
The engine generates multi-scale canvas layouts for SPAs to render node graphs without layout computation.
# Returns SVG/layout data at 4 zoom scales (overview / mid / detail / full)
GET /pipelines/{pipeline_id}/canvas/{scale}
Chameleon uses these endpoints to render schema-driven forms for individual nodes.
# Full node schema GET /pipelines/{pipeline_id}/nodes/{node_id}/schema # Schema filtered by user role (RBAC) GET /pipelines/{pipeline_id}/nodes/{node_id}/schema/role # Dynamic options for a BDT field GET /pipelines/{pipeline_id}/nodes/{node_id}/bdt/{field_name}/options
Pipelines are executed via run objects. A run tracks state across all nodes and supports resumption.
POST /pipelines/{pipeline_id}/run
X-API-Key: <key>
Content-Type: application/json
{
"inputs": {
"field_a": "value",
"field_b": 42
},
"triggered_by": "user@example.com"
}
Returns a run object with run_id, status (pending / running / suspended / completed / failed), started_at.
POST /pipelines/{pipeline_id}/execute
Executes and returns node outputs directly. Used by the ARC SPA for short-lived validation pipelines.
| Endpoint | Purpose |
|---|---|
GET /pipelines/{id}/runs | List all runs for a pipeline |
GET /pipelines/runs/{run_id} | Get single run state |
GET /pipelines/runs/{run_id}/node-logs | Per-node execution logs |
POST /pipelines/runs/{run_id}/resume | Resume a suspended run (post HumanGate resolution) |
POST /execute
Low-level executor. Accepts a pipeline graph and inputs inline, without a persisted pipeline record. Used for ad-hoc validation.
When a pipeline reaches a HumanGate node, execution suspends and a unique approval token is generated.
Run status changes to suspended. A token is issued and sent to configured recipients (email / webhook).
GET /orgs/{org_slug}/humangate/pending?role=approver
Returns all tokens pending approval for the given role within the org.
GET /approvals/{token}
Returns gate context: pipeline name, submitter, inputs, resolution options defined in the node schema.
POST /approvals/{token}/approve
Content-Type: application/json
{ "comment": "Looks good" }
POST /approvals/{token}/reject
Content-Type: application/json
{ "comment": "Missing documentation" }
The run is resumed (on approve) or terminated with failure status (on reject). Token becomes invalid after use.
HumanGate endpoints (/approvals/*) do not require an API key if the token is a valid UUID. The token itself acts as the credential.
Server-Sent Events for live run monitoring. Use api_key query parameter (EventSource cannot set headers).
GET /pipelines/{pipeline_id}/runs/{run_id}/events?api_key={key}
Emits events as nodes execute: node_started, node_completed, node_failed, run_completed, run_failed, gate_suspended.
# JavaScript EventSource example const es = new EventSource( `https://api.nexus-dev.codezerogroup.com/pipelines/${pipelineId}/runs/${runId}/events?api_key=${key}` ); es.onmessage = (e) => { const evt = JSON.parse(e.data); console.log(evt.type, evt.node_id, evt.status); };
GET /pipeline-status-stream?api_key={key}
Emits live status updates for all active pipeline runs across all orgs the key has access to. Used by the Nexus hub dashboard.
GET /run/telemetry/stream?api_key={key}
Emits engine telemetry metrics (CPU, memory, active runs, queue depth) on a fixed interval.
Wormwood's rule engine validates entity data against registered rule sets. 232 rules loaded in the live deployment.
POST /validate X-API-Key: <key> Content-Type: application/json { "entity_class": "infrastructure", "data": { "capacity_kw": 500, "cooling_type": "rdhx" } }
POST /edr/validate # EDR domain validation POST /edr/validate/batch # Batch EDR validation
GET /rules # List all rules GET /rules/{rule_id} # Get single rule PATCH /rules/{rule_id} # Update rule fields DELETE /rules/{rule_id} # Delete rule GET /rules/{rule_id}/history # Audit trail GET /rules/files # List rule files on disk GET /rules/files/{file_path} # Get file contents GET /rules/files/{file_path}/rules # Rules in a specific file
POST /delta-prism/execute-rules # CPU rule execution POST /delta-prism/execute-rules-gpu # GPU-accelerated rule execution
Event-driven pipeline triggering. External systems fire CDC events; subscribed pipelines are triggered automatically.
POST /cdc/subscribe X-API-Key: <key> Content-Type: application/json { "event_type": "record.created", "source": "crm", "pipeline_id": 42 }
POST /cdc/event
Content-Type: application/json
{
"event_type": "record.created",
"source": "crm",
"payload": { "id": "abc123", "name": "Acme Corp" }
}
GET /cdc/subscriptions # List all active subscriptions
An app is a set of pipelines registered under an org, with a catalog entry and an optional SPA shell.
POST /orgs { "slug": "my-app", "name": "My App", "plan_tier": "enterprise" }
POST /orgs/my-app/teams { "slug": "admin-team", "name": "Admins" }
POST /orgs/my-app/teams/admin-team/users { "email": "admin@example.com", "role": "admin" }
POST /orgs/my-app/api-keys { "label": "app-runtime", "scopes": ["read","execute"] }
Store the returned raw key. It will not be shown again.
Create pipelines with POST /pipelines. Each pipeline defines a graph_json of typed nodes and edges. Fetch node type schemas from GET /node-types to understand required fields.
Add an entry to admin/seed_nx_s18_app_catalog.py in the Wormwood repo with slug, display_name, domain, and actions. Re-seed to make it appear in GET /orgs/apps/catalog.
Create a self-contained HTML SPA that calls the Nexus API using the app's key. Use the pipeline canvas endpoint (GET /pipelines/{id}/canvas/{scale}) for graph rendering. Use Chameleon node schema endpoints for form rendering. Wire SSE for live status.
# All apps GET /orgs/apps/catalog # Single app by slug GET /orgs/apps/catalog?slug=my-app
Response shape:
{
"slug": "my-app",
"display_name": "My App",
"domain": "Finance",
"status": "operational",
"actions": ["Intake", "Review", "Approve"],
"components": [
{ "name": "Wormwood", "version": "1.4.4" }
]
}
Define custom entity schemas for your org. These drive validation and form rendering.
POST /orgs/{org_slug}/entity-classes
{ "slug": "invoice", "schema": { ... JSON Schema ... } }
GET /orgs/{org_slug}/entity-classes
GET /orgs/{org_slug}/entity-classes/{class_slug}
DELETE /orgs/{org_slug}/entity-classes/{class_slug}
GET /arc/classes # List global ARC entity classes GET /arc/schema/{class_slug} # Get ARC class schema
All endpoints from the live OpenAPI spec. Auth column: PUBLIC = no key required, KEY = X-API-Key required, SSE = EventSource stream.