API ReferenceAuthentication APIPOST /auth/otp/verify

POST /auth/otp/verify

Verify the one-time code sent to the user’s email (or SMS) and return the user object and a JWT. Use this after POST /auth/otp/send.

Endpoint

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

Request Parameters

Path Parameters

ParameterTypeRequiredDescription
projectSlugstringYour project’s unique slug

Request Body

FieldTypeRequiredDescription
emailstringSame email the OTP was sent to
codestringThe one-time code received by the user

Example Request Body

{
  "email": "user@example.com",
  "code": "123456"
}

Response

Success (200 OK)

{
  "user": {
    "id": "user-uuid-here",
    "email": "user@example.com",
    "name": "Jane Doe",
    "email_verified_at": "2026-02-10T10:00:00Z"
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Store the token and use it for authenticated requests (e.g. GET /auth/me).

Error Responses

Status CodeError CodeDescription
400INVALID_REQUESTInvalid email or code format
401INVALID_OTPCode is wrong or expired
429RATE_LIMIT_EXCEEDEDToo many verify attempts
500INTERNAL_SERVER_ERRORServer error

Available Hooks

  • Event: auth.otp.verify
    • When: After successful OTP verification
    • Can do: Track OTP logins, trigger onboarding flows on first OTP login

Configure in Project → Hooks. Learn more about hooks →

Try It Now

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