Phone verification (OTP)

Send a verification code

POSThttps://api.smsedge.com/v1/phone-verifier/send-verification-code/

Sends a one-time code by SMS to a phone number and returns a request_id to verify it with.

Use this to prove that a user has the phone number they gave you, for example at signup.

  1. Call this endpoint with the user's number. Keep the request_id from the response.
  2. The user gets an SMS with a 6-digit code.
  3. The user types the code in your app.
  4. Send the code and the request_id to Verify a code.
  • The code expires after 5 minutes. The user has 3 attempts.
  • Each sent code is charged at the SMS price for the country. You need a positive balance.
  • Limits: 3 codes for each number in 15 minutes. For each account: 5 codes in 1 minute, 50 in 1 hour and 500 in 24 hours.

Body params (JSON)

  • numberstringrequired

    Phone number of the user, in international or local format.

  • countrystringrequired

    ISO 3166-1 alpha-2 country code or SMSEdge country ID of the number.

  • brandstringoptional

    Your brand or app name. Maximum 14 characters.

    Default: Phone Verify

Responses

  • 200The code was sent.
  • 400A parameter is missing or not valid, a limit was reached, or there is no route for the country.
  • 402Your balance is too low.
  • 500The code could not be sent. Try again later.
curl -X POST "https://api.smsedge.com/v1/phone-verifier/send-verification-code/" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"number":"447700900123","country":"GB"}'
[
  {
    "success": true,
    "data": {
      "request_id": "3f2b8c1e-7a4d-4e9b-9c21-5d6f7a8b9c0d",
      "normalized_number": "447700900123"
    },
    "errors": [],
    "response": {
      "code": 200,
      "description": "OK",
      "date": "2026-11-16 14:50:00"
    },
    "api": {
      "version": "v1",
      "module": "phone-verifier",
      "function": "send-verification-code"
    },
    "user": {
      "id": 12345
    }
  }
]

All requests need your API key in the X-API-KEY header. See Authentication.