Skip to main content
POST
/
v1
/
auth
/
login
/
otp

Overview

Send an OTP (one-time password) code to the user’s registered phone number. This endpoint is called when:
  1. POST /v1/auth/login returns isOtpRequired: true
  2. User needs two-factor authentication for login
  3. You need to resend an expired OTP code
The OTP code is typically 6 digits and expires after a few minutes.

Request

Body

userId
string
required
User’s unique identifier from login responseFormat: UUIDExample: b6b9168c-bb56-4c6a-9c0d-4650ea74f5f9

Response

{
  "success": true
}

Code Examples

curl -X POST "https://dev.api.baanx.com/v1/auth/login/otp" \
  -H "x-client-key: your-client-key" \
  -H "Content-Type: application/json" \
  -d '{"userId": "b6b9168c-bb56-4c6a-9c0d-4650ea74f5f9"}'
OTP codes expire after a few minutes. Implement a “Resend Code” button that calls this endpoint again.