API ReferenceAuthentication APIPOST /otp/verify

POST /auth/otp/verify

Verify the one-time code sent to the user’s email or phone and return a JWT. Passwordless flow — no password. Use the same identifier (email or phone) that was used in POST /auth/otp/send.

Endpoint

POST /api/v1/public/projects/:projectSlug/auth/otp/verify

Request Body

FieldTypeRequiredDescription
emailstringOne of email/phoneSame email the OTP was sent to
phonestringOne of email/phoneSame phone the OTP was sent to (E.164, e.g. +919876543210)
codestringThe 6-digit code received by the user

Example: Email OTP

{
  "email": "[email protected]",
  "code": "123456"
}

Example: Phone OTP

{
  "phone": "+919876543210",
  "code": "123456"
}

Response

Success (200 OK)

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": "user-uuid-here",
    "email": "[email protected]",
    "name": "Jane Doe"
  }
}

For phone-only users, email may be a placeholder value. Store the token for authenticated requests (e.g. GET /auth/me).

Error Responses

Status CodeDescription
400Invalid request (validation failed)
401Code is wrong or expired
403Email not verified (when project requires verification and user signed in via Email OTP)
500Server error

Try It Now

POSThttps://api.aerocall.app/api/v1/public/projects/your-project/auth/otp/verify