Skip to content
Detectors

Scanner deep dive

Overview

HubSpot is a CRM platform that provides tools for marketing, sales, and customer service. HubSpot API keys can be used to access and modify data within the HubSpot platform.
TruffleHog’s own description of this detector
Provider and detector details

Summary

ProviderNo provider details added yet.

Runs on any connection. Triggered by keywords in the content, after decoding.How TruffleHog works

How detection works

The v1 detector checks decoded text containing “hubapi”, “hapikey”, “hapi_key” or “hubspot” for a possible credential.

Matching rules and source
Keywords
  • hubapi
  • hapikey
  • hapi_key
  • hubspot

Regex

  • v1 regexapikey.go:32 (opens TruffleHog source on GitHub)

    \b([a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12})\b
    Show as a diagram

    Must appear near: “hubapi”, “hapi_?key” or “hubspot”

apikey.go:32 (opens TruffleHog source on GitHub)apikey.go:37 (opens TruffleHog source on GitHub)apikey.go:76 (opens TruffleHog source on GitHub)apikey.go:91 (opens TruffleHog source on GitHub)apikey.go:100 (opens TruffleHog source on GitHub)apikey.go:102 (opens TruffleHog source on GitHub)
Detector-wide rules and behavior
Regular expression near a keyword
One value
Guards against false matches
Not found in source
Not found in source

How it behaves

What this detector does at each step of the TruffleHog pipeline.

Keywords

Any one of these in the decoded text wakes the detector.

  • hubapi
  • hapikey
  • hapi_key
  • hubspot

apikey.go line 38 (opens TruffleHog source on GitHub)

Behavior

Multi-part
No
Match window
512 bytes on each side of a keyword
ahocorasickcore.go line 159 (opens TruffleHog source on GitHub)
Custom endpoints
No
Cloud endpoint
None
Randomness check
None in this detector's own code
False-positive check
The shared word lists

Verification. When a scan allows it, TruffleHog tests a match by calling the provider. A scan can turn this off for every detector or for this one. Atlas only describes this; it never tests credentials. How the verify decision works

Analyzer.None in the open-source code.

In short

  • v1: Wakes on “hubapi”, “hapikey”, “hapi_key” or “hubspot” and tests matches with the provider. A default scan runs it.
  • v2: Wakes on “pat-na1-” or “pat-eu1-” and tests matches with the provider. A default scan runs it.

How verification works

The source checks both the HTTP status and the response body.

The detection and verification evidence on this page comes from the Open Source implementation. Check the Enterprise coverage guide for product availability.

Does checking a key change anything at the provider?

Not expected to: it’s a GET request, which reads without changing anything, and the source declares no changes.

Files
v1/apikey.go
Checked rule

v1 · Legacy API key

GET /contacts/v1/lists with the key in the hapikey query parameter.

Verified when HTTP 200 with a valid JSON body.

HTTP 401 rejects the key. Invalid JSON or any other status, including 403, produces a verification error.

View source for v1 · Legacy API key
Errors, timeouts and rate limits
Not found in source
Not found in source
If the provider can’t be reached
The result is an error, not a rejection, and the key can be checked again.

All URLs found in source

  • https://legacydocs.hubspot.com/docs/methods/auth/oauth-overview
  • https://api.hubapi.com/contacts/v1/lists?hapikey=
  • https://api.hubapi.com/account-info/v3/api-usage/daily/private-apps

Verified findings

Open Source · Standard output (stdout)

The CLI prints verified findings to stdout. Use --json for structured output.

Example scan output · credential redacted

✅ Found verified result 🐷🔑
Detector Type: HubSpotApiKey
Decoder Type: PLAIN
Raw result: [redacted]
Terminal printer source
CI formats

With --github-actions, GitHub Actions displays this workflow command as a warning on the indicated file and line.

::warning file=config/example.env,line=8,endLine=8::Found verified HubSpotApiKey result 🐷🔑
GitHub Actions printer source

Legacy compatibility. --json-legacy writes pre-v3 JSON for Git, GitLab, and GitHub sources only.

Enterprise alerts

When Enterprise verifies that a secret is live, a configured notifier can alert your team. The finding is also available through the Enterprise API.

Optional analysis

No analyzer is recorded for this detector, so Atlas shows no access assessment.

Rotation resources

Use the provider’s instructions for this credential.

Rotation and revocation instructions

HubSpot documents rotation for the access token of a legacy private app. This procedure applies to the private-app token variant, and the console offers immediate expiry of the old token when appropriate.

Provider documentation checked by Atlas on .

See it in the rotation directory

Token types

TruffleHog’s source looks for 2 token types, by prefix. It doesn’t name them.

Token types: from TruffleHog’s source, and what the vendor says
PrefixVariant
pat-eu1-v2
pat-na1-v2
Pages TruffleHog’s source links to (1)

Written in the detector’s source by its authors. Shown as written: this doesn’t say what each page covers.

Coverage in other scanners

4 scanners have a confirmed match.

Changes

1 recorded change since Sep 18, 2026; 1 still needs review.

Source

Facts on this page were read from trufflesecurity/trufflehog at commit 2325546.

2325546
2921dcc