Skip to main content
You can create a personal access token (PAT) to authenticate in the CLI or with the API.

Creating a personal access token

To create a personal access token, head to the project settings, then to personal access tokens, then click generate token.
The personal access tokens settings page with an empty token list and a generate token button

Token ownership

A personal access token uses its creator’s permissions and stops working if that user is removed from the organization. You can only create tokens for yourself: the API creates them for the signed-in user (POST /api/v1/user/me/personal-access-tokens), and no endpoint creates a token for another user. For CI/CD, use a dedicated identity; see Set up secrets and credentials.

Token policies

Self-hosted admins can disable personal access tokens, limit which organization roles can use them, and cap their lifetime with the personal access token environment variables. For token lifetime on Cloud, the lack of an organization-wide token list, and tracing token queries in your warehouse, see Access governance.