Create and Revoke API Keys
Goal: give a script, a CI job or another service its own key to your DownBad account, and take it away again when you’re done with it.
An API key is a long secret string a program sends instead of signing in. Each key belongs to your account and to the person who made it, and has a name you choose, so you can tell which program uses which key.
Read or read-write?
Section titled “Read or read-write?”Every key has a scope, which is what the key is allowed to do:
- Read keys can look at your monitors, incidents and settings, but can’t change anything. Use one for a dashboard, a report or anything that only shows data.
- Read and write keys can also make changes, such as pausing a monitor or adding one. Use one only for a program that has to change things, such as a deploy job that pauses checks while it runs.
Give each program the smallest scope that does its job. A read key that leaks can’t change your account.
People on your account with the Viewer role can make only read keys. Owners and Editors can make both.
Create a key
Section titled “Create a key”-
Open Account. Choose Account at the foot of the menu on the left (on a phone, tap your avatar, then Account), and choose API keys in the list of sections.
-
Choose New API key. A dialog opens.
-
Name the key after the program that will use it, such as
Deploy pipeline, so you know what breaks if you revoke it later. -
Choose what it can do: Read, or Read and write.
-
Choose Create key. The dialog shows the whole key, which starts with
dbk_. -
Copy the key now with the copy button beside it, and put it where your program reads its secrets, such as your CI service’s secret settings. Then choose I’ve copied it.
Expected result: the key appears in the list under API keys with its
name, its scope, its first characters (such as dbk_1a2b3c4d…), when it was
created and Never used. Once a program uses it, Last used shows when,
updated at most once a minute. Times are shown in the time zone set in your
profile.
Revoke a key
Section titled “Revoke a key”Revoke a key when the program that used it is gone, or when the key may have leaked.
-
Open Account › API keys and find the key by its name and first characters.
-
Choose Revoke, then Revoke again in the dialog that asks you to confirm.
Expected result: the key shows Revoked and the time it was revoked. Anything still using it is refused from its very next request. A revoked key can’t be turned back on: make a new key instead.
Owners and Editors can revoke any key in the account. A Viewer can revoke only the read keys they made.
Use a key
Section titled “Use a key”Send the key as a bearer token to the DownBad API. Every endpoint, with an example for each, is in Use the DownBad API.
How many keys
Section titled “How many keys”An account can hold 25 keys that aren’t revoked. Revoked keys don’t count.
When something goes wrong
Section titled “When something goes wrong”Each refusal has its own section in API key refused: