API ReferenceAuthentication APIIntroduction

Authentication API

Aerostack provides a flexible authentication system. All endpoints are under:

/api/v1/public/projects/:projectSlug/auth

Two Sign-in Flows

Your project can support one or both. Configure in Dashboard → Project → Auth:

FlowPassword required?When to useAPI
Password sign-inYesTraditional web apps, forms with email + passwordRegister, Login
Passwordless (OTP)NoModern mobile apps, single-screen sign-in (email/phone → OTP → token)OTP Send, OTP Verify

Password sign-in is always available when auth is enabled. Passwordless (OTP) must be enabled in Auth settings — user enters email or phone, receives a code, verifies, and gets a token. No password field.

See Configuration scenarios for per-method examples, request/response, and UI hints.

Auth Methods (Passwordless Options)

When Passwordless (OTP) is enabled, choose how users identify:

MethodDescriptionAPI
Email OTP onlyUser enters email, receives code via emailOTP Send, OTP Verify
Phone OTP onlyUser enters phone, receives code via SMSOTP Send, OTP Verify
BothUser chooses email or phoneOTP Send, OTP Verify

Configure Sign-in method in Auth settings. Email OTP requires an Email Provider (Resend/SES). Phone OTP requires an SMS provider (MSG91 or Twilio).

Endpoints

EndpointDescription
POST /registerCreate new users (email + password)
POST /loginAuthenticate with email and password
POST /otp/sendSend OTP to email or phone
POST /otp/verifyVerify OTP and get JWT
GET /meGet current user (requires JWT)
GET /verify-emailVerify email with token from email
POST /resend-verificationResend verification email
POST /reset-password-requestRequest password reset email
POST /reset-passwordSet new password with reset token

Each endpoint page includes request/response shapes, error codes, and a Try it playground where applicable.