v1REST ยท JSON ยท 6 endpoints
SMS verification API: receive SMS codes over REST
The FastOTP API buys a one-time phone number for any of 8 services in 5 countries and returns the SMS verification code sent to it, through 6 endpoints, with a full refund whenever no code arrives.
curl -X POST https://fastotp.io/api/v1/orders \
-H "Authorization: Bearer $FASTOTP_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"service": "whatsapp",
"country": "indonesia",
"max_price": "0.13"
}'201Created ยท the order, with its number
{
"id": "ord_9f2k1x",
"status": "active",
"service": "whatsapp",
"country": "indonesia",
"phone": "+6283150707440",
"price": "0.13",
"code": null,
"created_at": "2026-10-12T08:55:30Z",
"expires_at": "2026-10-12T09:15:30Z",
"seconds_to_code": null
}- Base URL
- https://fastotp.io/api/v1
- Auth
- Authorization: Bearer sk_live_โฆ
- Format
- JSON, UTF-8
- Money
- USD as strings: "0.13"
- Time
- ISO 8601, UTC
How it behaves
Four rules the API is built on
Written for integrations and test suites that run unattended: each rule removes one way of losing money or state when something goes wrong.
1One catalogue, one price list
The API reads the same routes and the same live prices as the website. There is no separate API tariff, and a route suspended on the site is refused over the API too.
2Charged only for delivered codes
Your balance is charged when an order is created and returned in full if the order fails, expires or is cancelled. Only an order that delivered a code keeps its charge.
3Named errors
Every failure comes back as one of 14 codes, such as price_changed or no_numbers. The docs say for each one whether anything was charged and what to do next.
4Safe retries
Send an Idempotency-Key when you create an order. A retry after a timeout then returns the original order, for 24 hours, instead of buying a second number.
Request and response
What comes back when it works, and when it does not
Poll the order every 3 to 5 seconds until its status is completed. If a request cannot be served, the response says why in a field you can branch on, and nothing is charged.
The code has arrived
curl https://fastotp.io/api/v1/orders/ord_9f2k1x \
-H "Authorization: Bearer $FASTOTP_KEY"{
"id": "ord_9f2k1x",
"status": "completed",
"service": "whatsapp",
"country": "indonesia",
"phone": "+6283150707440",
"price": "0.13",
"code": "482913",
"created_at": "2026-10-12T08:55:30Z",
"expires_at": "2026-10-12T09:15:30Z",
"seconds_to_code": 11
}The price rose above your limit
{
"error": {
"code": "price_changed",
"message": "The price for this route has changed.",
"price": "0.16"
}
}The order was not created and your balance is untouched. Every other error has the same shape; all 14 are listed in the API error reference.
Reference
All 6 endpoints
Paths are relative to https://fastotp.io/api/v1. A key carries scopes, and each endpoint names the one it needs.
| Endpoint | What it does | Scope |
|---|---|---|
| GET/routes | List routes with their live price, sale status and measured delivery rate. | catalog:read |
| GET/account | Read your balance. | any valid key |
| POST/orders | Buy a number. Charges your balance and returns the order. | orders:create |
| GET/orders/{id} | Read one order. Poll it until the code arrives. | orders:read |
| GET/orders | List your orders, newest first, optionally filtered by status. | orders:read |
| DELETE/orders/{id} | Cancel an order that has no code yet and refund it. | orders:cancel |
Limits per key: 30 order creations and 120 status polls per minute. See rate limits and safe retries.
Documentation
Four guides, each about one thing
- Quickstart docsYour first verification code in four requests.Read
- Orders docsThe order lifecycle, polling, and cancelling.Read
- Errors docsEvery error code and what to do about it.Read
- Limits docsRate limits, timeouts, and how to retry safely.Read
Create an account to get an API key
Keys are made in the account area. Each one carries the scopes you choose, is shown once, and can be revoked at any time.
- 1Create an accountNo subscription and no monthly fee.
- 2Add balanceOrders are paid from it, one code at a time.
- 3Create a keyChoose its scopes. The key is shown once and stored only as a hash.