Send OTP

Generates a one-time code and sends it via SMS to the specified Turkmenistan phone number. The code length (4–10 digits, default 6) and validity (60–600 seconds, default 300) come from the API key's settings in the client portal.

POST/api/v1/otp/send
X-API-Key

Body parameters

FieldTypeRequiredDescription
phone_numberstringrequiredE.164 format, +993 followed by 8 digits

Example request

curl -X POST https://api.ugrat.com/api/v1/otp/send \
  -H "X-API-Key: uk_live_a3f9c2e1..." \
  -H "Content-Type: application/json" \
  -d '{"phone_number": "+99361394459"}'

Example response

{
  "success": true,
  "data": {
    "reference_id": "550e8400-e29b-41d4-a716-446655440000",
    "expires_in": 300
  }
}

Keep the reference_id; it is required by Verify OTP. expires_in is the code's validity in seconds.

Errors

CodeDescription
400 VALIDATION_FAILEDInvalid phone format (fields[].code = invalid_phone)
400 BAD_REQUESTMalformed JSON
401 UNAUTHORIZEDAPI key missing or invalid
403 ACCOUNT_PENDING / ACCOUNT_BLOCKEDAccount not approved yet, or blocked
429 RATE_LIMITEDToo many requests — retry after Retry-After
503 SERVICE_UNAVAILABLENo delivery route is available right now — retry later