Renting a number

Rent a number for days or weeks — general, or reserved for one platform — choose the exact offer, read every message, and renew, reset or return it.

Embed
Preview of the card
<a href="https://numestri.com/docs/renting-a-number"><img src="https://numestri.com/docs/_api/public/orgs/25229885-9620-4c08-bd2e-a0d0d74ac8b6/spaces/ef21e0c3-966d-4b03-b6d2-e66d449835d4/pages/e4f66db3-9196-43ca-b415-83d759c78afb/social-card.svg?v=3e7ae33eec8b" alt="Renting a number" width="600" height="315"></a>

A rental keeps one number for a fixed term and receives every message sent to it, for as long as the term lasts. Two kinds:

  • General — receives from any sender.

  • Reserved for a platform — a number set aside for one platform (WhatsApp, say), for when a platform will only accept its own.

Find what you can rent

These three calls are public: no API key needed. Without one they show public list prices; send your key to see your account's own prices, which is what a rental will charge you. A wrong key is refused with 403. See Authentication.

  1. Countries
    curl https://numestri.com/api/v1/rental/retrieve_all
    { "success": 1, "data": [ { "id": "US", "name": "United States" } ] }
  2. Platforms with reserved numbers (optional)
    curl "https://numestri.com/api/v1/rental/retrieve_platforms?id=US"
    {
      "success": 1,
      "country": "US",
      "data": [
        {
          "id": "whatsapp",
          "name": "WhatsApp",
          "from_price": "3.90",
          "from_price_cents": 390
        }
      ]
    }
  3. Terms, prices and options

    Add service for a reserved number; leave it out for a general one.

    curl "https://numestri.com/api/v1/rental/retrieve_pricing?id=US&service=whatsapp"
    {
      "success": 1,
      "country": "US",
      "service": { "id": "whatsapp", "name": "WhatsApp" },
      "pricing": { "7": "4.94", "30": "12.35" },
      "plans": [
        {
          "days": 7, "cost": "4.94", "cost_in_cents": 494, "quality": null, "in_stock": true, "renewable": true,
          "options": [
            { "option": "Qm3tV8xLs0PaWd2E", "provider": "prv_k3Jd9QmXa2", "rank": 1, "cost": "4.94", "in_stock": true, "renewable": true }
          ]
        }
      ]
    }

    renewable says whether the term can be extended on the same number later. Check it before you rent a number you mean to keep. extend (the same map as pricing) is what another term costs.

    A country with nothing to rent — or nothing reserved for that platform there — is a 404 with param: "id", pointing you back to retrieve_all or retrieve_platforms. An unknown service id is a 400.

Rent it

Renting, and everything after it, needs an API key.

curl https://numestri.com/api/v1/purchase/rental -H "Authorization: Bearer $NUMESTRI_KEY" \
  -d id=US -d days=7 -d service=whatsapp

Parameter

Required

Meaning

id

yes

Country code, e.g. US.

days

yes

A term from retrieve_pricing.

service

no

Platform id for a reserved number. Leave out for a general one.

option

no

An option id from that term: that offer at its price, or OPTION_GONE.

provider

no

A provider id: that provider only, its cheapest offer for the term.

max_price

no

Refuse above this price, in dollars (PRICE_ABOVE_MAX, nothing charged). The price itself is always worked out on our side.

Idempotency-Key

no

Header (or idempotency_key parameter). A retry with the same key returns the original rental instead of renting another.

{
  "success": 1,
  "rental_code": "SNBW9MPY",
  "phonenumber": "15550109876",
  "service_id": "whatsapp",
  "days": 7,
  "expiration_date": 1792736400,
  "renewable": true,
  "can_extend": true,
  "can_reset": true
}

Read its messages

curl "https://numestri.com/api/v1/rental/retrieve_messages?rental_code=SNBW9MPY" -H "Authorization: Bearer $NUMESTRI_KEY"
{
  "success": 1,
  "messages": [
    {
      "sender": "WhatsApp",
      "message": "Your code is 553-311",
      "code": "553311"
    }
  ]
}

Rentals receive whole messages; code is the verification code we found in it. For hands-off delivery, add a webhook — every message fires rental.received.

Keep, fix or return it

Endpoint

Does

POST /rental/extend (rental_code, days)

Buys another term on the same number. Only when can_extend is true.

POST /rental/reset (rental_code)

Reloads a number that has stopped receiving. Only when can_reset is true.

POST /rental/refund (rental_code)

Gives the number back. Possible only within a short window and before any message arrives; the response says exactly what was credited.

GET /rental/retrieve

Every rental still inside its term.

Updated