Skip to content

API keys

Making a key

Owners and admins make keys in the web app, signed in:

  1. Open Integrations, API keys, Make a key.
  2. Give it a label (for example "Production SIEM").
  3. Choose the access: Read, or Read and write.
  4. Choose an expiry in days (30, 90 or 365), or leave it empty for no expiry.
  5. Copy the key. It is shown only once.

An organization can have a limited number of active keys. Trial keys are read only and end with the trial. Partner keys are issued by BreachSpider.

Using a key

curl -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
  https://breachspider.com/api/v1/cves/CVE-2024-9137
import os
import breachspider

bs = breachspider.Client(os.environ["BREACHSPIDER_API_KEY"])
print(bs.cves.get("CVE-2024-9137").severity)
const response = await fetch("https://breachspider.com/api/v1/cves/CVE-2024-9137", {
  headers: { "Authorization": `Bearer ${process.env.BREACHSPIDER_API_KEY}` }
});

Listing and revoking

In the web app, Integrations lists every key with its label, the start of the key, access, last used, expiry and device checks this month. Revoke is immediate: any request with a revoked key returns 401 with the message API key revoked. Keys are created, listed and revoked only in the web app (a signed-in session); an API key can never manage keys.

Expiry

A key with an expiry stops working at that time: every request returns 401 with the message API key expired. Make the new key before the old one expires.

Good practice

  • Keep keys in environment variables or a secrets manager, never in source code.
  • One key per integration, so you can revoke one without stopping the others.
  • Set an expiry on keys used by third parties.
  • Check last used for keys nobody should be using, and revoke them.