Revoke an API key
DELETE
/v1/organizations/{id}/api-keys/{key}
const url = 'https://app.caprid.com/v1/organizations/4/api-keys/example';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://app.caprid.com/v1/organizations/4/api-keys/example \ --header 'Authorization: Bearer <token>'The key stops working on the next request that presents it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer
The Organization’s id, from GET /v1/organizations.
Example
4key
required
string
The key’s id from the list. Not its secret.
Responses
Section titled “Responses”Revoked.
No valid credential. Missing, expired and revoked credentials all get the same response, and so does an API key whose trial has lapsed. An Agent token from before a claim gets a 401 too, once the claim has made the trial a person’s, with a message saying to get a new token.
Media typeapplication/json
object
error
required
string
Example
{ "error": "the requested grants exceed the key's scope"}Headers
Section titled “Headers”WWW-Authenticate
string
Example
Bearer realm="switchboard"Sent with an API key limited to some Namespaces, to a Namespace outside its limit, or to a route that acts on the Organization as a whole. A limited key can never create API keys.
Media typeapplication/json
object
error
required
string
Example
{ "error": "this API key is limited to the Namespaces acme-staging, and acme isn't one of them"}No such thing, or not yours. Another customer’s Organization or Namespace is a 404 too, so nobody can tell which ones exist.
Media typeapplication/json
object
error
required
string
Example
{ "error": "the requested grants exceed the key's scope"}