Skip to content

PIN setup and reset ​

Xash app

A PIN is a 5-digit alternative to the password for signing in. The Xash app uses it. A server integration does not need a PIN, but the first endpoint here is also how you get a code to reset a forgotten password.

No token is needed for any of these.

Request a code ​

POST /api/v1/auth/request-pin-otp

Sends a 5-digit code by SMS to the account's phone.

FieldTypeRequiredDescription
user_numberstringOne of the twoThe account's user number.
phonestringOne of the twoThe account's phone number.
bash
curl -X POST https://app.xash.co.zw/api/v1/auth/request-pin-otp \
  -H "Content-Type: application/json" \
  -d '{"user_number":"1234567890"}'
json
{
  "success": true,
  "message": "PIN verification code sent.",
  "data": {
    "expires_in_minutes": 10
  }
}

A new code replaces any earlier one.

Set a PIN ​

POST /api/v1/auth/set-pin

FieldTypeRequiredDescription
user_numberstringOne of the twoThe account's user number.
phonestringOne of the twoThe account's phone number.
otpstringYesThe 5-digit code from the SMS.
pinstringYesThe new PIN: 5 digits.
pin_confirmationstringYesThe PIN again.

The response is the same as Sign in, with a session token and the message PIN set successfully.

Forgot PIN ​

POST /api/v1/auth/forgot-pin

The same request and response as Request a code. The message is PIN reset code sent.

Reset a PIN ​

POST /api/v1/auth/reset-pin

The same request and response as Set a PIN. The message is PIN reset successfully.

Errors ​

StatusWhenBody
404Requesting a code for an account that does not exist.{"success": false, "message": "User not found."}
422Setting a PIN with a wrong, expired or used code, or for an unknown account.{"success": false, "message": "Invalid or expired PIN verification code."}
422A field is missing or invalid.Validation error
429More than 3 requests in a minute from this IP, or 10 in an hour, for this account.{"message": "Too Many Attempts."}
500The SMS could not be sent.{"success": false, "message": "Failed to send PIN verification code."}

All four endpoints share one rate limit per account. After 5 wrong codes the code is cancelled and a new one must be requested.