Authentication
Every request under /v1 needs a key. You create keys in the developer console, and an Owner or an Admin of your organization can create them.
Two kinds of key
Section titled “Two kinds of key”| Secret | Publishable | |
|---|---|---|
| Looks like | sk_live_<keyId>_<token> |
pk_live_<keyId> |
| Reaches | Every /v1 endpoint |
GET /v1/schools/autocomplete only |
| Belongs in | A server, a job, or a deployment secret | A web page |
| Shown | Once, when you create it | Whenever you open it in the console |
Use a secret key on your servers. Bursary stores only a hash of it, so nobody can show it to you again. If you lose one, create another and revoke the first.
Use a publishable key in a browser. It is meant to be read off a public page. It reaches one endpoint, and only from the web origins you register for it. Building a school picker covers the browser side.
The keyId near the front of both keys is what support asks for. Never send the whole secret key to anyone.
Sending a key
Section titled “Sending a key”Either header works:
x-api-key: sk_live_...Authorization: Bearer sk_live_...Use whichever your HTTP client makes easier. If you send both, x-api-key is the one that counts.
Rotating a secret key
Section titled “Rotating a secret key”- Create a new key.
- Deploy it everywhere the old one is used.
- Revoke the old key.
A revoked key stops working everywhere within about a minute, so finish step 2 before step 3.
When a key is refused
Section titled “When a key is refused”401withauth.unauthenticatedmeans no key arrived, or the key does not exist. Check the header name and the value.401withapi_key.revokedmeans someone in your organization revoked the key. Create a new one and redeploy.403withauth.forbiddenanddetails.requiredTiermeans the key is valid and your plan doesn’t include what you asked for. See What a plan returns.403withauth.forbiddenand nodetailsmeans a publishable key was sent from an origin you haven’t registered, without anOriginheader, or to an endpoint other than autocomplete. It also answersPOST /v1/exportswhen your plan lacks the bulk snapshot add-on.
Errors lists every code.
The one endpoint without a key
Section titled “The one endpoint without a key”POST /corrections takes no key. Anyone can report a correction, including an institution with no Bursary account.