Skip to content
VaultLens Studio

API keys for agents

Most people connect an AI app by signing in, as described in the setup guides. Some agents run on their own, with no person to sign in: a scheduled job, a server-side agent, or a test suite. These can send a VaultLens API key instead.

Create a key

Only owners and admins can create API keys.

  1. In VaultLens, go to Settings → API keys and click Create key.
  2. Enter a Name that says what uses it, for example “Nightly report agent”.
  3. Under Scopes, tick only what the agent needs. The scopes are the same permissions as for AI connections. See Tools for which tool needs which.
  4. Under Apps, keep All apps, including ones connected later, or untick it and choose apps.
  5. Choose when the key Expires. In HIPAA workspaces keys must expire within 1 year.
  6. Optionally, fill in Only from these IP addresses to limit where the key can be used.
  7. Click Create key, copy the key, then click I’ve copied it. The key starts with vls_. VaultLens shows it only once.

See Getting started with the API for more about keys.

Use the key

Send the key as a bearer token to the MCP server address:

URL:     https://mcp.vaultlens.studio/mcp
Header:  Authorization: Bearer vls_…

For example, in an MCP client config that supports headers:

{
  "mcpServers": {
    "vaultlens": {
      "url": "https://mcp.vaultlens.studio/mcp",
      "headers": { "Authorization": "Bearer vls_…" }
    }
  }
}

The server is stateless: send every request with POST. There is no sign-in step.

How a key behaves

  • Admin access, narrowed by scopes. A key acts with an admin’s access, limited to its scopes and apps. Unlike a member’s sign-in, a key with Query data can read record values.
  • Tied to its creator. If the person who created the key is removed or is no longer an owner or admin, the key stops working.
  • Workspace controls still apply. If an admin turns off Allow AI connections, key calls to the MCP server are refused too. Read-only and Apps AI can see also apply.
  • HIPAA. In a HIPAA workspace, query_data needs the Read PHI scope on the key and the owner’s BAA confirmation. See HIPAA workspaces.
  • Limits. Calls count against your plan’s per-minute limit: 60 a minute on Analytics and Archive, 120 on Studio, 300 on Business. Each key has its own count.
  • Audited. Every tool call is in the audit log, marked as made with an API key.

Keep keys safe

  • Store keys in a secret manager or environment variable, not in code or chat.
  • Give each agent its own key with the fewest scopes it needs.
  • Set an expiry, and use Rotate in Settings → API keys to replace a key regularly.
  • Click Revoke next to a key as soon as you no longer need it.

The same key also works with the REST API.