Overview
API keys are managed via the Lev web app or the /build/api-keys REST endpoints. Keys are tied to the authenticated user's account and inherit their permissions.
- Keys are prefixed with
lev_sk_for identification - The full key value is only shown once at creation — store it immediately
- Revoked keys take effect immediately
- Each account has a maximum number of allowed keys (visible via
GET /me)
Creating Keys via the Lev Web App
The fastest way to create an API key is through the Lev settings page at app.lev.com.
You must be a workspace admin to manage API keys. The feature must be enabled for your account.
To create a key:
- Sign in to app.lev.com
- Click your name at the bottom of the sidebar, then click Settings
- Select the API Keys tab
- Click the Create key button
- Enter a descriptive label (e.g., "Production Sync" or "CI Pipeline") and click Create
- Copy your key immediately — click the copy icon next to the key. It will only be shown once
- Click Done
The full API key is only displayed once at creation time. If you lose it, you'll need to revoke the key and create a new one.
To revoke a key:
- Go to Settings → API Keys (same navigation as above)
- Find the key in the list and click the trash icon
- Confirm by clicking Revoke key — access is revoked immediately
Create Key (API)
/api/external/v2/build/api-keysCreate a new API key for the authenticated user
Response (201):
{
"request_id": "...",
"timestamp": "2026-03-20T15:30:45Z",
"data": {
"id": 42,
"label": "CI Pipeline Key",
"key_prefix": "lev_sk_abc1",
"api_key": "lev_sk_abc123def456ghi789...",
"created_at": "2026-03-20T15:30:45Z"
}
}Warning: The
api_keyfield is only included in the creation response. Store it securely.
List Keys (API)
/api/external/v2/build/api-keysList all API keys for the authenticated user
Response (200):
{
"request_id": "...",
"timestamp": "2026-03-20T15:30:45Z",
"data": [
{
"id": 42,
"label": "CI Pipeline Key",
"key_prefix": "lev_sk_abc1",
"created_at": "2026-03-20T15:30:45Z",
"last_used_at": "2026-03-19T12:00:00Z"
}
],
"pagination": {
"total": 3,
"limit": 50,
"offset": 0,
"has_more": false
}
}Note: The full key value is never returned in list responses — only the
key_prefix.
Revoke Key (API)
/api/external/v2/api-keys/{key_id}Permanently revoke an API key
Response (200):
{
"request_id": "...",
"timestamp": "2026-03-20T15:30:45Z",
"data": {
"deleted": true
}
}Revoked keys are immediately invalidated. Any request using a revoked key will receive a 401 Unauthorized response.