API keys and scopes
API keys let your own scripts, dashboards and automations call the REST API as your organisation. Every key belongs to one organisation, carries a list of scopes, and records when it was last used.
Create a key
- Go to Settings › API & webhooks and choose Create key. Only owners and admins can manage keys.
- Name the key after what will use it, for example "Grafana dashboard" or "Zapier – Northwind".
- Choose Read only or Read and write.
- Copy the key. It starts with
fv_live_and is shown once. FormVigilant stores only a hash of it, so a lost key cannot be recovered, only replaced.
Use it as a bearer token:
curl https://api.formvigilant.com/v1/sites \
-H "Authorization: Bearer fv_live_…"
Scopes
A key can do only what its scopes list. The dashboard offers two presets:
| Preset | Scopes | Typical use |
|---|---|---|
| Read only | sites:read, monitors:read, runs:read, incidents:read | Dashboards, reporting, uptime exports |
| Read and write | the above plus monitors:write, runs:trigger | Creating monitors after a site launch, running a test after a deploy |
Through the API itself (POST /v1/api-keys, from a signed-in session) you can choose any scope from the permission list, such as incidents:write to acknowledge incidents from your own tooling or reports:write to generate reports. Two rules apply:
- You cannot grant what you do not have. A key's scopes must be within the creating user's own role; asking for more returns
422with the scopes that were refused. - A key with no scopes is read-only, with the same read access as a Viewer.
A request outside the key's scopes returns 403. Resources that belong to another organisation always return 404.
What keys cannot do
Some actions need a person, not a key, and return 403 "This endpoint needs a signed-in user" when called with one:
- creating or changing API keys;
- any billing change: checkout, plan changes, add-ons, cancelling or resuming;
- configuring SAML single sign-on;
- installing the Slack app.
Rate limits
Each key may make 600 requests per minute. Over that, the API returns 429 with a Retry-After header and the message "Too many requests, retry in N s". Signed-in browser sessions have their own, separate allowance, so a busy script does not slow down your dashboard.
Rotate and revoke
To rotate a key, create the new one, deploy it, then Revoke the old one. Revoking takes effect on the next request; the old key then gets 401 Invalid API key.
Creating and revoking a key are both written to the organisation's audit log with the person who did it.
Good practice
- One key per integration, so you can revoke one without breaking the others.
- Prefer read-only keys. Few integrations need to write.
- Keep keys out of client-side code and public repositories. A key acts for your whole organisation, across every client's sites.
- Check last used before revoking an old key you think is unused.
Related
- REST API v1 for endpoints and conventions.
- Webhooks to have FormVigilant push events to you instead of polling.