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

# RubyGems API key (`rubygems_api_key`)

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

API key of RubyGems.org, used by the gem CLI to push and manage gems, for example through the GEM_HOST_API_KEY environment variable: rubygems_ followed by 48 hexadecimal digits.

- Parent datatype: `api_key`
- 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`):

```
^rubygems_[a-f0-9]{48}$
```

## Examples

- `rubygems_ExampleKeyNotReal` (invalid example) — Not hexadecimal and too short

## Supported by tools

- `gitleaks`
- `trufflehog`

## Sources

- doc: <https://guides.rubygems.org/api-key-scopes/>
- other: <https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml>
- other: <https://github.com/trufflesecurity/trufflehog/blob/main/pkg/detectors/rubygems/rubygems.go>

## Quality

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

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