alpacon token create
Create a personal API token with a name, expiry, and scopes.
Usage
alpacon token create [flags]
Key facts
- Omit
--scopesto request the concrete scopes your roles allow. --expiration-in-days 0uses the workspace maximum token lifetime.- Usage limits are enabled by default.
- New personal API tokens cannot hold command-execution or file-transfer scopes. Existing tokens may still hold those scopes. From December 1, 2026 (00:00 UTC), command and REST file-transfer creation with such a token needs an active, approved work session and still passes the token’s ACL checks. Until then, those calls outside a work session still run, with a warning header in each response; see Token restrictions. Reads and work-session requests retain their existing permission rules.
Flags
| Flag | Type | Description | Default |
|---|---|---|---|
--expiration-in-days | int | Days until the token expires (0 = the workspace’s maximum token lifetime). | 0 |
-h, --help | bool | help for create | false |
-l, --limit | bool | Set to true to apply usage limits. | true |
-n, --name | string | A name to remember the token easily. | — |
--scopes | string | Comma-separated list of scopes (e.g. “server:read,role_audit_log:read”). Omit to get the scopes your roles allow. | — |
--output | string | Output format: table or json | table |
Examples
Create a token interactively
alpacon token createCreate a token with a name and expiration
alpacon token create -n my-token --expiration-in-days 30Create a token without limits
alpacon token create -n my-token -l=falseCreate a token with specific scopes
alpacon token create --name ci-token --scopes "server:read"Scopes and expiry
Omitting --scopes gives the concrete scopes your roles allow that a personal token may carry. This also applies to Superusers; it does not grant *. Creation fails with 400 api_token_scopes_required if no scope is available. Requesting *, command:*, *:create, or a scope excluded from personal tokens fails with 400 api_token_scope_not_mintable.
--expiration-in-days 0 uses Maximum token lifetime (1–366 days, default 366). This limit applies to personal and registration tokens. Check the scopes you can grant with alpacon token scopes.
For automation that executes commands or transfers files, use a service token. The personal-token lifetime limit does not apply to service tokens.