Documentation

API Keys & Tokens

Overview

An API key lets a script, the Veltrix CLI, a CI/CD job or an AI assistant act on your organization without a person signing in. Every key belongs to one organization and is bound to an RBAC role: the key can do exactly what that role allows, and nothing else. A key without a role is rejected (fail-closed).

Role design, the permission matrix and single sign-on are covered in Access Control & Single Sign-On. This page covers the keys themselves.

Where to Find It

  • Portal: Govern → Settings → Keys & Tokens, route /settings/keys-token. The page title is “API Keys & Tokens”.
  • Permission: apiKey:read to list keys, apiKey:write to create or delete them. Without apiKey:write the Create New Key button and the Delete action are hidden.
  • Plan: creating and using keys is available on every plan. Connecting an AI assistant over MCP needs a paid plan; see MCP and AI assistants.

Create a Key

  1. Open Settings → Keys & Tokens and select Create New Key.
  2. Enter a Key Name (3–64 characters, for example “Production API Key”).
  3. Choose a Key Type: API Key or Admin Key.
  4. Choose the Access Role (required). The key inherits that role's permissions.
  5. Choose an Expiration: Never, 30 days, 90 days, 180 days, or 1 year.
  6. Select Create Key.
  7. Copy the key from the New Key Created panel, store it somewhere safe, then select Done.
The full key is shown once. Veltrix stores only a one-way hash and a short display prefix, so the key cannot be retrieved later. If you lose it, create a new key and delete the old one.
SettingOptions and rules
Key NameRequired, 3–64 characters.
Key TypeAPI Key or Admin Key in the portal. A third type, webhook, exists for inbound webhook delivery (see Webhook keys) and appears in the list but is not offered in the create form. The type is a label; what a key can do comes from its role.
Access RoleRequired. Must be a role in your own organization. You can only bind a key to a role whose permissions you hold yourself; otherwise creation is refused with an explanation of the missing permissions.
ExpirationNever, 30, 90, 180 or 365 days from creation.

Keys are vltx_ followed by 43 random characters, so a leaked key is easy for secret scanners to recognise.

The Key List

ColumnMeaning
NameThe name you gave the key.
TypeAdmin, API or Webhook badge.
RoleThe role the key is bound to.
KeyA masked value: the non-secret prefix (for example vltx_ab12cd) followed by dots. Use it to tell keys apart.
Created / Last UsedTimestamps. Last Used shows “Never” until the key authenticates a request.
ExpiresThe expiry date, or “Never”.
ActionsDelete (with apiKey:write).

If the list cannot load you get an error with a Retry link. An empty list says “No API keys found”.

Delete a key

Select Delete and confirm. Deleting is permanent and cannot be undone; anything still using the key starts failing with 401 immediately.

Using a Key

Send the key in the X-API-Key header (preferred) or as Authorization: ApiKey <key>:

curl https://app.veltrixsecops.com/api/configuration-canvas \
              -H "X-API-Key: vltx_..."
  • The CLI stores a key with veltrix login; see CLI Reference.
  • Requests made with a key run as your organization's non-loginable API Integration identity, so changes made by automation or AI are distinguishable from changes made by people in the audit history.
  • A key never carries platform-operator authority, and it can only reach routes that accept API keys. Key management itself (/api/api-keys) needs a signed-in session — one key cannot create or delete other keys. The only exception is a key rotating itself (see Rotation).
  • Quotas, approvals and plan gating apply to key-driven requests exactly as they do to people. See Plans, Limits & Trial.

Expiry

An expired key stops authenticating. The status reported by the API is one of active, expiring_soon, expired or revoked; a key is expiring soon within 30 days of its expiry date. Each day a background job closes lapsed rotation overlaps and evaluates keys against 30, 14, 7 and 1-day thresholds.

Do not rely on a reminder reaching you: set your own calendar reminder or watch the Expires column, and prefer a finite expiration for any key that leaves your control (CI systems, contractors, AI tooling).

Rotation (API)

Rotation lets you replace a key's secret without a hard cut-over. It is exposed through the API only; there is no rotate button in the portal. All paths are under /api.

CallWhat it does
POST /api-keys/:id/rotateIssue a new secret for the key and return it once. The previous secret keeps working for the grace window. Optional reason (up to 256 characters) is recorded in the audit trail. Needs a session with apiKey:write.
PUT /api-keys/:id/auto-rotationEnable or disable scheduled rotation. intervalDays 1–3650 (default 90), graceDays 0–90 (default 7). Enabling on a key with no expiry gives it one.
GET /api-keys/rotation/statusExpiry and rotation status for the organization's keys.
GET /api-keys/:id/rotation-historyWho rotated the key, when, and why.
POST /api-keys/self/rotateA key rotates itself (for integrations). Allowed only for keys enrolled in scheduled rotation, and it cannot extend the key's life beyond its existing schedule.
GET /api-keys/selfReturns { valid, expiresAt } for the calling key.
POST /api-keys/:id/regenerate, POST /api-keys/:id/revoke, PUT /api-keys/:idRegenerate a key, revoke it, or update its name, expiry or scopes.

Key-management calls are refused while a platform operator is impersonating your session.

MCP and AI Assistants

AI assistants authenticate with an ordinary role-bound key. Bind it to the narrowest role the assistant needs (a read-only role means it cannot draft anything). MCP access is a paid-plan capability: tenants on the free plan are told to upgrade before connecting AI tooling. Full setup is in MCP Server, and the governance model is in AI Guardrails.

Webhooks and Webhook Keys

Veltrix accepts inbound webhook deliveries from external systems (for example CI or GitHub). There is no portal screen for webhooks; the only thing you manage in the portal is the key they authenticate with.

  • Endpoints: POST /api/webhooks (generic), POST /api/webhooks/github and GET /api/webhooks/health.
  • Authentication: the sender supplies an X-API-Key. The key must be of type webhook or carry a webhooks:write scope. The organization is taken from the key, never from the payload.
  • Generic delivery: a JSON body with source, event and payload (and optionally timestamp and metadata).
  • GitHub delivery: in addition to the key, the request must carry a valid X-Hub-Signature-256 HMAC signature; a missing or invalid signature is rejected with 401. Deliveries are replay-protected by delivery ID and timestamp freshness.

Webhook keys are created through the API (type webhook), then appear in the Keys & Tokens list with a Webhook badge. See REST API Reference for request details.

Billing Gate and Gotchas

  • Key creation is billing-gated. Like other write routes, creating, rotating or deleting keys returns 402 (“Your trial has ended”) when an engaged tenant's trial has lapsed with no card on file. Reading stays open. See Plans, Limits & Trial.
  • Deleting is final. There is no undo and no recovery of the secret.
  • Legacy keys: a key created before role binding existed is denied until you issue a replacement with an explicit role.
  • Least privilege: an Admin Key type does not widen permissions on its own; widen the role, deliberately.