rent

Rent a number

GEThttps://onlinesim.io/stubs/handler_api.php?action=getRentNumber

Rents a number of the country to receive SMS from any senders. The rent price for the period is reserved on the balance and charged with the first SMS. The rent is ordered without the extension option.

Errors as JSON ({"status":"error","message":…}):

  • NO_NUMBERS — no free number now, or the country has no rent for this period
  • NO_BALANCE — not enough money on the balance

Errors as text: BAD_COUNTRY (unknown or non-numeric country) and the common errors.

Security

OAuth2
rent-scope
grants access to renting phone numbers from Onlinesim

Parameters

query3
NameTypeDescription
action*string

Method name: getRentNumber

Enum:getRentNumber
countryinteger
≥ 0

Country ID from getCountries (id). Without it: Russia

Default:0Example:16
rent_timeinteger
≥ 0

Rent period in hours, rounded up to whole days (2 → 1 day, 25 → 2 days); 0 means 24. The number of days must be a rent period of the country

Default:4Example:24

Responses

200The rented number, or an error
text/plain
Schema
schemaoneOf
One Of
[0]string
Enum:BAD_COUNTRY
[1]string
Error answered as text by every action (also by the JSON ones):
  • BAD_KEY — the API key is wrong or missing
  • BANNED — the account is blocked
  • BAD_ACTION — unknown action or an error without its own code (for example a temporary error or too many concurrent requests); check the request and repeat it later
  • Too many requests. Please wait a moment before trying again. — the converter's limit of getNumber, getRentNumber, setStatus and setRentStatus (3 requests per second, 150 per 30 seconds)
Enum:BAD_KEYBANNEDBAD_ACTIONToo many requests. Please wait a moment before trying again.
application/json
Schema
schemaoneOf
One Of
[0]object
[1]objectError of a JSON action. The codes are listed at each action

Examples

rented

Number rented

{
  "status": "success",
  "phone": {
    "id": 22867858,
    "endDate": "2026-11-20T10:00:00+03:00",
    "number": "7400123456"
  }
}
noNumbers

No free number

{
  "status": "error",
  "message": "NO_NUMBERS"
}

Code Samples

Generating examples...