Skip to content

ironflow apikey

Manage API keys for authentication. Create, list, delete, and rotate API keys.

Terminal window
ironflow apikey <subcommand> [flags]

Subcommands:

SubcommandDescription
createCreate a new API key
listList all API keys
deleteDelete an API key
rotateRotate an API key

Create a new API key with the given name. Returns the key value which must be saved immediately.

Terminal window
ironflow apikey create <name> [flags]

Arguments:

ArgumentRequiredDescription
nameYesName for the new API key

Flags:

FlagShortTypeDefaultDescription
--envstringEnvironment ID to scope the key to
--rolestring[]Role ID to assign (can be specified multiple times)
--expiresstringExpiration duration (e.g. 720h for 30 days)
--platformboolfalseCreate a platform-scoped key (ifplatform_ prefix)
--server-sstringServer URL override

Examples:

Terminal window
# Create a basic API key
ironflow apikey create my-key
# Create a key with roles
ironflow apikey create my-key --role role_abc123 --role role_def456
# Create a key scoped to an environment with expiration
ironflow apikey create my-key --env env_abc123 --expires 720h
# Create a platform key for cross-tenant operations
ironflow apikey create my-platform-key --platform

List all API keys with their IDs, names, prefixes, roles, and timestamps.

Terminal window
ironflow apikey list [flags]

Flags:

FlagShortTypeDefaultDescription
--jsonboolfalseOutput as JSON
--platformboolfalseList only platform-scoped keys
--server-sstringServer URL override

Output:

ID NAME PREFIX ROLES CREATED LAST USED EXPIRES
ak_abc123 my-key ifkey_a1b2c3d4 role_abc123 2026-01-01T00:00:00Z 2026-03-01T12:00:00Z -

Examples:

Terminal window
# List all API keys
ironflow apikey list
# List platform keys only
ironflow apikey list --platform
# List as JSON
ironflow apikey list --json

Delete an API key by its ID. The key is immediately revoked.

Terminal window
ironflow apikey delete <id> [flags]

Arguments:

ArgumentRequiredDescription
idYesAPI key ID to delete

Flags:

FlagShortTypeDefaultDescription
--server-sstringServer URL override

Examples:

Terminal window
ironflow apikey delete ak_abc123

Rotate an API key by its ID. Creates a new key with the same name, environment, and roles. The old key is immediately revoked.

Terminal window
ironflow apikey rotate <id> [flags]

Arguments:

ArgumentRequiredDescription
idYesAPI key ID to rotate

Flags:

FlagShortTypeDefaultDescription
--server-sstringServer URL override
--jsonboolfalseOutput as JSON (machine-readable)

Examples:

Terminal window
ironflow apikey rotate ak_abc123