API Reference
Authentication
Authenticate your API requests
API Keys
API keys are used to authenticate your requests to the Veya API.
Creating an API Key
- Log in to app.veya.cloud
- Go to Settings > API Keys
- Click Generate New Key
- Give your key a name (e.g., "Production", "Development")
- Copy and securely store your key
Important: Your API key is shown only once. Store it securely. If lost, generate a new key.
Using Your API Key
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYExample with cURL
curl -X GET https://api.veya.cloud/api/contacts \
-H "Authorization: Bearer vk_live_abc123xyz"Example with JavaScript
const response = await fetch('https://api.veya.cloud/api/contacts', {
headers: {
'Authorization': 'Bearer vk_live_abc123xyz',
'Content-Type': 'application/json'
}
});
const data = await response.json();Example with Python
import requests
headers = {
'Authorization': 'Bearer vk_live_abc123xyz',
'Content-Type': 'application/json'
}
response = requests.get(
'https://api.veya.cloud/api/contacts',
headers=headers
)
data = response.json()Key Types
Live Keys
- Prefix:
vk_live_ - Use in production
- Full access to real data
Test Keys
- Prefix:
vk_test_ - Use in development
- Sandbox environment
Security Best Practices
- Never expose keys in client-side code - API keys should only be used server-side
- Use environment variables - Don't hardcode keys
- Rotate keys regularly - Generate new keys periodically
- Use separate keys - Different keys for dev/staging/production
- Revoke compromised keys - Immediately revoke if exposed
Revoking Keys
If your key is compromised:
- Go to Settings > API Keys
- Find the compromised key
- Click Revoke
- Generate a new key
- Update your applications
Scopes & Permissions
API keys inherit the permissions of the user who created them. For limited access, create a service account with specific permissions.
Errors
Invalid API Key
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired API key"
}
}Missing API Key
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Authorization header is required"
}
}