# Leaked Codacy API Token? Delete It and Check Repos

> Codacy API token leaked in CI or a script? Delete it under access management, create a replacement and review repository access. Step-by-step.

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

---

[LeakWatch](/)

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

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

Code & CI · Secret guide

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

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

A Codacy API token gives a program access to Codacy, the code quality and security platform that analyzes repositories and reports on issues. An account API token acts with the same organizations, repositories and operations as the account’s owner, so a leaked one can read code analysis results, change repository settings and, depending on the owner’s rights, add or remove repositories. Code quality results also map out the weak points of your code, which is useful to an attacker. Delete the token first, then check what was changed.

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

Provider

Codacy

Severity

Medium

Impact

Source code and build access

Checked live by LeakWatch

No

## What a Codacy API token looks like

Codacy tokens are random strings of 20 letters and digits, with no public prefix. Codacy has two kinds of token: account API tokens, which belong to a user, and project tokens, which are scoped to a single repository. The rule matches a value of this shape placed close to the word `codacy` in a variable, a pipeline setting or a configuration file:

```text
CODACY_API_TOKEN=<20-character value, masked as XXXX…>
```

Because the value is short and has no prefix, a match can only be trusted together with its context. Check whether the token was an account token or a project token, since that decides how far it reaches. Older tokens may have no expiry date, and Codacy’s documentation shows some tokens with an expiry of never.

## How Codacy tokens get leaked

-   **CI configuration.** A pipeline file that runs the Codacy reporter, with the token written into the file instead of read from the secret store.
-   **Scripts that report results.** A script that uploads coverage or analysis data, with the token in its source code and committed to the repository.
-   **Shared examples.** A snippet pasted into a blog post or a support thread with the real token left in place of the placeholder.
-   **CI logs.** A pipeline that prints its variables or the full command, including the token argument.
-   **Copied templates.** A starter repository that still contains a configuration with the original author’s token.

## What to do in the first hour

1.  **Delete the token.** Open your Codacy account, go to the access management tab, and find the account API token that matches the leak. Click the trash icon in its row to delete it. Applications that still use it will fail to authenticate afterwards. Do this before you clean the repository.
2.  **Create a replacement** with an expiry date, as Codacy recommends, and store it in your CI secret store. Update the pipelines and scripts that used the old token, then run one analysis to confirm they work.
3.  **Review the repositories and settings.** Check the list of repositories in your organizations for additions or removals you did not make, and look at the repository settings for changes to quality gates or integrations.
4.  **Review the access.** Look at the members of the organizations and remove anyone who should not have access. Check the integrations connected to the repositories as well.
5.  **Check the other secrets** in the same pipeline. CI configurations usually hold several tokens for code hosts, cloud services and other analysis tools, so rotate those too.
6.  **Clean the repository** after the rotation: remove the value from the files, add the file to `.gitignore` and decide whether to rewrite history. The order of steps is in [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github).

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

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

## Revoke it at Codacy

Sign in to Codacy and open the account settings, then the access management tab. Under account API tokens, find the token and delete it with the trash icon. Codacy’s API token documentation describes creating a replacement first, updating your services and then deleting the old token, which avoids a gap in analysis. The documentation is on [docs.codacy.com](https://docs.codacy.com/codacy-api/api-tokens/). Some of the pages we found were for older versions of the product, so check the labels in your current interface.

## How LeakWatch detects it

The rule is called Codacy API Token. It looks for the word `codacy` followed, within about 40 characters, by a standalone run of exactly 20 letters or digits. The word must come before the value, so a 20-character string that appears without a Codacy reference nearby is not reported. The severity is **medium**, with the impact class for identity and code access. **This type is not checked live**: LeakWatch does not send the token to Codacy.

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

What is the difference between an account token and a project token?

An account token follows the rights of its owner across all organizations that owner can reach. A project token is limited to one repository. If you find an account token, treat it as the wider risk and delete it first.

Will deleting the token break my code analysis?

Pipelines that use it will fail until they get the new token. Create the replacement, update the pipelines and run one analysis before you remove anything else.

Should I set an expiry date on the new token?

Yes. Codacy’s documentation recommends replacing old tokens with ones that have an expiry date, and an expiry limits the time a leaked token can be used.

## Related

-   [Codecov Access Token](/secrets/codecov-access-token)
-   [SonarQube Token](/secrets/sonarqube-token)
-   [Snyk API Token](/secrets/snyk-api-token)
-   [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 Codacy.

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