# Leaked PlanetScale API Token? Delete It, Audit Logs

> PlanetScale service or OAuth token exposed on GitHub? Delete it, check the audit log and branches for changes. Step-by-step guide.

Source: https://leakwatch.net/secrets/planetscale-api-token

---

[LeakWatch](/)

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

1.  [Home](/)
2.  [Secrets](/secrets)
3.  PlanetScale API Token

Databases & keys · Secret guide

# Leaked PlanetScale API Token: what to do in the first hour

Critical severityDetected onlyLast verified October 30, 2026 · 4 min read

A PlanetScale API token authenticates calls to the PlanetScale API or CLI. Depending on the access it was given, whoever holds it can list databases, create and delete branches, open deploy requests, create connection passwords and change settings. That reaches the schema and, through new passwords, the data itself. There are two kinds that LeakWatch recognizes: service tokens, and OAuth tokens issued to a person or an application. Delete the token first, then check what it did.

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

Provider

Planetscale

Severity

Critical

Impact

Payments and customer data

Checked live by LeakWatch

No

## What a PlanetScale API Token looks like

Both tokens start with a readable prefix, followed by 32 to 64 characters of letters, digits, dashes, dots, underscores and equals signs:

```text
pscale_tkn_XXXXXXXX…     PlanetScale service token (masked)
pscale_oauth_XXXXXXXX…   PlanetScale OAuth token (masked)
```

A service token is created for automation, comes with an ID, and has specific database permissions. You find it in `PLANETSCALE_SERVICE_TOKEN` variables, in the `PLANETSCALE_SERVICE_TOKEN_ID` companion and in CI workflows. An OAuth token comes from signing in with the CLI or from an application authorized to act for a user, and acts with that user’s rights. Database connection passwords start with `pscale_pw_` and are a different case, covered in the [PlanetScale database password guide](/secrets/planetscale-password).

## How PlanetScale API Tokens get leaked

-   **CI workflows.** A deploy-request or migration job that passes the service token in a pipeline file instead of a secret.
-   **Environment files.** `PLANETSCALE_SERVICE_TOKEN` and its ID in a committed `.env`.
-   **Local CLI files.** A configuration directory or a copied credential file with a token from `pscale login`, included in a repository or an archive.
-   **Scripts and notebooks.** Migration and automation scripts with a token typed into an API call header.
-   **Logs and support requests.** A verbose CLI run, a failing request pasted with its authorization header, or a screenshot of a token shown once at creation.

## What to do in the first hour

1.  **Identify the token.** For a service token, open the service tokens in your organization settings (see the link below) and match it by name or ID. For an OAuth token, find out which user or application it belongs to.
2.  **Delete a service token.** The detail page of a service token offers a delete action, and the CLI has `pscale service-token delete` with the token ID. Create a replacement with only the permissions the automation needs, and deploy it.
3.  **Cut off an OAuth token.** If it came from `pscale login`, run `pscale logout`, and sign in again. If an application holds it, remove the application’s access from the account of the user who authorized it.
4.  **Check the audit log.** The organization and user settings give access to detailed logs. Look for branch creation or deletion, new passwords, deploy requests you did not open and changes of settings.
5.  **Check what the token could create.** Review passwords on each database branch and delete those you do not recognize. A password created by an attacker outlives the token.
6.  **Review the schema.** Compare branches and recent deploy requests with your own history.
7.  **Clean up the code** and look for other secrets next to the token. 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 repository? [Run a free scan](/).

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

## Revoke it at PlanetScale

PlanetScale service tokens are managed in the settings of your PlanetScale organization, after you sign in with a user allowed to manage them. The documentation says a service token can be deleted at any time from its detail page, and that the CLI offers the same through its service-token commands. OAuth sessions are ended by logging out of the CLI or by revoking the application’s access for the user. A person has not confirmed the exact menu wording for this guide, and the interface can change, so if what you see differs, look for the page where service tokens are listed, and follow PlanetScale’s documentation.

## How LeakWatch detects it

Two rules cover this guide. The rule called Planetscale API Token recognizes the prefix `pscale_tkn_` followed by 32 to 64 characters from letters, digits, `_`, `=`, `.` and `-`, in any letter case. The rule called Planetscale Oauth Token does the same for `pscale_oauth_`, and the prefix there is case sensitive. Both need a word boundary before the prefix and a quote, space, semicolon or the end of the line after the value, and neither needs a variable name. A body shorter than 32 characters is not reported. The severity of both is **critical**. These types are not checked live: LeakWatch does not send any request to PlanetScale with the tokens it found.

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

Does deleting a service token break my database?

No. It only removes the token’s access to the API. Your application keeps working through its own connection passwords.

Can a leaked token read my data directly?

It acts on the API, but it can usually create connection passwords, and a password gives access to the data. That is why you must review the passwords on every branch.

What is the difference between the token and the ID?

A service token has an ID and a secret value. The ID alone cannot authenticate, but both are normally stored together.

## Related

-   [PlanetScale Database Password](/secrets/planetscale-password)
-   [Database Connection String](/secrets/database-connection-string)
-   [ClickHouse Cloud API Key](/secrets/clickhouse-cloud-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 Planetscale.

![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)
