API Documentation
Use our API to automate number purchases and SMS reception.
Getting started
The API is compatible with the SMS-Activate protocol: if your software already works with it, just change the host in its settings — nothing else. Every request is a GET to a single address, and the action is passed in the action parameter.
Endpoint
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalanceThe key is passed in the api_key parameter. Create one in your account, under "API Access".
Current account balance.
Responses
ACCESS_BALANCE:100.5
{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalanceBuys a number and charges your balance. Returns the activation ID — use it to poll the status. We pick the offer for you: cheapest first, up to maxPrice, until a number is found. NO_NUMBERS only comes back when no provider has one.
Parameters
servicestringrequiredService code from getServicesList.countryintegerrequiredCountry ID from getCountries.maxPricenumberPrice ceiling. A number will never be bought above it; leave it out and the cheapest offer is used.Responses
Номер куплен
ACCESS_NUMBER:123456:+79001234567
Номеров нет
NO_NUMBERS
{
"title": "WRONG_MAX_PRICE",
"details": "The maximum price is less than the permitted price",
"info": {
"min": 0.5
}
}{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NO_BALANCE",
"details": "Payment Required"
}{
"title": "CHANNELS_LIMIT",
"details": "You have reached the maximum number of concurrent threads (purchases) allowed for your account. Contact the technical support."
}{
"title": "UNPROCESSABLE_ENTITY",
"details": "Validation failed",
"info": {
"field": "service",
"code": "REQUIRED",
"message": "Param 'service' is required."
}
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumberThis action changes data and spends money, so it cannot be run from this page. Copy the URL and call it from your own code.
Same as getNumber, but the response is an object. Parameters and errors are identical.
Parameters
servicestringrequiredService code from getServicesList.countryintegerrequiredCountry ID from getCountries.maxPricenumberPrice ceiling. A number will never be bought above it; leave it out and the cheapest offer is used.Responses
Номер куплен
{
"activationId": "123456",
"phoneNumber": "+79001234567",
"activationCost": 0.5,
"currency": 840,
"countryCode": 123,
"canGetAnotherSms": true,
"activationTime": "2026-07-17T12:00:00+00:00",
"activationEndTime": "2026-07-17T12:20:00+00:00",
"activationOperator": "any"
}Номеров нет — приходит строкой
NO_NUMBERS
{
"title": "WRONG_MAX_PRICE",
"details": "The maximum price is less than the permitted price",
"info": {
"min": 0.5
}
}{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NO_BALANCE",
"details": "Payment Required"
}{
"title": "UNPROCESSABLE_ENTITY",
"details": "Validation failed",
"info": {
"field": "service",
"code": "REQUIRED",
"message": "Param 'service' is required."
}
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumberV2This action changes data and spends money, so it cannot be run from this page. Copy the URL and call it from your own code.
Current state of the activation. The code follows the colon in STATUS_OK.
Parameters
idintegerrequiredActivation ID — the one getNumber returned.Responses
Ждём SMS
STATUS_WAIT_CODE
Ждём повторную SMS
STATUS_WAIT_RESEND
Код получен
STATUS_OK:123456
Активация отменена
STATUS_CANCEL
{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}{
"title": "UNPROCESSABLE_ENTITY",
"details": "Validation failed",
"info": {
"field": "service",
"code": "REQUIRED",
"message": "Param 'service' is required."
}
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatusSame as getStatus, but with the SMS text and timestamp. Until the SMS arrives the response is a plain string, as in getStatus.
Parameters
idintegerrequiredActivation ID — the one getNumber returned.Responses
Код получен
{
"verificationType": 1,
"sms": {
"dateTime": "2026-07-17 12:05:00",
"code": "123456",
"text": "Your code is 123456"
}
}SMS ещё нет — приходит строкой
STATUS_WAIT_CODE
{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}{
"title": "UNPROCESSABLE_ENTITY",
"details": "Validation failed",
"info": {
"field": "service",
"code": "REQUIRED",
"message": "Param 'service' is required."
}
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatusV2Requests another SMS, completes the activation, or cancels it with a refund.
Parameters
idintegerrequiredActivation ID — the one getNumber returned.statusintegerrequired3 — request another SMS, 6 — finish the activation, 8 — cancel it and refund.Responses
status=3
ACCESS_RETRY_GET
status=6
ACCESS_ACTIVATION
status=8
ACCESS_CANCEL
{
"title": "BAD_STATUS",
"details": "Wrong status code"
}{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}Отменять ещё рано
{
"title": "EARLY_CANCEL_DENIED",
"details": "Activation cannot be cancelled at this time. Minimum activation period must pass."
}Код уже пришёл — отмена невозможна
{
"title": "OTP_RECEIVED",
"details": "Cannot terminate activation - OTP has been received on this number"
}Активация уже завершена
{
"title": "ACTIVATION_NOT_ACTIVE",
"details": "Activation is terminated/refunded and Otp cannot be retrieved"
}{
"title": "UNPROCESSABLE_ENTITY",
"details": "Validation failed",
"info": {
"field": "service",
"code": "REQUIRED",
"message": "Param 'service' is required."
}
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=setStatusThis action changes data and spends money, so it cannot be run from this page. Copy the URL and call it from your own code.
Same as setStatus with status=6. Returns 204 with no body on success.
Parameters
idintegerrequiredActivation ID — the one getNumber returned.Responses
{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}{
"title": "ACTIVATION_NOT_ACTIVE",
"details": "Activation is terminated/refunded and Otp cannot be retrieved"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=finishActivationThis action changes data and spends money, so it cannot be run from this page. Copy the URL and call it from your own code.
Same as setStatus with status=8: cancels the activation and refunds the money. Returns 204 with no body on success.
Parameters
idintegerrequiredActivation ID — the one getNumber returned.Responses
{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}Отменять ещё рано
{
"title": "EARLY_CANCEL_DENIED",
"details": "Activation cannot be cancelled at this time. Minimum activation period must pass."
}Код уже пришёл
{
"title": "OTP_RECEIVED",
"details": "Cannot terminate activation - OTP has been received on this number"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=cancelActivationThis action changes data and spends money, so it cannot be run from this page. Copy the URL and call it from your own code.
Prices and number counts: country → service → offer. The cheapest price per country is shown.
Parameters
servicestringService code from getServicesList.countryintegerCountry ID from getCountries.Responses
Цены получены
{
"123": {
"tg": {
"cost": 0.5,
"count": 200,
"physicalCount": 200
}
}
}Неизвестный сервис
{
"status": "false",
"msg": "service is incorrect"
}Неизвестная страна
{
"status": "false",
"msg": "country is incorrect"
}Неверный ключ — строкой
BAD_KEY
Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getPricesCountries available for purchase. The id field is what you pass to getNumber.
Responses
[
{
"id": 123,
"rus": "Казахстан",
"eng": "Казахстан",
"chn": "Казахстан",
"visible": 1,
"retry": 1
}
]Неверный ключ — строкой
BAD_KEY
Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getCountriesServices available for purchase. The code field is what you pass to getNumber.
Responses
{
"status": "success",
"services": [
{
"code": "tg",
"name": "Telegram"
}
]
}Неверный ключ — строкой
BAD_KEY
Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getServicesListNumbers currently waiting for an SMS.
Parameters
startintegerOffset from the start of the list; in getHistory it is the start of the period (Unix timestamp).limitintegerHow many records to return, 100 max.Responses
{
"status": "success",
"data": [
{
"activationId": "123456",
"serviceCode": "tg",
"phoneNumber": "+79001234567",
"activationCost": 0.5,
"activationStatus": "4",
"smsCode": null,
"smsText": null,
"activationTime": "2026-07-17 12:00:00",
"discount": "0.00",
"repeated": "0",
"countryCode": "123",
"countryName": "Казахстан",
"canGetAnotherSms": "1",
"currency": 840
}
]
}{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getActiveActivationsAll your activations, including finished and cancelled ones.
Parameters
startintegerOffset from the start of the list; in getHistory it is the start of the period (Unix timestamp).endintegerEnd of the period, Unix timestamp.offsetintegerOffset from the start of the list.sizeintegerHow many records to return, 100 max.Responses
[
{
"id": "123456",
"date": "2026-07-17 12:00:00",
"phone": "+79001234567",
"sms": "Your code is 123456",
"cost": 0.5,
"status": "6",
"currency": 840
}
]{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getHistoryMessages received by the number.
Parameters
idintegerrequiredActivation ID — the one getNumber returned.sizeintegerHow many records to return, 100 max.pageintegerPage number, starting at one.Responses
{
"data": [
{
"id": "1",
"phoneFrom": "Telegram",
"code": "123456",
"text": "Your code is 123456",
"service": "tg",
"date": "2026-07-17T12:05:00+00:00",
"type": "sms"
}
],
"meta": {
"total": 1,
"service": "tg"
}
}{
"title": "BAD_KEY",
"details": "Unauthorized"
}{
"title": "NO_KEY",
"details": "Unauthorized"
}{
"title": "NOT_FOUND",
"details": "Activation Not Found"
}{
"title": "ACTIVATION_NOT_ACTIVE",
"details": "Activation is terminated/refunded and Otp cannot be retrieved"
}{
"title": "SERVER_ERROR",
"details": "Server Gone"
}Try it
https://www.krasmedinfo.ru/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getAllSms