Skip to Content
APIAuthentication

Authentication

The Avala API uses API keys for authentication. Include your API key in the X-Avala-Api-Key header with every request.

Creating API Keys

  1. Log in to Mission Control 
  2. Click your profile → Settings
  3. Navigate to Security & IdentityAPI Keys
  4. Click Create API Key
  5. Enter a name for the key (e.g., “Production Server”)
  6. Optionally set an expiration date
  7. Click Create
  8. Copy and securely store the key

API keys are shown only once when created. Store them securely and never commit them to version control.

Using API Keys

Include the key in the X-Avala-Api-Key header:

curl https://server.avala.ai/api/v1/datasets/johndoe/list/ \ -H "X-Avala-Api-Key: your-api-key"

Managing API Keys

List Keys

View all your API keys in Mission Control under SettingsAPI Keys.

Each key shows:

  • Name
  • Creation date
  • Expiration date (if set)
  • Last used date

Delete Keys

  1. Go to SettingsAPI Keys
  2. Find the key to delete
  3. Click the delete icon
  4. Confirm deletion

Deleting an API key immediately revokes access. Any applications using that key will stop working.

Key Expiration

API keys can have an optional expiration date:

  • Keys without expiration never expire
  • Expired keys return 401 Unauthorized
  • Set expiration for temporary or contractor access

Best Practices

Security

  • Never commit keys to version control
  • Use environment variables to store keys
  • Rotate keys periodically
  • Use separate keys for different environments (dev, staging, prod)

Environment Variables

# Set in your shell export AVALA_API_KEY="your-api-key"
import os API_KEY = os.environ.get("AVALA_API_KEY")

Key Rotation

  1. Create a new API key
  2. Update your applications to use the new key
  3. Verify the new key works
  4. Delete the old key

Error Responses

Invalid Key

{ "detail": "Invalid API key." }

HTTP Status: 401 Unauthorized

Expired Key

{ "detail": "API key has expired." }

HTTP Status: 401 Unauthorized

Missing Key

{ "detail": "Authentication credentials were not provided." }

HTTP Status: 401 Unauthorized

Next Steps

Last updated on