logo

SmsAgent

Sms Agent Api integration

Seamlessly integrate SMS verification into your app or service using our fast, secure API. Access global virtual numbers and instantly receive one-time codes for WhatsApp, Telegram, Google, and more. Designed for developers. Built for scale.

none provided

Customer API

Overview

The API is the communication protocol between your software and our activation server. It is used to automate the process of receiving SMS messages on your side.

Our API is compatible with the SmsAgent API, so you can use similar requests.

All API requests must include an access key via the api_key parameter.

Get Number / Get Prices / Get Activation Status / Set Activation Status / Get Countries List


Get Number

GET /stubs/handler_api.php?action=getNumber&api_key=$api_key&country=$country&service=$service

  • $api_key — your API key
  • $country — country ID (0 for Russia, 1 for Ukraine, etc.)
  • $service — service code
  • $maxPrice (optional) — maximum price for the number

Example of successful response:

ACCESS_NUMBER:12476:79586829188

Where 12476 is activation id. 79586829188 is a phone number.

Possible errors:

  • BAD_SERVICE — service not found
  • NO_NUMBERS — no numbers available

Get Prices

GET /stubs/handler_api.php?action=getPrices&api_key=$api_key

  • $api_key — your API key
  • $service (optional) — service code to filter prices

Example of successful response:

{
  "0": {
    "wb": {
      "2.50": 1873
    }
  },
  "16": {},
  "175": {
    "tg": {
      "6.25": 0
    },
    "vi": {
      "4.29": 786
    },
    "wa": {
      "11.11": 211
    }
  }
}

Where the keys are service IDs and the values are objects with price categories and their corresponding number counts.


Get Activation Status

GET /stubs/handler_api.php?action=getStatus&api_key=$api_key&id=id

  • $api_key — your API key
  • $id — activation ID

Example of successful response:

STATUS_OK:1FgsA5

Where 1FgsA5 is the activation code.

Possible statuses:

  • NO_ACTIVATION — no activation found
  • STATUS_WAIT_CODE — waiting for sms
  • STATUS_CANCEL — activation canceled

Set Activation Status

GET /stubs/handler_api.php?action=setStatus&api_key=$api_key&id=$id&status=$status

  • $api_key — your API key
  • $id — activation ID
  • $status — new status (6 - activation completed successfully, 8 - cancel activation)

Example response: ACCESS_ACTIVATION - activation completed successfully ACCESS_READY - SMS waiting readiness ACCESS_CANCEL - activation canceled

API Interaction Logic: Activation Flow

Initial Actions (Immediately After Receiving the Number):
- 8 — Cancel activation
- 1 — (Optional) Notify that an SMS has been sent
When Activation Status = 1:
- 8 — Cancel activation
After Receiving the SMS Code:
- 3 — Request another SMS
- 6 — Confirm SMS code and complete activation
When Activation Status = 3:
- 6 — Confirm SMS code and complete activation

Get Countries List

GET /stubs/handler_api.php?action=getCountries&api_key=$api_key

$api_key — your API key

Example Response:


{
  "0": {
    "id": 0,
    "eng": "russia",
    "visible": 1
  },
  "1": {
    "id": 1,
    "eng": "ukraine",
    "visible": 1
  },
  "2": {
    "id": 2,
    "eng": "kazakhstan",
    "visible": 1
  },
  "3": {
    "id": 3,
    "eng": "china",
    "visible": 1
  }
}

Get started with SmsAgent