Developer docs menu
Developers
Authentication
Every request carries an API key. A key belongs to one organisation and can only read that organisation’s data. What it can read is set by its scopes.
Creating a key
Only an organisation admin can create, see or delete keys, and only while the organisation’s plan includes API access (Professional and Custom).
- In Quick Policy, open Integrations from the menu. Only admins see it.
- On the API Keys tab, choose Create API Key.
- Give the key a name that says where it will be used (3 to 100 characters), tick the scopes it needs, and optionally set an expiry date. Then choose Generate Key.
- Copy the key from the panel that appears. It is shown only this once: we keep a one-way hash of it, not the key itself, so it cannot be shown again. If it is lost, delete it and create another.
Keys look like qk_ followed by 64 letters and numbers. The Integrations page lists each key by its first characters, with its scopes and when it was last used.
Sending the key
Put the key in the Authorization header with the Bearer scheme. It is not accepted in the address or in any other header.
curl -s "https://www.quickpolicy.co.uk/api/organizations/current" \
-H "Authorization: Bearer $QP_API_KEY"Treat a key like a password: keep it in a secrets store or environment variable, never in source code or a browser, and give each system its own key so you can revoke one without breaking the others.
Scopes
A request needs the scope named on its reference page. A key with admin has them all.
read:policiesList policies and read a single policy.
read:incidentsList incidents and read one incident in full. Needs a plan that includes incident management.
adminEverything the other scopes allow, and the scope that lets a key read draft and archived policies: a read:policies key sees published policies only.
Reading your organisation (GET /api/organizations/current) needs no scope: any active key can do it.
Draft policies. A key with read:policies sees published policies only. Draft and archived policies need the admin scope: drafts are unapproved text that should not leave the app without a reason. The visibility object in the policy list tells you which applies.
Expiry, revoking and rotating
- A key with an expiry date stops working at that moment. Requests then get a
401. - Deleting a key on the Integrations page stops it straight away.
- Every request checks that your organisation’s plan still includes API access. If it no longer does, every key stops working and requests get a
403with the codeAPI_ACCESS_NOT_IN_PLAN. They work again if the plan changes back. - Keys cannot be edited. To change a key’s scopes, or to rotate it, create a new key, move your system over, then delete the old one.
- Reads made with a key are recorded in your organisation’s audit log against the admin who created it.
Next
Make your first request, or see what each error means.