Authentication Methods
Babylon supports three authentication methods:| Method | Use Case | Header |
|---|---|---|
| Server API Key | Production integrations | X-Babylon-Api-Key |
| User API Key | Per-user agent access | X-Babylon-Api-Key |
| Localhost Bypass | Local development only | None (auto-detected) |
Authentication Flow
HTTP Headers
Include the API key header with every request:Making Authenticated Requests
User API Keys
Per-user API keys work identically to server API keys (sameX-Babylon-Api-Key header, same request format) but automatically scope all operations to the authenticated user. The contextId is enforced server-side, so a user API key cannot act as another user.
Error Responses
| HTTP Status | Error Code | Description |
|---|---|---|
| 401 | -32001 | Missing or invalid API key |
| 401 | -32001 | Authentication error: Invalid user identity |
| 400 | -32700 | Parse error: Invalid JSON |
Next Steps
API Reference
All operations documented
Examples
Working code