-
Notifications
You must be signed in to change notification settings - Fork 0
Authentication
Christian KASSE edited this page Apr 2, 2026
·
1 revision
The Essabu SDK uses API keys for authentication. API keys are prefixed to indicate their environment:
| Prefix | Environment | Description |
|---|---|---|
esa_live_ |
Production | Live data, real transactions |
esa_test_ |
Sandbox | Test data, safe for testing |
- Log in to the Essabu Dashboard
- Navigate to Settings > API Keys
- Click Create API Key
- Copy the key immediately -- it will only be displayed once
from essabu import Essabu
client = Essabu(api_key="esa_live_abc123", tenant_id="your-tenant")export ESSABU_API_KEY=esa_live_abc123
export ESSABU_TENANT_ID=your-tenantclient = Essabu() # reads from environmentYou can manage API keys programmatically through the Identity module:
# List all API keys
keys = client.identity.api_keys.list()
# Create a new API key
key = client.identity.api_keys.create(
name="CI/CD Pipeline",
scopes=["read", "write"],
)
print(key["api_key"]) # Save this -- shown only once
# Delete an API key
client.identity.api_keys.delete("key-uuid")Every request includes a tenant_id to route to the correct tenant:
# Access tenant A
client_a = Essabu(api_key="esa_live_xxx", tenant_id="tenant-a")
# Access tenant B
client_b = Essabu(api_key="esa_live_xxx", tenant_id="tenant-b")If authentication fails, an AuthenticationError is raised:
from essabu.common.exceptions import AuthenticationError
try:
client = Essabu(api_key="invalid-key", tenant_id="tenant")
client.hr.employees.list()
except AuthenticationError:
print("Invalid API key or expired token")- Never hardcode API keys in source code -- use environment variables or secret managers
- Rotate keys regularly via the dashboard or API
- Use scoped keys with minimal permissions for each service
-
Use test keys (
esa_test_) in development and CI environments -
Store keys securely in tools like AWS Secrets Manager, HashiCorp Vault, or
.envfiles excluded from version control
Getting Started
Core Concepts
Modules
Advanced