Skip to main content

API Keys

API keys provide programmatic access to the Ansa API.

Generating a Key

  1. Go to Settings > API in your dashboard
  2. Click Generate API Key
  3. Copy the key immediately - it won’t be shown again

Using API Keys

Include the key in the Authorization header:

Key Permissions

API keys have the same permissions as your account:
  • Access to all your agents
  • Ability to create/update/delete resources
  • Usage counts against your plan limits
Keep your API keys secure. Never expose them in client-side code or public repositories.

Session Authentication

For dashboard and widget authentication, Ansa uses cookie-based sessions:

Sign In

OAuth

Redirect users to:

Widget Authentication

The chat widget uses a separate authentication flow for end-users:

Anonymous Sessions

By default, widget users are anonymous. A session ID is stored in localStorage.

Identified Users

Pass user information to track conversations:
This allows you to:
  • Track conversations by user
  • See user information in the dashboard
  • Build user-aware responses