Keys / GitLab

GITLAB_TOKEN

A GitLab personal access token your app or script calls the GitLab API with.

Starts with
glpat-
Expires
you choose, up to 365 days by default
API
list, rotate and revoke; create on GitLab Self-Managed and Dedicated only

Get it

Create one on gitlab.com/-/user_settings/personal_access_tokens. The steps aren't recorded yet.

Set it

GITLAB_TOKEN=glpat-...

The GitLab CLI (glab) reads it; elsewhere, the app passes it in. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Create a new token with the same scopes.
  2. Deploy it everywhere that reads GITLAB_TOKEN.
  3. Check that nothing still uses the old token, then revoke it.
  4. Or select Rotate on the old token: the new one keeps its scopes, but the old one stops working at once.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16