API & Developers
Rent a Phone Number by API: A Guide to the OtpGet Rental API
A temporary number lives for minutes and receives one code. A rental keeps the same number for days, so you can log in again, receive repeated codes and keep an account tied to one number. The OtpGet Rental API gives you all of that from code.
The rental endpoint
https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=ACTION_NAME
Actions at a glance
| Action | What it does |
|---|---|
| getRentalCountries | Countries that have rentable numbers |
| getRentalPricing | Prices by duration |
| getAvailableRentals | What can be rented right now |
| rentNumber | Rent a number |
| getMyRentals | All your active and past rentals |
| getRentalSMS | Read every SMS received on a rented number |
| renewRental | Extend a rental before it ends |
| cancelRental | Cancel a rental |
The rental flow
- List countries and pricing, then check availability.
- Rent the number and store the rental id.
- Use the number on your target service.
- Read messages with
getRentalSMSwhenever you need a code. Unlike a temporary order, many messages can arrive on the same rental. - Renew before the end date if you want to keep the number.
When rentals beat temporary numbers
- Accounts you must log into repeatedly.
- Services that send a fresh code at each login.
- Team workflows where several people need the same number.
- Customer support or testing where the number must stay stable.
Tip: automate renewals
Run a daily job that calls getMyRentals, finds rentals ending soon, and calls renewRental for the ones you want to keep. You never lose a number by forgetting a date.
Start building with OtpGet
Create a free account at otpget.com, copy your API key from the dashboard and open the API documentation. Our support team is available 24/7 if you get stuck.