When a rental beats activations
A rental pays for itself when the same test account must receive codes more than once:
- logging in again after the test wipes the session or reinstalls the app;
- a "new device" check, password reset or SMS-based recovery in the test plan;
- the same regression scenario re-run after a hotfix, where a new account would change the conditions you are comparing.
With one-off activations each of those is a new purchase, and usually a new number, which means a new account with no history. The comparison takes a minute:
# handler_api reference: https://otpwatch.com/rent-number-api
# Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
codes per cycle = cases that need a code × runs in the cycle
activation cost = codes per cycle × one-off price for the pair
rental cost = price of d1, d3 or d7 for the same pairRentals and one-off activations are priced separately, and suppliers set both. Look at the rental price for your pair in the order window before you script it. For reference, the one-off "from" price for Telegram in the United Kingdom was $1.3798 on .
Ordering a rental
# handler_api reference: https://otpwatch.com/rent-number-api
# Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
?action=getNumber&api_key=KEY&service=tg&country=16&duration=d7
ACCESS_NUMBER:12345:447700900123| duration | Term |
|---|---|
activation (or omitted) | one-off activation, one code |
d1 | 1 day |
d3 | 3 days |
d7 | 7 days, the longest term |
Not every service sells every term. If the service has no such duration the reply is BAD_SERVICE; an unknown value gives BAD_DURATION. maxPrice works for rentals too, with one difference: a rental above the cap answers NO_NUMBERS, not WRONG_MAX_PRICE:<price>. Retry with a higher cap or check the price in the dashboard.
Reading repeat codes
The rented number appears in getCurrentActivationsList until the rental ends, so a test process that restarts can find it again by number. Store three things with the test account: the activation id, the number and the end date.
# handler_api reference: https://otpwatch.com/rent-number-api
# Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
SMS_API_BASE_URL=https://sim-aggregator.org/stubs/handler_api.php
# Key from the SimAggregator dashboard: https://otpwatch.com/key
SMS_API_KEY=// handler_api reference: https://otpwatch.com/rent-number-api
// Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
// Wait for the next code on a rented number, then arm it for the one after.
import { SmsClient } from "./otp-client.mjs"; // from the Node.js page
const client = new SmsClient(process.env.SMS_API_KEY);
const id = process.env.RENTAL_ID; // saved when the rental was ordered
export async function nextCode() {
const code = await client.waitCode(id, { timeoutMs: 300_000, intervalMs: 4_000 });
await client.anotherCode(id); // setStatus 3: wait for the next SMS
return code;
}After setStatus 3, getStatus answers STATUS_WAIT_RETRY:<previous code> until a new SMS arrives, then STATUS_OK:<new code>. Do not send setStatus 6 between logins: 6 finishes the order. Send it only when you are done with the number.
Only the service you rented
A rental is tied to the number and the service. If you rented for Telegram, only Telegram SMS reach the order. Codes from any other sender do not show up, because the same SIM can serve other services for other buyers at the same time. If your test account needs two services on one number, the dashboard sells a multi-service order (up to three services) chosen at purchase.
Cancel and refund rules
- A rental can be cancelled with a refund within the first hour after purchase, and only before any SMS or call arrives. After that it is paid in full even if no code ever comes.
- Like any order, a cancel can be refused as too early (
EARLY_CANCEL_DENIED); repeat it later. - Refunds go to the internal balance.
So check in the first hour that the service actually sends to the number. If it refuses the number outright, cancel and order another one.
When the rental ends
The number goes back to the supplier. Any account still tied only to it is stuck with a phone you no longer control. Before the term ends, while repeat codes are still free:
- add a second login method to the test account: an email you control, an authenticator app, recovery codes;
- log out and back in with that method to prove it works;
- record in your test-accounts vault which number the account used and when the rental ended.
Need more time? The expired order in the dashboard has a "Buy again" button that orders the same number again, which in practice extends the rental, as long as the supplier's SIM is online.
Rentals and the rest of the suite
- Keep rentals on their own key. Your CI cleanup script cancels open orders of its key, and you do not want it cancelling a seven-day staging number.
- One rental per test account, not one per test. Tests that share the account must run serially, or two of them will read each other's codes.
- Full action reference: getNumber and setStatus.