Skip to content

Authentication

All Veriglob API endpoints require authentication. This guide covers the available authentication methods and how to implement them in your applications.

Include your API key in the Authorization header using the Bearer scheme:

Terminal window
curl -X GET "https://api.veriglob.com/v1/did/did:key:z6Mk..." \
-H "Authorization: Bearer your-api-key-here"

Alternatively, use the X-API-Key header:

Terminal window
curl -X GET "https://api.veriglob.com/v1/did/did:key:z6Mk..." \
-H "X-API-Key: your-api-key-here"

Create a new API key using the API Keys endpoint:

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": "My Application Key"
}'

Response:

{
"status": "success",
"message": "API key generated successfully",
"data": {
"key_id": "key_abc123",
"api_key": "vg_live_xxxxxxxxxxxxxxxxxxxx",
"name": "My Application Key",
"tier": "free",
"created_at": "2024-01-15T10:30:00Z"
}
}

Rate limits are enforced based on your subscription tier:

TierRequests per Minute
Free10
Basic100
Pro1,000
Enterprise10,000

All API responses include rate limit information in the headers:

HeaderDescription
X-RateLimit-LimitMaximum requests per minute for your tier
X-RateLimit-RemainingRemaining requests in current window
X-RateLimit-ResetUnix timestamp when the 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. Please wait before making more requests."
}

Returned when the API key is missing or invalid:

{
"status": "error",
"message": "Unauthorized",
"error": "Invalid or missing API key"
}

Returned when the API key doesn’t have permission for the requested resource:

{
"status": "error",
"message": "Forbidden",
"error": "Your API key does not have access to this resource"
}
  1. Never expose API keys in client-side code - Always make API calls from your server
  2. Use environment variables - Store API keys in environment variables, not in code
  3. Rotate keys regularly - Generate new keys periodically and revoke old ones
  4. Use minimal permissions - Request only the access level you need
  5. Monitor usage - Regularly check your API usage for unusual patterns
const response = await fetch('https://api.veriglob.com/v1/did', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VERIGLOB_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const data = await response.json();
import requests
import os
headers = {
'Authorization': f'Bearer {os.environ["VERIGLOB_API_KEY"]}',
'Content-Type': 'application/json'
}
response = requests.post(
'https://api.veriglob.com/v1/did',
headers=headers,
json={}
)
data = response.json()
req, _ := http.NewRequest("POST", "https://api.veriglob.com/v1/did", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIGLOB_API_KEY"))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)