# Leaked AWS AppSync API Key? Delete It Now

> AWS AppSync API key exposed on GitHub? Delete it, create a new one with a short expiry, then check the API logs. Step-by-step guide.

Source: https://leakwatch.net/secrets/aws-appsync-api-key

---

[LeakWatch](/)

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

1.  [Home](/)
2.  [Secrets](/secrets)
3.  AWS AppSync API Key

Cloud · Secret guide

# Leaked AWS AppSync API Key: what to do in the first hour

High severityDetected onlyLast verified October 30, 2026 · 5 min read

An AWS AppSync API key is the simplest way to let a client call an AppSync GraphQL API: whoever sends it in the request header is treated as an authorized caller of that API. It does not grant access to the rest of your AWS account, but it does grant everything the API allows to API-key callers: reading and writing data through your queries and mutations, and triggering the resolvers and data sources behind them. Those can be DynamoDB tables, Lambda functions or HTTP endpoints. Delete the key first, then work out what was called with it.

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

Provider

AWS

Severity

High

Impact

SaaS account access and billing

Checked live by LeakWatch

No

## What an AWS AppSync API key looks like

An AppSync API key starts with `da2-` followed by 26 lowercase letters and digits:

```text
da2-XXXXXXXXXXXXXXXXXXXXXXXXXX   AWS AppSync API key (masked, 26 characters after the prefix)
```

The key is sent in the `x-api-key` header of requests to the API’s GraphQL endpoint, which looks like `https://<id>.appsync-api.<region>.amazonaws.com/graphql`. You will find it in frontend code, in `aws-exports.js` files generated by Amplify, in a `aws_appsync_apiKey` field, or in variables named `APPSYNC_API_KEY`. An important point: API keys are designed for public or low-risk use, and are often shipped inside web and mobile apps on purpose. So a key in a bundle is not automatically a mistake. It becomes a problem when the API behind it exposes more than public data. Do not confuse it with AWS access keys (`AKIA…`), which authenticate AWS API calls and are covered in a separate guide.

## How AppSync API keys get leaked

-   **Amplify configuration files.** The generated `aws-exports.js` or `amplifyconfiguration.json` contains the endpoint and the key, and is committed with the rest of the app.
-   **Frontend and mobile bundles.** The key ships in the JavaScript or the app package. This is by design, but the key can be read by anyone who downloads the app.
-   **Environment files.** `.env` files and Docker or compose files with the endpoint and key side by side.
-   **Documentation and examples.** A README, a Postman collection or a tutorial repository with a real key in the sample request.
-   **Continuous integration.** Test pipelines that print the headers of their requests in logs.

## What to do in the first hour

1.  **Open the API in the AppSync console.** Pick the correct region first, since AppSync APIs are regional, then open the API the key belongs to and find the settings where its authorization modes and keys are listed.
2.  **Delete the exposed key.** Create a replacement first if clients depend on it and need no downtime. Keys expire on their own, so give the new one the shortest lifetime that works for you. Deleting the old key stops requests that use it.
3.  **Reconsider the authorization mode.** If the API holds anything private, API-key access should not be your default mode. Switch to Cognito user pools, IAM or OIDC, and keep API keys for public data only.
4.  **Review what the key could do.** Read your schema and resolvers: which queries and mutations accept API-key callers? Check the authorization directives on each field.
5.  **Audit the usage.** If logging was enabled for the API, look at the CloudWatch logs for the period since the exposure. Otherwise check CloudTrail for management events on the API, and the data sources (DynamoDB tables, Lambda invocations) for unexpected writes.
6.  **Check for tampering.** Look for records created or changed that you did not expect, and for abnormal request volume that could raise your bill.
7.  **Clean up the code** and look for other secrets next to the key. 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 AWS

AppSync API keys are managed in the AWS console, under the AppSync service, in the API’s settings where authorization modes and API keys are listed. Sign in with a user allowed to modify that API. You can delete a key there, and you can create a new one. A person has not confirmed the exact menu wording for this guide, and the console can change, so if what you see differs, look for the page where the API’s keys and their expiry dates are listed, and follow the AWS AppSync documentation at [https://docs.aws.amazon.com/appsync/](https://docs.aws.amazon.com/appsync/).

## How LeakWatch detects it

The rule is called AWS AppSync GraphQL Key. It matches the literal prefix `da2-` followed by exactly 26 characters among lowercase letters and digits. It does not need a variable name nearby, and the text `da2-` is used as a quick pre-filter. The rule has no word boundary, so a longer lowercase string that merely contains such a sequence can also match, and uppercase characters are not accepted. The severity is **high**. This type is not checked live: LeakWatch does not send any request to AWS with the key it found, so a report does not say whether the key is still valid or expired.

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 it normal to find an AppSync key in a frontend bundle?

Yes, it is common, because API-key mode is meant for public clients. What matters is what the API lets such a caller do. If it exposes private data or sensitive mutations, the key is a real problem.

Does the key give access to my AWS account?

No. It only authorizes calls to the AppSync API it was created for. Its reach is the reach of the resolvers and data sources behind that API.

Do AppSync keys expire?

They have an expiry date set when they are created, and the console shows it. An expired key is rejected, but do not rely on that alone: delete it and review the logs for the period it was valid.

## Related

-   [AWS access key](/secrets/aws-access-key)
-   [Amazon Bedrock API Key](/secrets/amazon-bedrock-api-key)
-   [GCP Service Account Key](/secrets/gcp-service-account-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 AWS.

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