Skip to content

API Keys

The API Keys endpoints allow you to generate, list, and manage API keys for authentication with tier-based rate limiting.

Creates a new API key for your account.

POST /v1/keys/generate

Requires BearerAuth (session token).

FieldTypeRequiredDescription
namestringYesA descriptive name for the API key
tierstringNoSubscription tier (defaults to account tier)
Terminal window
curl -X POST "https://api.veriglob.com/v1/keys/generate" \
-H "Authorization: Bearer your-session-token" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API Key"
}'

201 Created

{
"status": "success",
"message": "API key generated successfully",
"data": {
"key_id": "key_abc123def456",
"api_key": "vg_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"name": "Production API Key",
"tier": "basic",
"rate_limit": 100,
"created_at": "2024-01-15T10:30:00Z",
"last_used_at": null
}
}
StatusDescription
400Invalid request body
401Invalid or missing session token
403Account key limit reached
429Rate limit exceeded

Returns all API keys associated with your account.

GET /v1/keys

Requires BearerAuth (session token).

Terminal window
curl -X GET "https://api.veriglob.com/v1/keys" \
-H "Authorization: Bearer your-session-token"

200 OK

{
"status": "success",
"message": "API keys retrieved successfully",
"data": {
"keys": [
{
"key_id": "key_abc123def456",
"name": "Production API Key",
"key_prefix": "vg_live_xxxx...xxxx",
"tier": "basic",
"rate_limit": 100,
"created_at": "2024-01-15T10:30:00Z",
"last_used_at": "2024-01-20T14:25:00Z",
"active": true
},
{
"key_id": "key_def789ghi012",
"name": "Development Key",
"key_prefix": "vg_test_xxxx...xxxx",
"tier": "free",
"rate_limit": 10,
"created_at": "2024-01-10T08:00:00Z",
"last_used_at": "2024-01-18T11:30:00Z",
"active": true
}
],
"total": 2
}
}

Returns details for a specific API key.

GET /v1/keys/{key_id}

Requires BearerAuth (session token).

ParameterTypeRequiredDescription
key_idstringYesThe API key ID
Terminal window
curl -X GET "https://api.veriglob.com/v1/keys/key_abc123def456" \
-H "Authorization: Bearer your-session-token"

200 OK

{
"status": "success",
"message": "API key retrieved successfully",
"data": {
"key_id": "key_abc123def456",
"name": "Production API Key",
"key_prefix": "vg_live_xxxx...xxxx",
"tier": "basic",
"rate_limit": 100,
"created_at": "2024-01-15T10:30:00Z",
"last_used_at": "2024-01-20T14:25:00Z",
"active": true,
"usage": {
"requests_today": 245,
"requests_this_month": 4521
}
}
}

Permanently revokes an API key.

DELETE /v1/keys/{key_id}

Requires BearerAuth (session token).

ParameterTypeRequiredDescription
key_idstringYesThe API key ID to revoke
Terminal window
curl -X DELETE "https://api.veriglob.com/v1/keys/key_abc123def456" \
-H "Authorization: Bearer your-session-token"

200 OK

{
"status": "success",
"message": "API key revoked successfully",
"data": {
"key_id": "key_abc123def456",
"revoked_at": "2024-02-01T10:00:00Z"
}
}

Irreversible Action

Revoking an API key is permanent. Any applications using the revoked key will immediately lose access.

StatusDescription
401Invalid or missing session token
404API key not found
429Rate limit exceeded

Updates the name or settings of an API key.

PATCH /v1/keys/{key_id}

Requires BearerAuth (session token).

ParameterTypeRequiredDescription
key_idstringYesThe API key ID to update
FieldTypeRequiredDescription
namestringNoNew name for the API key
Terminal window
curl -X PATCH "https://api.veriglob.com/v1/keys/key_abc123def456" \
-H "Authorization: Bearer your-session-token" \
-H "Content-Type: application/json" \
-d '{
"name": "Renamed Production Key"
}'

200 OK

{
"status": "success",
"message": "API key updated successfully",
"data": {
"key_id": "key_abc123def456",
"name": "Renamed Production Key",
"updated_at": "2024-02-01T10:00:00Z"
}
}

TierRequests/MinuteDescription
free10Free tier for testing and development
basic100Basic tier for small applications
pro1,000Professional tier for production use
enterprise10,000Enterprise tier for high-volume applications

All API responses include rate limit information:

HeaderDescription
X-RateLimit-LimitMaximum requests per minute
X-RateLimit-RemainingRemaining requests in current window
X-RateLimit-ResetUnix timestamp when limit resets

When you exceed your rate limit, you’ll receive a 429 Too Many Requests response:

{
"status": "error",
"message": "Rate limit exceeded",
"error": "You have exceeded your rate limit of 100 requests per minute. Please wait 45 seconds before retrying."
}

Best Practices:

  1. Monitor the X-RateLimit-Remaining header
  2. Implement exponential backoff when approaching limits
  3. Cache responses where appropriate
  4. Batch operations when possible

Veriglob API keys follow these patterns:

EnvironmentPrefixExample
Productionvg_live_vg_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Testvg_test_vg_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx