Authentication
Phone OTP, email, Google & Apple OAuth with JWT tokens
Overview
ETERA uses JWT Bearer tokens for API authentication. Tokens are obtained through one of several authentication methods, then passed in the Authorization header on every request.
Choose Your Auth Method
Phone OTP
Email OTP
Google OAuth
Apple OAuth
Best for mobile apps. 3-step flow using SMS verification.
Phone numbers use the number without country code in phoneNumber and the calling code with + prefix in countryCode. Example: UAE +971 58 959 5029 becomes phoneNumber: "589595029", countryCode: "+971".
Using Your Token
Once authenticated, include the JWT in all API requests:
Get Current User
Retrieve the authenticated user’s profile:
Security Schemes
Bearer Auth (JWT)
Used by most client-facing endpoints. Obtained through any of the authentication flows above.
Admin Secret (API Key)
Used for admin-only operations. Passed as a header value.
Rate Limits
JWT tokens are stateless — store them securely on the client. Never expose tokens in URLs, localStorage on shared devices, or version control.
