API Keys

API keys authenticate programmatic access to Rivano. Keys are prefixed with rv_ followed by the scope. The key string is only returned once — at creation time.

GET /api/keys
List all API keys for the current tenant

Returns key metadata only. The key string is never returned after creation.

Parameters:

ParamTypeDescription
limitnumberMax results (default 50)
offsetnumberPagination offset
scopestringFilter by scope: api, agent, ingest

Response (200):

{
  "data": [
    {
      "id": "key_abc123",
      "name": "ci-pipeline",
      "scope": "ingest",
      "prefix": "rv_ingest_abc1",
      "createdBy": "user_xyz789",
      "createdByEmail": "alice@example.com",
      "lastUsedAt": "2026-04-04T09:45:00Z",
      "createdAt": "2026-01-15T10:00:00Z"
    },
    {
      "id": "key_def456",
      "name": "monitoring-script",
      "scope": "agent",
      "prefix": "rv_agent_def4",
      "createdBy": "user_xyz789",
      "createdByEmail": "alice@example.com",
      "lastUsedAt": "2026-04-03T18:20:00Z",
      "createdAt": "2026-02-01T12:00:00Z"
    }
  ],
  "total": 4,
  "limit": 50,
  "offset": 0
}
import Rivano from '@rivano/sdk';
const rivano = new Rivano({ apiKey: process.env.RIVANO_API_KEY! });

const keys = await rivano.keys.list();
keys.data.forEach(k => console.log(k.name, k.scope, k.prefix));
POST /api/keys
Create a new API key

The key field in the response is only returned once. Copy it immediately and store it in your secrets manager. There is no way to retrieve it again — if you lose it, delete the key and create a new one.

Request body:

{
  "name": "production-gateway",
  "scope": "ingest"
}
FieldRequiredDescription
nameYesHuman-readable name for the key
scopeYesapi, agent, or ingest

Response (201):

{
  "data": {
    "id": "key_xyz789",
    "name": "production-gateway",
    "scope": "ingest",
    "key": "rv_ingest_xyz789abcdefghijklmnopqrstuvwxyz1234567890",
    "prefix": "rv_ingest_xyz7",
    "createdBy": "user_abc123",
    "createdAt": "2026-04-04T10:00:00Z"
  }
}

The key field is present only in this creation response. Subsequent GET requests return the prefix field instead.

const result = await rivano.keys.create({
  name: 'production-gateway',
  scope: 'ingest',
});

// Save this — it won't be shown again
const apiKey = result.data.key;
console.log('New key:', apiKey);
DELETE /api/keys/:id
Delete an API key

The key is invalidated immediately. Any service using the deleted key will receive 401 Unauthorized on its next request.

Response (200):

{ "success": true }
await rivano.keys.delete('key_abc123');

Key scopes

ScopePrefixUse case
apirv_api_Admin automation — full read/write to all resources
agentrv_agent_Read-only access to agents and traces
ingestrv_ingest_Gateway proxy — write trace data

Use the least-permissive scope for each use case. Never embed api-scoped keys in application code that runs in production environments.

Key rotation workflow

  1. Create a new key with the same scope and a versioned name (e.g. gateway-v2).
  2. Deploy the new key to your environment.
  3. Monitor for successful requests using the new key (lastUsedAt on the new key should update).
  4. Delete the old key.

The window between step 2 and step 4 is your rotation window — both keys are valid simultaneously.