API Keys

API Keys

API keys provide programmatic access to the Nagovori API without requiring OAuth2 flows.

Creating a Key

Via Dashboard

  1. Go to your Profile
  2. Scroll to API Keys
  3. Enter a descriptive name and click Create key
  4. Copy the key immediately — it won't be shown again

Via API

curl -X POST https://api.nagovori.ru/v1/api-keys \
  -H "Authorization: Bearer YOUR_JWT_OR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Production Server" }'

Response:

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Production Server",
  "prefix": "nag_a1b2",
  "key": "nag_a1b2c3d4e5f67890abcdef1234567890",
  "scopes": [],
  "created_at": "2026-04-20T10:00:00Z"
}

Listing Keys

curl https://api.nagovori.ru/v1/api-keys \
  -H "Authorization: Bearer YOUR_API_KEY"

Response:

{
  "keys": [
    {
      "id": "...",
      "name": "Production Server",
      "prefix": "nag_a1b2",
      "scopes": [],
      "last_used_at": "2026-04-19T15:30:00Z",
      "created_at": "2026-04-10T10:00:00Z"
    }
  ]
}

Revoking a Key

curl -X DELETE https://api.nagovori.ru/v1/api-keys/KEY_ID \
  -H "Authorization: Bearer YOUR_API_KEY"

Revoked keys are immediately invalidated and cannot be un-revoked. Create a new key if needed.

Key Format

All API keys follow the format:

nag_[32 hex characters]

Example: nag_a1b2c3d4e5f67890abcdef1234567890

The nag_ prefix makes it easy to identify Nagovori keys in your code and scan for accidental exposure.