API keys

Scoped, tenant-bound, expiring keys - the single credential type behind the REST API, MCP, and every integration.

Integrations reach AssetLab with an API key: the REST API, BI pipelines, scripts, and AI assistants that cannot sign in, such as a Microsoft Copilot agent. Claude and ChatGPT connect by signing in with an AssetLab account instead, and need no key - see Connect Claude.

Creating a key

Settings → API Keys → New key (Administrator only):

  1. Name it for its purpose - "Power BI nightly", "Claude - Maria", "Migration script (temp)". Names are your audit trail's vocabulary.
  2. Pick scopes - per-resource :read and :write, organized by category with bulk toggles, or *:* for full access. Full list: Scopes reference. Enabling the users:read scope raises a privacy confirmation first - it exposes member names and emails to whatever holds the key.
  3. Set expiry - required; defaults to 90 days, maximum 365. Expiry is a feature: forgotten integrations die on their own instead of living forever.
  4. Copy the key - al_live_... is displayed once. AssetLab stores only a hash; there is no "show me again."

Properties worth understanding

Using a key

curl -H "Authorization: Bearer al_live_xxxxx" \
  "https://<api-base>/v1/assets?per_page=10"

The API Keys screen shows the MCP server URL (https://mcp.assetlab.ca) for connecting AI assistants; the REST base URL and request details are in REST API basics. For AI assistants, the key is pasted once during connector authorization.

Lifecycle discipline

HabitWhy
One key per consumerRevoking Power BI shouldn't break Claude
Least scopeA dashboard needs :read; give it :read
Temp keys for temp jobsMigration done → revoke same day
Calendar the expiriesRenewal is planned; expiry-surprise is an outage
Offboarding includes keysRemove the user and revoke their keys (checklist)

If a key leaks

Revoke it immediately (instant, remember), mint a replacement with the same scopes, update the consumer, and skim recent activity for anything unexpected. Because keys are per-consumer and scoped, the blast radius of one leak stays bounded - that's the payoff of the discipline above.

AI assistants

Claude and ChatGPT do not use a key: they sign in with an AssetLab account. Who may connect one, per-person access, every connected assistant and their activity live on their own screen, Settings → AI Assistants. See Security model.

Recent API Activity on this screen lists calls made with keys; select a row to see the record it touched, the fields it sent (kept for 30 days) and why a call failed.