Skip to content

Platform Management

This tutorial walks you through the full platform lifecycle: bootstrapping an admin, creating API keys, provisioning tenants, impersonating them, and inspecting the system’s recorded history.

Prerequisites: An Ironflow server running in Platform mode.


Create the initial platform administrator. This command only works when no platform users exist yet. It requires a tenant API key (ifkey_... in IRONFLOW_API_KEY) — platform login isn’t available until the first user exists, and platform keys (ifplatform_) do not bypass this rule.

Terminal window
IRONFLOW_API_KEY="ifkey_..." ironflow platform create-admin --email admin@example.com --name "Platform Admin"

You’ll be prompted for a password:

Password: ********
Created platform admin: admin@example.com (id: puser_a1b2c3d4)

Authenticate with the platform to get a JWT token stored at ~/.config/ironflow/credentials.json:

Terminal window
ironflow platform login --email admin@example.com
Password: ********
Logged in as admin@example.com (expires: 2026-03-13T10:00:00Z)

The token is valid for 24 hours. All subsequent ironflow platform commands use this token automatically.

You can also log in via the dashboard at http://localhost:9123/platform/login using the same credentials.


Platform API keys authenticate automated systems (CI/CD, scripts) without user credentials:

Terminal window
ironflow apikey create my-automation-key --platform
Created Platform Key: my-automation-key (id: ak_e5f6g7h8)
Key: ifplatform_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
Save this key — it will not be shown again.

Create a new tenant organization:

Terminal window
ironflow platform tenants provision --name "Acme Corp"
Provisioned tenant: Acme Corp (id: org_x1y2z3w4)

List all tenants to verify:

Terminal window
ironflow platform tenants list
ID NAME CREATED
org_x1y2z3w4 Acme Corp 2026-03-12T10:00:00Z

Use the --as-org persistent root flag (works with any Ironflow command) to run as if you were inside a tenant’s organization:

Terminal window
ironflow --as-org org_x1y2z3w4 env list
ID NAME CREATED
env_default default 2026-03-12T10:00:00Z

This works with any Ironflow command. For example, listing the tenant’s functions:

Terminal window
ironflow --as-org org_x1y2z3w4 function list

Every platform operation is recorded in the platform audit log. Query it:

Terminal window
ironflow platform audit
ID EVENT_TYPE SCOPE CREATED_AT
01HXYZ... platform.user.created platform 2026-03-12T09:00:00Z
01HXYZ... platform.key.created platform 2026-03-12T09:05:00Z
01HXYZ... platform.impersonated platform 2026-03-12T09:10:00Z

Filter and paginate with --event-type, --from, --limit, --cursor. Use --json for machine-readable output:

Terminal window
ironflow platform audit --event-type platform.impersonated --from 2026-03-12 --limit 50 --json