---
id: "twitter_bearer_token"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["secrets"]
langs: ["common"]
quality: 65
url: "https://registry.apicrafter.io/datatype/twitter_bearer_token"
---

# X (Twitter) API bearer token (`twitter_bearer_token`)

> **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.

App-only bearer token of the X (Twitter) API. X describes the token as a byte array of unspecified format; the regexp follows the gitleaks rule, which expects 22 letters A followed by 80 to 100 letters, digits and percent signs, as in the sample responses in the X documentation.

- 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`):

```
^A{22}[A-Za-z0-9%]{80,100}$
```

## Supported by tools

- `datadogsds`
- `gitleaks`

## Sources

- doc: <https://docs.x.com/fundamentals/authentication/oauth-2-0/bearer-tokens>
- other: <https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml>

## Quality

Score 65/100. Missing: examples, negative example, mapping (Wikidata, Schema.org, ...), translation.

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