---
title: "API keys: create, rotate and revoke article | HelpCenterKit"
canonical: https://helpcenterkit.com/templates/api-key-create-rotate-revoke
last_modified: 2026-11-10
publisher: Surge Software Solutions Private Limited
---

# API keys: create, rotate and revoke article | HelpCenterKit

> An API key article tells developers how to create a key with the narrowest scope, that the key is shown only once, how to rotate it with no downtime (create the new key, deploy it, then revoke the old one), and what to do in the first ten minutes if a key leaks. Put the leaked-key steps near the top: that's when people read this page in a hurry.

**For:** SaaS products with a public API · Updated 10 Nov 2026

An API key article tells developers how to create a key with the narrowest scope, that the key is shown only once, how to rotate it with no downtime (create the new key, deploy it, then revoke the old one), and what to do in the first ten minutes if a key leaks. Put the leaked-key steps near the top: that's when people read this page in a hurry.

Keys leak in boring ways: pasted into a public GitHub repo, a screenshot in a support ticket, a front-end bundle. GitHub's secret scanning and similar tools find many of them quickly, and so do attackers. Your article should make revocation a two-click job and explain how to check what the key was used for.

Rotation is the other recurring question, especially from companies with security policies requiring rotation every 90 days. Allowing two active keys at the same time is what makes zero-downtime rotation possible; document that.

## What the article must cover
- Who can create keys and where.
- Scopes or permissions, and test vs live keys.
- That the key is shown once, and how to store it.
- Zero-downtime rotation steps.
- Leaked-key steps: revoke, check usage logs, create a new key.

## Template (copy and replace the [brackets])

```markdown
# API keys

## If a key has leaked
1. Go to **Settings → API keys** and click **Revoke** next to it. It stops working within [1 minute].
2. Open **API logs**, filter by that key, and check the last [30] days of requests.
3. Create a new key and update your app.
4. Tell us at [security@example.com] if you see requests you don't recognise.

## Create a key
1. **Settings → API keys → Create key** (owners and admins).
2. Name it after where it will live, e.g. "[billing-sync production]".
3. Choose scopes: [read:orders], [write:orders], [read:customers]. Pick only what the app needs.
4. Copy the key. **We show it once.** Store it in a secret manager or environment variable, never in code.

| Prefix | Use |
| --- | --- |
| [sk_test_] | Test mode: no real [orders or payments] |
| [sk_live_] | Live data |

## Rotate a key with no downtime
1. Create a second key with the same scopes.
2. Deploy your app with the new key.
3. Check **Last used** on the old key stops updating.
4. Revoke the old key.

You can have up to [5] active keys.

## Good habits
- One key per app or environment, so you can revoke one without breaking others.
- Rotate every [90] days if your security policy asks for it.
- Never send keys in support tickets; send the key's name instead.
```

## Mistakes to avoid
- Burying the leaked-key steps at the bottom.
- Allowing only one active key, which makes rotation cause downtime.
- Showing full keys again later in the dashboard.
- Not having a last-used timestamp, so customers can't tell whether a key is safe to revoke.

## Questions

### Why show an API key only once?

Because you should store only a hash of it, like a password. If customers lose it, they create a new one. This limits the damage of a dashboard compromise.

### How often should API keys be rotated?

Many company policies say every 90 days, and always immediately after a suspected leak or when someone with access leaves. Your article can recommend a cadence; the customer's policy decides.

### Should the article cover OAuth?

Only with a link. Keys are for server-to-server access by the customer; OAuth is for third-party apps acting on behalf of users. Keep them on separate pages.

## Sources
- [GitHub Docs: about secret scanning](https://docs.github.com/en/code-security/secret-scanning/introduction/about-secret-scanning) — checked 10 Nov 2026

Related templates: /templates/webhooks-setup-article, /templates/api-rate-limits-article, /templates/security-vulnerability-disclosure · All templates: /templates · Free generator: /templates/generator

Publish it: HelpCenterKit lets you save this as an article template, send it for approval and publish it to a help center where readers get AI answers that cite it. Free for your first 15 days: /signin?signup=1
