Skip to article

Core concepts

Authentication

How API keys, scopes and tenant headers work together on every request.

Every request is authenticated with a key that is scoped to a single tenant. This page is a placeholder for that contract.

The API key#

Send the key as a bearer token. Keys are per tenant and per environment, so a staging key can never read production data.

GET /v1/customers HTTP/1.1
Host: api.verlix.example
Authorization: Bearer vx_live_...

Never ship a live key

A key in a browser bundle is a public key. Proxy requests through your own backend and keep the key server-side.

Scopes#

ScopeGrants
customers:readRead customer records
customers:writeCreate and update customers
invoices:readRead invoices and credit notes
invoices:writeIssue, void and send invoices

Choosing scopes#

Grant the narrowest scope that lets the integration work. A read-only reporting job should never carry a write scope, because a bug in that job would then be able to mutate billing data.

Verify a key#

GET/v1/auth/whoami

Returns the tenant, environment and scopes for the presented key.

FieldTypeNotes
tenantIdstringThe tenant the key belongs to
environmentstringlive or test
scopesstring[]The granted scopes
curl -H "Authorization: Bearer $VERLIX_API_KEY" \
  https://api.verlix.example/v1/auth/whoami

Rotating a key#

  1. Create the replacement

    Issue a new key with the same scopes. Both keys work while you migrate.

  2. Deploy the new key

    Roll the new value out to every service that calls the API.

  3. Revoke the old key

    Revoke the previous key once traffic has moved. Revocation takes effect within seconds.