Authentication & API Keys
Every Tests API request is authenticated with your personal API key.
Generate a key
You need the Elite plan. On other plans the Developers page shows an upgrade option instead.
- Open the Developers page in AutoProctor (Developers in the sidebar).
- Choose Generate key. Read-only is ticked by default; untick it only if the key needs to close, hide or delete.
- Copy the key. It starts with
ap_and is shown only once: AutoProctor stores a fingerprint of it, not the key itself.
Treat the key like a password. Keep it on your server or in a secrets manager, never in a web page, a public repository or a shared document.
Send the key
Send the key with every request in one of two ways:
| Header | Example |
|---|---|
X-API-Key | X-API-Key: ap_… |
Authorization | Authorization: Bearer ap_… |
If both are present, X-API-Key is used.
What a key can see
- A key acts as you. It sees exactly what you see in your dashboard: the tests you created and the tests other admins added you to as a collaborator. Nothing else.
- To give a colleague's integration access to a test, add them as a collaborator on that test, and they use their own key.
- A key can read tests, test attempts, your subscription details and your usage, and it can close, reopen, hide or delete a test (Update a test, Delete a test) and delete a test attempt. It can't create tests, change test settings, manage collaborators, or touch billing and team settings.
Read-only keys
A read-only key can make every read but none of the changes: a PATCH or DELETE with it returns 403. Use a read-only key for reporting scripts and AI assistants.
You have one key at a time. Its read-only setting is chosen when you generate or rotate it, so changing it means rotating, and the old key stops working at once.
Plan checks
The Tests API needs the Elite plan. The plan is checked on every request, not just when the key is made:
- If your plan lapses, is downgraded or your balance goes negative, requests return
403with a message about the plan. Fix it on the Billing page. - The same key works again within a minute of the plan being valid again. You don't need to generate a new one. If you retry straight after renewing and still get
403, wait a minute and try again. - On a team, the key uses the team's plan: joining a team that isn't on Elite turns the key off.
- Rotating or revoking a key takes effect immediately.
Rotate or revoke
- Rotate on the Developers page to get a new key. The old key stops working immediately, so update your integration right away.
- Revoke to switch API access off. Requests with the old key return
401. - While your plan isn't Elite you can revoke your key but not rotate it or generate a new one.
- If you leave a team, or are removed from one, your key is revoked automatically. Generate a new one afterwards if you still need it.