Skip to main content

Personal access tokens

A personal access token is a credential you create in the platform UI, so that the CLI and direct API calls can act as you without your password. It has the same permissions your account has, except for a few actions that need you signed in to the platform UI.

The life of a personal access token. Renaming or regenerating it keeps it active, but regenerating replaces its value, so anything still using the old value stops working.

What a personal access token is​

A personal access token (PAT) acts on behalf of your account with the same permissions your account has. It cannot change your password or email, delete your personal account, disable multi-factor authentication, regenerate your recovery code, or manage personal access tokens; those need you signed in to the platform UI. Permissions and restrictions lists these sign-in-only actions.

A personal access token is required to use the CLI as yourself: swale login checks it with the platform and stores it on your machine, or SWALE_ACCOUNT_TOKEN supplies it; see login.

The one exception is a task running inside a workflow, which can authenticate the CLI with the workflow run token instead. That token reaches far less; see Workflow run token.

One token works for every account you belong to: your own and each organization you are a member of. swale login stores it for the one account you name, so log in once to each account you work in, with the same token or another, then switch between them.

Creating a token​

You create tokens on the Personal Access Tokens page, under Settings, giving each a name and an expiration of 7, 30, 60, or 90 days, or none; see Manage personal access tokens. The token value is shown exactly once, immediately after creation: the platform cannot show it to you again.

Token lifecycle​

EventWhat happens
CreatedValue shown once; token becomes active immediately
ExpiredToken stops working; CLI requests return an authentication error
RegeneratedA new value is generated with a newly chosen expiration; the old value is invalidated
RenamedDisplay name updated; value and expiration unchanged
DeletedToken is permanently revoked

Security considerations​

  • Store token values in a secrets manager or encrypted vault, not in plain-text files.
  • Use a short expiration window for tokens shared with automated systems.
  • Regenerate a token immediately if you suspect it has been exposed.
  • Each regeneration invalidates the previous value, so update any tools or scripts that use the old value.

Next steps​