Skip to content

API keys

API keys let scripts, CI jobs, and AI assistants call the Varman API and the MCP server. Each key belongs to one organization and carries its own set of scopes.

Owners and Admins can manage keys. Other roles need the API Keys permission (see Roles and permissions).

  1. Click the Settings icon next to your name at the bottom of the sidebar, then open API Keys.
  2. Click Add API Key.
  3. Enter a Name that says where the key is used, for example ci-evidence-upload.
  4. Pick an Expiration: Never, 30 days, 90 days, or 1 year.
  5. Under Permissions, choose a preset:
    • Full Access grants every scope available to API keys.
    • Read Only grants only the read scope of every resource.
    • Custom shows every resource so you can tick individual scopes. Ticking a box on any preset switches to Custom.
  6. Click Create.
  7. Copy the key from the API Key Created panel, then click Done.

Keys start with comp_. The panel also shows a sample curl request and a link to the API reference for trying requests with the new key.

Send the key in the X-API-Key header. Authorization: Bearer <key> also works.

Terminal window
curl https://api.varman.io/v1/organization \
-H "X-API-Key: $VARMAN_API_KEY"

A request outside the key’s scopes returns 403. See the API overview for scopes, errors, and rate limits.

Scopes have the form resource:action, for example policy:read or risk:update. A key needs at least one scope. The Access column in the keys table shows how many scopes a key has; click the badge to see them grouped by resource.

The keys table lists each active key with its Name, Access, Created date, Expires date, and Last Used date. Use Search API keys… to filter by name. An expired key stops working on its expiry date.

There is no in-place rotation. To rotate a key:

  1. Create a new key with the same scopes.
  2. Update every script or tool that uses the old key.
  3. Check that the old key’s Last Used date stops changing.
  4. Revoke the old key.
  1. Open Settings, then API Keys.
  2. Open the menu on the key’s row and choose Revoke.
  3. Confirm with Revoke in the Revoke API Key dialog.

Revoking is permanent. Requests with that key fail with 401 straight away.

Keys created before scopes existed show a Full Access (Legacy) badge, and the page shows a banner while any remain. The API rejects these keys with 403 and the message This API key is no longer supported. Create a scoped key to replace each one, then revoke the legacy key.