Revoke a publishable key
Turns a key off. Needs settings: write, and is a write.
Every request made with it is refused from then on, so any page still carrying it stops being able to read this newsletter's data. Deploy the replacement before calling this.
The row survives and keeps its name, its prefix and the date it was turned off, because the question asked after an incident is "which key was that", and a row that vanished on revocation cannot answer it. Revoking an already revoked key succeeds and keeps the original date.
There is no un-revoke, for the reason there is none for an API key: a revocation that could be undone would let whoever found the key put it back.
Publishes no event.
Request
- Base URL: https://api.usecommune.com
- URL: https://api.usecommune.com/publishable-keys/{publishable_key}
- Auth: one of:
- HTTP bearer
- OAuth 2 (authorization code, authorization URL https://usecommune.com/api/oauth/authorize, token URL https://usecommune.com/api/oauth/token, scopes: settings:write)
Headers
A value of your choosing naming the change this request is making.
Send the same value again to retry the same request. Commune replays the answer the first attempt gave instead of making the change twice, and marks the replay with an Idempotent-Replay: true response header. Send a different value for a different change: a key reused for a request that differs in any way answers 409, because replaying an answer to a question you did not ask is a wrong answer you could not detect.
A UUID per change is the usual choice. Remembered for 24 hours, per credential, so two credentials choosing the same value never see each other's answers.
Required, not optional.
Response
The key, turned off.
Example response
{
"newsletter": {
"object": "newsletter",
"id": "9a4c1c6e-0f2b-4f47-9d3f-6d1b1a2c3d4e"
},
"key_prefix": "cmn_pk_7Qa2Lk9x",
"allowed_origins": [
"http://localhost:5173"
]
}Changes
No recorded changes to this operation across all 1 revision of this API.