Skip to main content

API Key Authentication

All API requests require authentication using an API key. Include your key in the x-api-key header:
x-api-key: YOUR_API_KEY

Getting Your API Key

  1. Log in to your dashboard at lupitor.acrely.ai
  2. Navigate to API Keys in your company settings
  3. Click Create API Key
  4. Choose a scope and give it a descriptive name
  5. Copy your key immediately (it won’t be shown again!)
Never share your API keys or commit them to version control. Treat them like passwords.

API Key Scopes

API keys have different permission levels:

Read

Read-only access
  • List leads
  • View conversations
  • Get analytics

Write

Full access
  • Create leads
  • Update campaigns
  • All read operations
Write scope automatically includes Read access. You don’t need separate keys.

Campaign Scoping

API keys can be scoped to specific campaigns or have company-wide access:

Company-Wide Access

{
  "scope": "write",
  "campaignId": null  // Access all campaigns
}

Campaign-Specific Access

{
  "scope": "write",
  "campaignId": "k978..."  // Only this campaign
}

Example Request

curl https://lupitor.acrely.ai/api/v1/leads?campaignId=k978... \
  -H "x-api-key: sk_test_abc123xyz"

Security Best Practices

  • Use environment variables
  • Never hardcode in source code
  • Use secret management tools (e.g., AWS Secrets Manager, 1Password)
  • Rotate keys periodically
  • Immediately revoke compromised keys
  • Create new keys before deleting old ones
  • Use read-only keys where possible
  • Scope to specific campaigns when appropriate
  • Create separate keys for different environments
  • Review API logs regularly
  • Set up alerts for unusual activity
  • Track which keys are being used

Error Responses

Missing API Key

{
  "success": false,
  "data": null,
  "error": "Missing API key"
}
HTTP Status: 401 Unauthorized

Invalid API Key

{
  "success": false,
  "data": null,
  "error": "Invalid or inactive API key"
}
HTTP Status: 401 Unauthorized

Insufficient Permissions

{
  "success": false,
  "data": null,
  "error": "Insufficient permissions"
}
HTTP Status: 403 Forbidden

Need Help?

If you’re having authentication issues:
  • Verify your API key is correct
  • Check that the key hasn’t been revoked
  • Ensure you’re using the correct scope
  • Contact support at info@acrely.ai