API keys

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

Every non-human access path into AssetLab - the REST API, AI assistants over MCP, BI pipelines, scripts - authenticates with an API key. One credential type, one management screen, one revocation story.

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.