Authentication
epilot APIs use bearer tokens for authentication. All requests must include a valid token in the Authorization header:
Authorization: Bearer <your-token>
Getting Startedโ
The recommended way to authenticate with epilot APIs is using Access Tokens โ long-lived, scoped tokens designed for integrations.
- Go to Settings > Access Tokens in the epilot portal
- Create a new token, optionally scoping it to specific roles
- Pass the token as a bearer token in your API requests
import { getClient } from '@epilot/entity-client';
const entityClient = getClient();
entityClient.defaults.headers['Authorization'] = 'Bearer <your-access-token>';
See Access Tokens for full details on creating, scoping and revoking tokens.
How It Worksโ
epilot authentication is built on OAuth 2.0 with Amazon Cognito User Pools as the identity provider. Each epilot tenant has its own Cognito User Pool.
When a user logs in to the epilot portal, Cognito issues short-lived OAuth tokens (60 min). For API integrations, the Access Token service issues long-lived JWTs with claims compatible with Cognito tokens, so all epilot APIs accept them seamlessly.
All tokens are verified by the API Gateway authorizer using JWKS endpoints before reaching backend services.
Token Typesโ
| Token | Lifetime | Use case |
|---|---|---|
| Access Token | Long-lived | Server-side API integrations, scripts, third-party apps |
| OAuth 2.0 Token | 60 minutes | Interactive user sessions in the epilot portal |
| Publishable Token | Long-lived | Client-side public apps (journeys, portals) |
For most integrations, Access Tokens are the right choice. See Token Types for a full comparison.
See Alsoโ
- Access Tokens โ creating and managing scoped tokens
- Token Types โ comparison of all epilot token types
- Authorization โ how API requests are authorized
- Permissions โ role-based access control and grants
- Multi-Factor Authentication -- TOTP and SMS second factor
- Passwordless Login -- email-based sign-in links
- Passkeys -- phishing-resistant biometric and hardware key authentication
- SSO โ single sign-on with OIDC and SAML