- CLI Reference
- Commands
- ironflow apikey
ironflow apikey
Manage API keys for authentication. Create, list, delete, and rotate API keys.
ironflow apikey <subcommand> [flags]Subcommands:
| Subcommand | Description |
|---|---|
create | Create a new API key |
list | List all API keys |
delete | Delete an API key |
rotate | Rotate an API key |
ironflow apikey create
Section titled “ironflow apikey create”Create a new API key with the given name. Returns the key value which must be saved immediately.
ironflow apikey create <name> [flags]Arguments:
| Argument | Required | Description |
|---|---|---|
name | Yes | Name for the new API key |
Flags:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--env | string | Environment ID to scope the key to | ||
--role | string[] | Role ID to assign (can be specified multiple times) | ||
--expires | string | Expiration duration (e.g. 720h for 30 days) | ||
--platform | bool | false | Create a platform-scoped key (ifplatform_ prefix) | |
--server | -s | string | Server URL override |
Examples:
# Create a basic API keyironflow apikey create my-key
# Create a key with rolesironflow apikey create my-key --role role_abc123 --role role_def456
# Create a key scoped to an environment with expirationironflow apikey create my-key --env env_abc123 --expires 720h
# Create a platform key for cross-tenant operationsironflow apikey create my-platform-key --platformironflow apikey list
Section titled “ironflow apikey list”List all API keys with their IDs, names, prefixes, roles, and timestamps.
ironflow apikey list [flags]Flags:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--json | bool | false | Output as JSON | |
--platform | bool | false | List only platform-scoped keys | |
--server | -s | string | Server URL override |
Output:
ID NAME PREFIX ROLES CREATED LAST USED EXPIRESak_abc123 my-key ifkey_a1b2c3d4 role_abc123 2026-01-01T00:00:00Z 2026-03-01T12:00:00Z -Examples:
# List all API keysironflow apikey list
# List platform keys onlyironflow apikey list --platform
# List as JSONironflow apikey list --jsonironflow apikey delete
Section titled “ironflow apikey delete”Delete an API key by its ID. The key is immediately revoked.
ironflow apikey delete <id> [flags]Arguments:
| Argument | Required | Description |
|---|---|---|
id | Yes | API key ID to delete |
Flags:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--server | -s | string | Server URL override |
Examples:
ironflow apikey delete ak_abc123ironflow apikey rotate
Section titled “ironflow apikey rotate”Rotate an API key by its ID. Creates a new key with the same name, environment, and roles. The old key is immediately revoked.
ironflow apikey rotate <id> [flags]Arguments:
| Argument | Required | Description |
|---|---|---|
id | Yes | API key ID to rotate |
Flags:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--server | -s | string | Server URL override | |
--json | bool | false | Output as JSON (machine-readable) |
Examples:
ironflow apikey rotate ak_abc123