List API keys
const url = 'https://app.caprid.com/v1/organizations/4/api-keys';const options = {method: 'GET', 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 GET \ --url https://app.caprid.com/v1/organizations/4/api-keys \ --header 'Authorization: Bearer <token>'Oldest first. Secrets are never listed, only a preview of each.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The Organization’s id, from GET /v1/organizations.
Example
4Responses
Section titled “Responses”The Organization’s API keys, expired ones included.
object
Identifies the key for revoking it. Not a secret.
The first 6 characters of the secret after sb_, so you can tell keys apart.
Absent for a key that never expires.
Absent for a key that has never been used.
The Namespaces the key is limited to, by name. Absent for a key
with no limit. A deleted Namespace drops out, so a key whose
Namespaces have all been deleted has [] here and can do nothing.
Example
[ { "id": "3f9a1c07be42", "namespaces": [ "acme-staging" ] }]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.
object
Example
{ "error": "the requested grants exceed the key's scope"}Headers
Section titled “Headers”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.
object
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.
object
Example
{ "error": "the requested grants exceed the key's scope"}