Skip to content

Phone Verification

Endpoints for phone number verification and user information updates.

Update User Info

Update user information after initial registration.

Endpoint

POST /api/auth/update-user-info

Request

json
{
  "name": "John Doe",
  "email": "john@example.com",
  "date_of_birth": "1990-01-01"
}

Response

json
{
  "message": "User information updated successfully",
  "data": {
    "id": 1,
    "name": "John Doe",
    "email": "john@example.com"
  }
}

Initiate Phone Verification

Start the phone verification process for an existing user.

Endpoint

POST /api/auth/verify-phone/initiate

Request

json
{
  "phone": "+1234567890"
}

Response

json
{
  "message": "Verification code sent",
  "data": {
    "expires_in": 300,
    "phone": "+1234567890"
  }
}

Verify Phone Number

Complete phone verification with the received code.

Endpoint

POST /api/auth/verify-phone

Request

json
{
  "phone": "+1234567890",
  "code": "123456"
}

Response

json
{
  "message": "Phone verified successfully",
  "data": {
    "verified": true,
    "phone": "+1234567890"
  }
}

Error Responses

  • 401 - Invalid or expired code
  • 422 - Phone number mismatch

Resend Verification Code

Request a new verification code.

Endpoint

POST /api/auth/resend-code

Request

json
{
  "phone": "+1234567890"
}

Response

json
{
  "message": "New verification code sent",
  "data": {
    "expires_in": 300
  }
}

Error Responses

  • 429 - Too many requests (rate limited)
  • 422 - No pending verification for this phone