Skip to main content
public preview

These docs are a public preview. The endpoint reference is still firming up as the API host is finalized.

API Keys Management

Inspect the active key. Rotate it on demand.

Get API Key Information

GEThttps://{your-api-host}/orgs/{org_uuid}/api/key

Retrieve information about the API key currently in use.

curl -X GET "https://{your-api-host}/orgs/{org_uuid}/api/key" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response Example

{
  "key_id": "key_abc123",
  "name": "Production API Key",
  "created_at": "2025-01-01T00:00:00Z",
  "last_used_at": "2025-01-10T12:00:00Z",
  "scopes": ["instances:read", "instances:write"]
}

Rotate API Key

POSThttps://{your-api-host}/orgs/{org_uuid}/api/key/rotate

Rotate the API key, invalidating the previous key and generating a new one.

warning

Rotation invalidates the old key immediately. Update your applications with the new key to avoid service interruptions.

curl -X POST "https://{your-api-host}/orgs/{org_uuid}/api/key/rotate" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response Example

{
  "key": "legba_new_api_key_xyz789",
  "key_id": "key_xyz789",
  "created_at": "2025-01-10T12:30:00Z"
}