Leaked API key: how to rotate it without silencing your article audio
An API key pasted in a public repository, a support ticket or a screenshot is no longer a secret. The rotation order that avoids downtime, what revocation cuts off and how fast, how to tell whether the key was used, and what the tool does not do for you yet.
Most API keys do not leak through carelessness. They leak through ordinary work: a config file committed to a repository that turned out to be public, a contractor pasting the key into a ticket so someone can reproduce a bug, a screenshot of the dashboard dropped into a busy chat channel. Once that happens, the key is no longer a secret, and the only question worth asking is practical: how do you replace it quickly without your articles losing their audio while you do?
This is the procedure as it works in WeDispatch today, along with the limits you should know about before you need it.
Know what is a secret and what is not
A WeDispatch key always starts with wd_live_ followed by 48 random characters. It lets a server create, regenerate or delete audio on behalf of your account. It belongs in the Authorization header of a request sent from your server, never from the page your readers load.
The player on your articles does not need it. The public script carries a data-site attribute that identifies your account. That is an identifier, not a password, and it cannot produce anything. So if you ever find wd_live_ in the source of a public page or in a JavaScript bundle served to browsers, it is not an odd setup choice. It is a leak, and it gets handled like any other.
On WordPress, the problem rarely comes up. The plugin connects through a "Connect this site" button that swaps a two-minute code for its own key, server to server. Nobody sees the key, so nobody can paste it anywhere. That is one of the reasons we suggest the WordPress plugin over a custom integration whenever the site allows it.
The right order: create, deploy, then revoke
The instinct is to revoke first. If you suspect someone is actively abusing the key, follow that instinct. In every other case, revoking first breaks your own integration before the replacement is live, and anything you publish in the gap goes out without audio.
The order that leaves no gap:
- Create a second key in the dashboard's API keys section, with a name that will still mean something in six months ("Production, December" rather than "API key"). An account can hold up to ten active keys at once, precisely so that two can overlap during a rotation.
- Copy it right away. It is shown once. We only store a hash of it, so we cannot show it to you again later. We can only issue a new one.
- Put it in your configuration (your host's environment variables or your secrets manager) and redeploy your CMS or script.
- Check that it works. A published or regenerated article should go through, and the "Sites & integration" screen should list the new key among the connections it has actually seen.
- Revoke the old one. One button, one confirmation.
Only the account owner and administrators can create or revoke keys. A team writer cannot, by design: a key opens the whole account's API, and it outlives the person who created it.
What revocation cuts off, and how fast
Revoking a key does not delete it from our records. It marks it revoked, effective immediately. The next request that presents it gets a 401 with the message "Invalid or revoked API key". There is no propagation delay and no cache that keeps accepting it for a few more hours.
What revocation does not touch: audio already produced stays online, the player on your pages keeps playing it, and podcast feeds are unaffected. The key authorises production, not distribution.
One point that matters for billing: credits belong to the account, not to the key. Revoking a key and creating another resets nothing, in either direction. If someone spent credits with the exposed key, those credits are spent, and the monthly usage counter is where you will see it. The budget safeguards limit how far such an incident can go. They do not undo it.
Finding out whether the key was used
For every key that has actually been used, the "Sites & integration" screen shows when it was last seen, what was calling (the WordPress plugin, a script, an MCP client) and, when the request says so, from which domain. That record is refreshed at most once an hour, so that every API call does not turn into a database write.
It is enough to answer the question that usually matters: has anyone other than us used it? A key you had stopped using that shows up as seen yesterday from a domain you do not recognise is your answer.
What the tool does not do yet
Better to know this before an incident than in the middle of one:
- No expiry date. A key stays valid until someone revokes it. If your policy requires rotating every quarter, you have to schedule it yourself.
- No self-service call log. You see the last use, not every request. If you need to trace a specific action, contact us: we can find it, it just is not exposed in the dashboard.
- No automatic leak detection. Nothing will warn you that a key has just appeared in a public repository. That vigilance stays with your team.
The same limits are listed on our security page, alongside the other things we do not do.
Assistants and connected applications
If you drive audio production from an MCP-compatible assistant, connect it through application authorisation rather than a pasted key where you can. That application token is not an API key: it cannot reach sensitive operations (the subscription lock secret, audio deletion, account profile changes), and an expired token says so plainly instead of asking for a key. Fewer copied keys means fewer keys to rotate.
The short version
A leaked key takes about five minutes to replace if you follow the order: new key, deploy, verify, revoke. Revocation is immediate and leaves published audio alone. To lower the risk at the source, keep keys on the server, use keyless connection where it exists, and give each integration its own named key so you can cut one off without touching the rest. Request details are in the CMS API feature page and in our guide to wiring audio into any CMS through the API.
Give your articles a voice with WeDispatch
This blog is itself voiced by WeDispatch. Curious how it sounds on your content?
Book a demo