# Leaked Segment Public API Token? Delete It and Audit Sources

> Segment Public API token exposed in code or a script? Delete it in Access Management, review sources and tracking plans, then reissue it. Guide.

Source: https://leakwatch.net/secrets/segment-api-key

---

[LeakWatch](/)

[Product](/product)[Live feed](/leaks)[Guides](/secrets)[Blog](/blog)[Free scan](/)

1.  [Home](/)
2.  [Secrets](/secrets)
3.  Segment Public API token

Messaging · Secret guide

# Leaked Segment Public API token: what to do in the first hour

High severityDetected onlyLast verified November 5, 2026 · 4 min read

A Segment Public API token lets whoever holds it manage a Segment workspace through the Public API. Depending on the role given to the token, that can mean creating and changing sources, destinations and tracking plans. Changing a destination can silently redirect your customers’ event data to a third party, which is why this token deserves prompt attention. Delete the token first, then check what changed in the workspace.

[Check your GitHub account for leaked secrets — free](/)

Provider

Segment

Severity

High

Impact

SaaS account access and billing

Checked live by LeakWatch

No

## What a Segment Public API token looks like

Segment Public API tokens are two long strings of letters, digits, underscores and hyphens, joined by a dot. Each part is a fixed length, so the value has a recognisable shape even without a prefix:

```text
<part one>.<part two>   Segment Public API token (masked)
```

The rule therefore depends on the word `segment` being close to the value. Because that word is common in ordinary text, a hit needs a check. Segment separates this token from the write-key that a website uses to send events, and it is the Public API token that deserves the most care.

## How Segment Public API tokens get leaked

-   **Automation committed to a repository.** A script that manages sources or tracking plans, with the token written in the file.
-   **CI pipelines.** A workflow that calls the Public API and prints its configuration, or stores the token where other jobs can read it.
-   **Infrastructure-as-code.** A configuration file for a managed workspace that includes the token.
-   **Shared scripts.** A snippet copied into a support request or a blog post, with the real token left in.
-   **Developer machines.** A token saved in a local configuration file that is later copied to another device or backed up.

## What to do in the first hour

1.  **Delete the token.** Open the account settings, go to the tokens area and delete the Public API token that leaked. Make sure you are in the right workspace before you do this.
2.  **Create a new token** only for the automation that needs it, and give it the smallest role that works. Store it in your secret manager.
3.  **Review destinations and sources.** This is the most important step. Look for destinations added, changed or enabled since the exposure, because a changed destination can send your event data elsewhere.
4.  **Review tracking plans.** Check for changed event schemas or new rules that you did not approve.
5.  **Check workspace members.** Remove anyone you do not recognise and review recent changes in the audit log.
6.  **Clean the repository.** Remove the token from files and history, and check the logs. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github).

Not sure what else leaked from the same automation? [Run a free scan](/).

[Not sure what else leaked? Run a free scan.](/)

## Revoke it at Segment

Open the account settings of your Segment workspace, go to the access management section, and find the tokens list. Delete the Public API token that leaked, then create a replacement if the automation still needs one. Only a workspace owner can create Public API tokens, according to Segment’s documentation, so the same owner will usually be needed for the rotation. Segment’s public API documentation is the reference for the current steps, and this guide has not confirmed the menu names on the live page.

## How LeakWatch detects it

The rule is called “Segment API Key”. It looks for the word `segment` within 40 characters of a value made of two dot-separated parts, each 43 characters long, using letters, digits, underscores and hyphens. The word must come before the value, with only a short gap between them. The severity is **high**. **This type is not checked live**: LeakWatch does not call Segment with the value it finds.

LeakWatch detects this format but does **not** check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

## FAQ

Is a source write key the same as the Public API token?

No. A write key lets a website or app send events. The Public API token manages the workspace. A leak of the Public API token is the more serious one.

Can the token read my customers' data?

Its main power is to change the workspace. Treat any exposure as serious anyway, because changes to destinations can route data outward.

Do Segment tokens expire?

Third-party descriptions say they do not expire by default, so rotate them on a schedule you choose.

## Related

-   [Customer.io API Key](/secrets/customer-io-api-key)
-   [Klaviyo API Key](/secrets/klaviyo-api-key)
-   [HubSpot API Key](/secrets/hubspot-api-key)
-   [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github)
-   [Which vendors leak most this week](/leaks/trends)
-   [All secret guides](/secrets)

[Get alerted next time a secret leaks — create a free account](/)

LeakWatch is not affiliated with Segment.

![Gabriel Diyan, founder of LeakWatch](/brand/Photo-Gabriel-Diyan.webp)

Gabriel Diyan (0xCr0c0)

Cybersecurity student, founder of LeakWatch. I built and run the scanner described here — the detection patterns, the false-positive classifier and the provider validators are mine. [More about who I am](/about).

[GitHub](https://github.com/Leakwatch-Scan) · [X](https://x.com/LeakwatchScan) · [LinkedIn](https://www.linkedin.com/in/gabriel-diyan-80a378375) · [GitHub (personal)](https://github.com/crocogab)

LeakWatch

Secrets leak into public commits every minute. This watches the forges for yours. Built and run by [Gabriel Diyan](/about), a cybersecurity student — [why LeakWatch exists](/about).

Scan

-   [Product](/product)
-   [Live feed](/leaks)
-   [Trends](/leaks/trends)
-   [API docs](/docs)
-   [CI/CD](/docs?tab=ci)

Read

-   [Blog](/blog)
-   [Secret guides](/secrets)
-   [Changelog](/changelog)
-   [About](/about)

Verify

-   [Security](/security)
-   [Privacy](/privacy)
-   [Terms](/terms)
-   [Legal](/legal)
-   [Contact](/contact)
-   [Status](https://status.leakwatch.net)

© 2026 LeakWatch

[GitHub](https://github.com/Leakwatch-Scan)[X](https://x.com/LeakwatchScan)
