alpacon token create

Create a personal API token with a name, expiry, and scopes.

Usage

alpacon token create [flags]

Key facts

  • Omit --scopes to request the concrete scopes your roles allow.
  • --expiration-in-days 0 uses 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

FlagTypeDescriptionDefault
--expiration-in-daysintDays until the token expires (0 = the workspace’s maximum token lifetime).0
-h, --helpboolhelp for createfalse
-l, --limitboolSet to true to apply usage limits.true
-n, --namestringA name to remember the token easily.—
--scopesstringComma-separated list of scopes (e.g. “server:read,role_audit_log:read”). Omit to get the scopes your roles allow.—
--outputstringOutput format: table or jsontable

Examples

Create a token interactively

bash
alpacon token create

Create a token with a name and expiration

bash
alpacon token create -n my-token --expiration-in-days 30

Create a token without limits

bash
alpacon token create -n my-token -l=false

Create a token with specific scopes

bash
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.

Note

For automation that executes commands or transfers files, use a service token. The personal-token lifetime limit does not apply to service tokens.

Last updated: