Skip to content

Authentication

Veza APIs require an access token, which you can generate from Administration > API Keys

You can call Veza APIs using API keys for authentication. Each API Key inherits the permissions of the user who created it, and functions as a personal access token for that user. The Administration > API Keys page allows individual users to manage their own keys. Only Veza administrators can view keys belonging to other users.

Create an API key

To generate a key associated with your user account:

  1. Open Administration > API Keys > Add New API Key.
  2. Enter a descriptive name for the new key, and click Save.
  3. Copy and save the value, which will only appear once.

Using API keys

When making requests to Veza APIs, provide the key as an OAuth 2.0 Bearer Token in the request Authorization header:

bash
curl -X GET 'https://<url>/api/v1/providers/custom' \
-H 'authorization: Bearer <token>'

You should protect and secure API Keys, which have all the permissions associated with your username and password. Save keys as environment variables or use a secrets manager instead of including them in scripts, for example:

python
import os
import requests

url = os.environ.get('VEZA_API_URL')
access_token = os.environ.get('VEZA_API_KEY')

headers = {
    'authorization': f'Bearer {access_token}'
}

response = requests.get(url, headers=headers)

print(response.json())

Troubleshooting

If you encounter authentication errors, confirm that the key is valid and generate a new key if required. API key errors are:

  • Invalid API key: API key is not the correct format (not base64 encoded)
  • Malformed API key: Typically due to a copy and paste error (correct format but invalid characters)