---
id: "gitlab_pat"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["secrets"]
langs: ["common"]
quality: 70
url: "http://registry.apicrafter.io/datatype/gitlab_pat"
---

# GitLab personal access token (`gitlab_pat`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Personal access token of GitLab, which authenticates a user to the GitLab API and to Git over HTTPS. GitLab gives these tokens the prefix glpat-. The classic form has 20 more characters; the newer routable form is longer and ends with a dot and a nine-character suffix. Examples are left out because GitHub push protection rejects token-shaped values, even constructed ones.

- Parent datatype: `access_token`
- Personal data (PII): no
- Categories: Secrets and credentials (passwords, keys, tokens) (secrets)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^glpat-(?:[A-Za-z0-9_-]{20}|[A-Za-z0-9_-]{27,300}\.[0-9a-z]{2}[0-9a-z]{7})$
```

## Examples

- `glpat-ExampleToken` (invalid example) — Too short

## Supported by tools

- `detectsecrets`
- `gitleaks`
- `nightfall`
- `semgrep`
- `trufflehog`

## Sources

- doc: <https://docs.gitlab.com/security/tokens/>
- other: <https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml>

## Quality

Score 70/100. Missing: examples, mapping (Wikidata, Schema.org, ...), translation.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/gitlab_pat.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/secrets/gitlab_pat.yaml>
