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

# Discord bot token (`discord_bot_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.

Token that authenticates a Discord bot to the Discord API, sent in the header Authorization: Bot <token>. It has three Base64url parts separated by dots; the first part encodes the bot's user ID. Discord documents the format only by example; the regexp follows the structure of the documented sample and the part lengths that secret scanners expect.

- 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-Za-z0-9_-]{23,28}\.[A-Za-z0-9_-]{6}\.[A-Za-z0-9_-]{27,}$
```

## Examples

- `CZhtkLDpNYXgPH9Ml6shqh2OwykChw` (invalid example) — Sample OAuth2 bearer token from the Discord API reference

## Supported by tools

- `datadogsds`
- `gitguardian`
- `githubsecretscanning`
- `pywhat`

## Sources

- doc: <https://docs.discord.com/developers/reference#authentication>
- other: <https://github.com/bee-san/pyWhat/blob/main/pywhat/Data/regex.json>

## Quality

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

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