rent

Get information about the state of virtual phone number rent operation

GEThttps://onlinesim.io/api/rent/getRentState.php

This request returns a list of active rental numbers: operations with status 0, 1 or 4.

You can use it to quickly browse all your active rental numbers (or only specific one) and their received messages.

SMS in messages are always newest first. A non-numeric tzid or a wrong orderby gives TRY_AGAIN_LATER. POST with the same parameters works too.

Security

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

Parameters

query9
NameTypeDescription
tzidinteger

Rent operation ID: only this operation. Without it (or with 0) all active rent operations

paginationboolean

true (default) — messages of a rent operation is split into pages (see page and per_page); false — messages is a flat list of SMS, newest first

Default:true
pageinteger
≥ 1

One page of messages, counted from 1: page=N returns page N alone, data is then a flat list of SMS. Values below 1 become 1. Without it all pages are returned. Only with pagination

per_pageinteger
≥ 1

Number of messages per page, default is 20; values below 1 become 1 (only relevant when pagination is enabled)

Default:20
orderbystring

Order of the operations in the list by operation ID: desc — newest first, asc — oldest first. Lowercase only

Enum:ascdescDefault:desc
lastboolean

true — messages holds only the code of the newest SMS (an empty string when there is none)

Default:false
message_to_codeboolean

With last=true: false — messages holds the text of the newest SMS instead of its code

Default:true
numberinteger

Any value: every item also gets time_seconds and guard_interval_remaining_seconds

langstring

Language of the texts in the answer (country and service names, status texts): fr, de, ru, en or zh. Every method accepts it; methods without such texts answer the same in any language. Field names, error codes and other fixed values stay in English. Without the parameter: ru for getTariffs, getNumbersStats and getFreeList; otherwise the language of the profile for requests with a key, English for requests without one. An unsupported value falls back to the default language

Enum:frderuenzh

Responses

200Active rent operations or an error
Content-Typeapplication/json
Schema
schemaoneOf
One Of
[0]object
[1]object

Examples

Operation list with pagination53 lines

Paginated list of SMS

{
  "response": 1,
  "list": [
    {
      "status": 1,
      "messages": {
        "current_page": 1,
        "data": [
          [
            {
              "id": 1,
              "service": "Google",
              "text": "G-070051 is your Google verification code.",
              "code": "070051",
              "created_at": "2026-11-19 10:01:12"
            }
          ]
        ],
        "from": 1,
        "last_page": 1,
        "per_page": 20,
        "to": 1,
        "total": 1
      },
      "country": 7,
      "rent": 4,
      "days_autoextend": 3,
      "extension": 1,
      "checked_time": "2026-11-19 10:00:00",
      "sum": "2.40",
      "number": "9915584307",
      "start_time": "2026-11-19 10:00:00",
      "stop_time": "2026-11-23 10:00:00",
      "webhook_url": null,
      "tzid": 22867974,
      "time": 2880,
      "days": 2,
      "hours": 48,
      "extend": {
        "1": 0.9,
        "3": 1.5,
        "7": 3,
        "15": 5.5,
        "30": 9
      },
      "checked": true,
      "reload": 0,
      "day_extend": 0.3,
      "m_ext": false,
      "freeze": false
    }
  ]
}
Operation list with flat SMS array43 lines

Flat SMS array (pagination=false)

{
  "response": 1,
  "list": [
    {
      "status": 1,
      "messages": [
        {
          "id": 1,
          "service": "Google",
          "text": "G-070051 is your Google verification code.",
          "code": "070051",
          "created_at": "2026-11-19 10:01:12"
        }
      ],
      "country": 7,
      "rent": 4,
      "days_autoextend": 3,
      "extension": 1,
      "checked_time": "2026-11-19 10:00:00",
      "sum": "2.40",
      "number": "9915584307",
      "start_time": "2026-11-19 10:00:00",
      "stop_time": "2026-11-23 10:00:00",
      "webhook_url": null,
      "tzid": 22867974,
      "time": 2880,
      "days": 2,
      "hours": 48,
      "extend": {
        "1": 0.9,
        "3": 1.5,
        "7": 3,
        "15": 5.5,
        "30": 9
      },
      "checked": true,
      "reload": 0,
      "day_extend": 0.3,
      "m_ext": false,
      "freeze": false
    }
  ]
}
Empty list

No active rentals operations

{
  "response": 1,
  "list": []
}
429HTTP 429: more than 400 requests per minute from one profile (from one IP for requests without a key), or more than 200 requests per minute from one profile to getNum, getPrice, getState and setOperationOk together
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error code. The codes any method can return are listed in the introduction; each method lists its own. The list is not closed: treat an unknown code as a generic error and log it.

Examples

Rate limit

Request rate limit exceeded

{
  "response": "TRY_AGAIN_LATER"
}
456HTTP 456: the API key is invalid or the OAuth token has expired. Public methods answer the same way when an invalid key is sent
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error code. The codes any method can return are listed in the introduction; each method lists its own. The list is not closed: treat an unknown code as a generic error and log it.

Examples

Invalid key

Invalid API key or expired token

{
  "response": "ERROR_WRONG_KEY"
}

Code Samples

Generating examples...