telentir-web/app/api/auth (plus
/api/api-keys). They emit JSON responses and expect either a bearer token or
the token HTTP-only cookie.
All sensitive responses (
token, apiKey.key) are only returned once. Store
them securely and send them back via Authorization: Bearer <token>.Session status
GET /api/auth
Returns the currently authenticated user (if any) and whether additional steps
are required.
When
status is "phone_not_verified" or "2fa_required", the token field
returned by the relevant endpoints still authenticates API calls, but guarded
routes (e.g. "requirePhoneVerification": true) will fail until the extra step
is completed.
Email & password
POST /api/auth/register
Body:
Response:
{ status: "phone_not_verified", token: string }.
POST /api/auth/login
Body: { email: string, password: string, remember: boolean }.
Possible responses:
{ status: "ok", token: string }(2FA not configured){ status: "phone_not_verified", token: string }{ status: "2fa_required", token: string }(TOTP challenge needed){ status: "error", message: string }
token cookie; include the token as a
bearer header for API clients.
GET /api/auth/logout
Clears the session cookie and returns { status: "logout" }.
Phone verification (SMS)
Telentir requires verified phone numbers before granting access to data-plane routes (objectAuth).
POST /api/auth/verify/request(no body) – sends a 6-digit SMS code.POST /api/auth/verify/submitwith{ code: string }– validates the code and refreshes the auth token. On successstatusbecomes"ok".
requirePhoneVerification is set
to false so you can complete the process even if you are not yet verified.
Password reset
POST /api/auth/reset-password/requestwith{ email: string, returnUrl?: string }– sends an email with a short-lived token.POST /api/auth/reset-password/submitwith{ token: string, password: string, confirmPassword: string }– sets the new password and logs the user in (a new JWT is returned and written to the cookie).
Time-based one-time passwords (2FA)
All TOTP endpoints require the user to be phone-verified.
Missing or invalid codes return HTTP 400 with an error string.
External identity providers
The/api/auth/external tree supports OAuth-based sign-in. The exact providers
are stored in auth/external/providers.
GET /api/auth/external/providers– returns enabled provider slugs.GET /api/auth/external/{provider}– metadata about the provider.GET /api/auth/external/{provider}/init?returnTo=<url>– returns the authorization URL to redirect the browser to.GET /api/auth/external/{provider}/redirect– callback endpoint (Telentir handles this; you shouldn’t call it manually).GET /api/auth/external/register/{token}– completes the signup/attach flow after an OAuth provider redirects back with a registration token.
{ status, token } payload
as the email/password flow, so the downstream experience is identical.
API keys
Server-to-server integrations should mint API keys and send them as bearer tokens. A key inherits the workspace permissions and bypasses short-lived JWTs.
Example (create + use):
/api/api-keys.
