ptkl api-users
Manage API users, secrets, and role assignments from the command line.
Overview
API users are service accounts used for machine-to-machine authentication. They authenticate with
a username and secret (instead of email and password) and are typically used in CI/CD pipelines,
backend integrations, and automated scripts. ptkl api-users lets you manage their secrets, roles,
and authentication tokens.
Subcommands
| Subcommand | Description |
|---|---|
list |
List all API users |
get |
Get an API user by UUID |
edit |
Edit an API user's role assignments |
new-secret |
Generate a new secret for an API user |
revoke-secret |
Revoke an API user's current secret |
get-auth-token |
Obtain an authentication token |
ptkl api-users list
List all API users in the current project.
Options
| Option | Description |
|---|---|
-f, --format <format> |
Output format — json or table (default: table) |
-o, --output <file> |
Write output to a file instead of stdout |
Example
ptkl api-users get
Get the details of an API user by UUID.
Options
| Option | Description |
|---|---|
-u, --uuid <uuid> |
UUID of the API user |
-f, --format <format> |
Output format — json or table (default: table) |
-o, --output <file> |
Write output to a file instead of stdout |
Example
ptkl api-users edit
Update the role assignments of an API user.
Options
| Option | Description |
|---|---|
-u, --uuid <uuid> |
UUID of the API user to edit |
-r, --roles <roles...> |
One or more role UUIDs to assign |
-f, --format <format> |
Output format — json or table (default: table) |
-o, --output <file> |
Write output to a file instead of stdout |
Example
ptkl api-users new-secret
Generate a new secret for an API user. The new secret is printed to stdout — store it securely, as it cannot be retrieved again.
Options
| Option | Description |
|---|---|
-u, --uuid <uuid> |
UUID of the API user |
-f, --format <format> |
Output format — json or table (default: table) |
-o, --output <file> |
Write output to a file instead of stdout |
Example
Warning
The secret is displayed only once. Copy and store it in a secure location (e.g. a secrets manager or environment variable) immediately.
ptkl api-users revoke-secret
Revoke the current secret for an API user. Any integrations using the old secret will stop working immediately.
Options
| Option | Description |
|---|---|
-u, --uuid <uuid> |
UUID of the API user |
-f, --format <format> |
Output format — json or table (default: table) |
-o, --output <file> |
Write output to a file instead of stdout |
Example
ptkl api-users get-auth-token
Obtain an authentication token for an API user. Useful for scripting and CI pipelines.
Options
| Option | Description |
|---|---|
-u, --user <user> |
API user username |
-p, --password <password> |
API user secret |
-f, --format <format> |
Output format — json or table (default: table) |
-o, --output <file> |
Write output to a file instead of stdout |
Example
See Also
ptkl role— create and manage rolesptkl users— manage project users (human accounts)- Toolkit Overview — all available toolkit commands