Creating a GitLab personal access token
This guide is part of the Publicus connection catalog. Once you have the credentials, connect the service and Publicus stores them for you.
Distilled from GitLab’s own documentation: Personal access tokens and REST API authentication. Retrieved 2026-07-03.
- In the upper-right corner, select your avatar and choose Edit profile.
- In the left sidebar, select Access > Personal access tokens.
- Select Generate token; if the dropdown offers token types, choose Legacy token.
- Enter a Token name (required) and optionally a description.
- Set the Expiration date — it is required. If you leave it empty it is set to 365 days from today, which is also the default maximum; tokens expire at midnight UTC on the expiry date. (Non-expiring personal access tokens were removed in GitLab 16.0.)
- Select the scopes the connection needs — see the per-capability scopes in this catalog entry (
read_usersuffices for identity-only access;apigrants complete read/write API access). Addself_rotateif you want to rotate the token via the personal access token API using the token itself. - Select Generate token and save the displayed token somewhere safe — after you leave or refresh the page, you cannot view it again.
Usage and lifecycle notes:
- Send the token as a
PRIVATE-TOKEN: <token>header (GitLab’s recommended form) or asAuthorization: Bearer <token>(REST API authentication). - The default token prefix is
glpat-; self-managed administrators can change it (token overview). - Rotate from the token list (vertical ellipsis → Rotate, GitLab 17.7+): the original token becomes inactive immediately. Revoke immediately invalidates a token.
- Project access tokens and group access tokens work the same way but are attached to a project or group rather than a user; they authenticate identically (
PRIVATE-TOKENheader). - On GitLab Self-Managed or Dedicated, create the token on your instance and set the instance host on the connection; the API paths are identical.
Connect it to Publicus
Section titled “Connect it to Publicus”Open Connections under Credentials, choose GitLab, and pick GitLab personal access token. Publicus asks for exactly the fields listed above and keeps them in your workspace’s secret storage.
See also: GitLab in the catalog.
This guide is maintained by Publicus and published under CC BY 4.0.