Veya
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

  1. Log in to app.veya.cloud
  2. Go to Settings > API Keys
  3. Click Generate New Key
  4. Give your key a name (e.g., "Production", "Development")
  5. 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_KEY

Example 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

  1. Never expose keys in client-side code - API keys should only be used server-side
  2. Use environment variables - Don't hardcode keys
  3. Rotate keys regularly - Generate new keys periodically
  4. Use separate keys - Different keys for dev/staging/production
  5. Revoke compromised keys - Immediately revoke if exposed

Revoking Keys

If your key is compromised:

  1. Go to Settings > API Keys
  2. Find the compromised key
  3. Click Revoke
  4. Generate a new key
  5. 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"
  }
}