Getting started
Introduction
The API covers two XeroSMS products. Both use the same key, the same wallet and the same response format.
SMS verification
A number for one code from over 1,000 apps and websites, in about 150 countries.
6 endpointsCall & Text
Your own US or Canadian number, billed monthly, texting any country.
10 endpoints- JSON in, JSON out. Every response has
success,statusCode,messageanddata. Lists addmetawith the page and total. - Amounts are US dollars. Prices in the SMS country list are strings like
"1.40"; charges and balances are numbers. - IDs and times. IDs are UUID strings. Times are ISO 8601 in UTC.
- From your server only. The key spends your wallet, so never put it in a website or app that other people download.
{ "statusCode": 200, "success": true, "message": "Orders retrieved successfully", "meta": { "page": 1, "limit": 10, "total": 42 }, "data": [ … ]}Getting started
Quickstart
From nothing to a WhatsApp verification code in four steps.
- 1
Create a key
Open Developer settings and generate a key. It's instant, and the full key is shown once, so copy it then.
- 2
Top up your wallet
API orders are paid from the same wallet as the app. The smallest top-up is plenty to try it.
- 3
Keep the key in an environment variable
The samples read it from
XEROSMS_API_KEY, for exampleexport XEROSMS_API_KEY=xero_… - 4
Run the script
It orders a WhatsApp number in the US, prints it, then checks every 5 seconds until the code arrives. If no code comes, the order is refunded.
# 1. Order a WhatsApp number in the UScurl -X POST "https://xero-sms-backend.onrender.com/api/v1/public/sms-service/order" \ -H "X-Api-Key: $XEROSMS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"serviceId":"1012","countryId":"US"}'# 2. Check the order every 5 seconds (use data.order.id)curl "https://xero-sms-backend.onrender.com/api/v1/public/sms-service/orders/ORDER_ID" \ -H "X-Api-Key: $XEROSMS_API_KEY"# 3. No code yet and you want to stop? Cancel for a refundcurl -X PATCH "https://xero-sms-backend.onrender.com/api/v1/public/sms-service/orders/ORDER_ID" \ -H "X-Api-Key: $XEROSMS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"status":"refunded"}'Getting started
Authentication
Send your key in the X-Api-Key header with every request. Keys start with xero_ followed by 64 characters.
Each request runs as the account that owns the key: it spends that wallet and only sees that account's orders and numbers. An account has one active key at a time. Regenerate or delete it in Developer settings, and the old key stops working immediately.
Keep it secret
Anyone with the key can spend your balance. Store it in an environment variable or a secrets manager, and regenerate it if it leaks.curl "https://xero-sms-backend.onrender.com/api/v1/public/sms-service/services" \ -H "X-Api-Key: xero_3f9a…"{ "success": false, "message": "Invalid or revoked API key", "errorMessages": [ { "path": "", "message": "Invalid or revoked API key" } ]}Getting started
Pricing
30%
off every API price
SMS verifications, Call & Text numbers and texts sent through the API cost less than in the app. On a few costly text destinations the discount is smaller, so the price still covers what the carrier charges.
You see the price first
Countries & prices, Search numbers and Price a destination return exactly what you’ll be charged, discount included.
Paid from your wallet
Prices are in US dollars and come from the wallet of the key’s account. Orders return your remainingBalance.
Failures cost nothing
If a number can’t be supplied, the charge goes straight back. Codes that never arrive and texts that aren’t delivered are refunded.
Getting started
Errors
Failed requests return success: false and a message you can show or log. Validation errors also list each field in errorMessages.
- 400The request can’t be done as sent: a missing field, too little balance, a country that isn’t available, or a completed order.
- 401The key is missing, wrong, or was deleted or regenerated.
- 403The account that owns the key is blocked.
- 404Nothing with that id on your account.
- 409Another request is working on the same order. Retry in a few seconds.
- 429Too many requests. See Rate limits.
- 502A provider failed while placing an order. Any charge has already been returned.
- 503Call & Text is paused for maintenance.
{ "success": false, "message": "Validation Error", "errorMessages": [ { "path": "countryId", "message": "countryId is required" } ]}Getting started
Rate limits
You can make 100 requests a minute from one IP address. Every response tells you where you stand: ratelimit-remaining is what's left, and ratelimit-reset is the seconds until the count starts again.
Checking an order every 5 seconds uses 12 requests a minute, so you can follow about eight orders at once. Cache the service list, and look prices up just before you order rather than in a loop.
HTTP/2 200ratelimit-policy: 100;w=60ratelimit-limit: 100ratelimit-remaining: 97ratelimit-reset: 30{ "success": false, "message": "Too many requests, please try again later."}Product
SMS verification
Rent a number for a single verification code. Pick a service and a country, place an order, and check it until the code arrives. All paths start with /sms-service.
How an order works
POST /orderThe price is taken from your wallet and you get a number.
pendingEnter the number in the service, then check the order every 5 seconds.
completedThe code is in details.code.
refundedYou cancelled, or the number expired. The money is back.
/sms-service/servicesList services
Every app and website you can get a verification number for, with the ID you pass when you look up prices and place an order.
In the response
IDnumberThe service ID. Send it as serviceId.
namestringThe service name.
curl "https://xero-sms-backend.onrender.com/api/v1/public/sms-service/services" \ -H "X-Api-Key: $XEROSMS_API_KEY"{ "statusCode": 200, "success": true, "message": "SMSPool services retrieved successfully", "data": [ { "ID": 1012, "name": "WhatsApp", "favourite": 0 }, { "ID": 907, "name": "Telegram", "favourite": 0 }, { "ID": 457, "name": "Instagram / Threads", "favourite": 0 } ]}/sms-service/services/:serviceId/countriesList countries and prices
The countries a service is available in right now, with what an order costs through the API and how often a code arrives.
Path parameters
serviceIdstringrequiredA service ID from List services, e.g. 1012 for WhatsApp.
In the response
short_namestringThe country code. Send it as countryId when you order.
pricestringWhat an order costs you now, in USD. Orders are charged at this price.
low_pricestringThe lowest price seen across the provider’s pools, for reference.
success_ratestringShare of recent orders that received a code, in percent.
stocknumberNumbers left, on rows that report it.
curl "https://xero-sms-backend.onrender.com/api/v1/public/sms-service/services/1012/countries" \ -H "X-Api-Key: $XEROSMS_API_KEY"{ "statusCode": 200, "success": true, "message": "SMSPool service countries retrieved successfully", "data": [ { "country": 1, "country_id": 1, "name": "United States", "short_name": "US", "success_rate": "96.40", "price": "1.40", "low_price": "1.12" }, { "country": 2, "country_id": 2, "name": "United Kingdom", "short_name": "GB", "success_rate": "91.20", "price": "0.84", "low_price": "0.70" } ]}/sms-service/orderPlace an order
Reserves a number for one service in one country. The price is taken from your wallet first; if the provider can’t supply a number, it goes straight back.
Body
serviceIdstringrequiredThe service ID, e.g. "1012".
countryIdstringrequiredThe country’s short_name, e.g. "US".
In the response
order.idstringUse it to check, cancel or complete the order.
order.numberstringThe full number, country code first. Enter it in the service you’re verifying.
order.phoneNumberstringThe same number without the country code.
order.costnumberWhat was charged, in USD.
remainingBalancenumberYour wallet balance after the charge.
Errors
- 400Insufficient balance, or the service or country isn’t available.
- 502The provider couldn’t supply a number. Nothing is charged.
curl -X POST "https://xero-sms-backend.onrender.com/api/v1/public/sms-service/order" \ -H "X-Api-Key: $XEROSMS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"serviceId":"1012","countryId":"US"}'{ "statusCode": 200, "success": true, "message": "Order created successfully", "data": { "order": { "id": "7f3d2c1a-5b8e-4d9a-9c61-2e4f8b0a1d37", "serviceId": "1012", "countryId": "US", "orderById": "4a1e…", "orderId": "QX7KD2LM", "number": "12015550123", "phoneNumber": "2015550123", "cc": "1", "pool": "7", "country": "United States", "service": "WhatsApp", "status": "pending", "cost": 1.4, "createdAt": "2026-10-15T09:24:11.482Z", "updatedAt": "2026-10-15T09:24:11.482Z" }, "remainingBalance": 48.6 }}/sms-service/orders/:orderIdGet an order
Checks an order with the provider and returns it. Poll this every 5 seconds while the status is pending: the code appears in details.code, and an order whose number expired comes back refunded, with the money already in your wallet.
Path parameters
orderIdstringrequiredThe id from Place an order.
In the response
info.statusstringThe order’s status. Rely on this one. See Statuses.
details.codestringThe verification code, once it arrives. Empty until then.
details.full_codestringThe whole message the service sent.
details.time_leftnumberSeconds before the number expires.
Errors
- 404No API order with that id on your account.
curl "https://xero-sms-backend.onrender.com/api/v1/public/sms-service/orders/7f3d2c1a-5b8e-4d9a-9c61-2e4f8b0a1d37" \ -H "X-Api-Key: $XEROSMS_API_KEY"{ "statusCode": 200, "success": true, "message": "Order retrieved successfully", "data": { "info": { "id": "7f3d2c1a-5b8e-4d9a-9c61-2e4f8b0a1d37", "service": "WhatsApp", "number": "12015550123", "status": "completed", "cost": 1.4, "…": "the rest of the order" }, "details": { "code": "482910", "full_code": "Your WhatsApp code: 482-910. Don't share this code.", "status": "completed", "time_left": 0, "expiry": 1200, "completed_on": "2026-10-15T09:25:02.000Z" } }}/sms-service/orders/:orderIdCancel or complete an order
Send refunded to cancel a pending order and get its cost back. Send completed to close an order you’re done with.
Path parameters
orderIdstringrequiredThe order’s id.
Body
status"refunded" | "completed"requiredrefunded cancels and returns the cost to your wallet. completed closes the order without a refund.
Errors
- 400The order is already completed, or the provider refused the refund.
- 409Another request is working on this order. Retry in a few seconds.
curl -X PATCH "https://xero-sms-backend.onrender.com/api/v1/public/sms-service/orders/7f3d2c1a-5b8e-4d9a-9c61-2e4f8b0a1d37" \ -H "X-Api-Key: $XEROSMS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"status":"refunded"}'{ "statusCode": 200, "success": true, "message": "Order updated successfully", "data": { "id": "7f3d2c1a-5b8e-4d9a-9c61-2e4f8b0a1d37", "status": "refunded", "cost": 1.4, "…": "the rest of the order" }}/sms-service/ordersList orders
Orders placed through the API on your account, newest first. Orders placed in the XeroSMS app aren’t included.
Query parameters
statusstringpending, completed, refunded, expired or cancelled.
searchTermstringMatches the provider order ID, country, service or number.
pagenumberPage number. Default 1.
limitnumberOrders per page. Default 10.
sortOrder"asc" | "desc"By creation time. Default desc.
curl "https://xero-sms-backend.onrender.com/api/v1/public/sms-service/orders?status=pending&limit=20" \ -H "X-Api-Key: $XEROSMS_API_KEY"{ "statusCode": 200, "success": true, "message": "Orders retrieved successfully", "meta": { "page": 1, "limit": 20, "total": 1 }, "data": [ { "id": "7f3d2c1a-5b8e-4d9a-9c61-2e4f8b0a1d37", "serviceId": "1012", "countryId": "US", "orderById": "4a1e…", "orderId": "QX7KD2LM", "number": "12015550123", "phoneNumber": "2015550123", "cc": "1", "pool": "7", "country": "United States", "service": "WhatsApp", "status": "pending", "cost": 1.4, "createdAt": "2026-10-15T09:24:11.482Z", "updatedAt": "2026-10-15T09:24:11.482Z" } ]}Product
Call & Text
Your own US or Canadian numbers, billed monthly from your wallet, with two-way texting to any country we can reach. All paths start with /call-text.
How a number works
activeSends and receives texts. Renews every 30 days from your wallet.
suspendedTexts still arrive. Top up and renew it to send again.
releasedThe number is gone for good. Releasing it yourself does the same.
Calls happen in the app
Calls need a microphone, so they're made and answered in the XeroSMS app and on xerosms.com, at the app's per-minute price. The API can read each number's call history./call-text/availableSearch available numbers
US and Canadian numbers you can buy right now, up to 20 at a time, with this month’s price.
Query parameters
country"US" | "CA"Default US.
regionstringTwo-letter state or province, e.g. NY or ON.
areaCodestringThree digits, e.g. 212.
Errors
- 503Call & Text is paused for maintenance.
curl "https://xero-sms-backend.onrender.com/api/v1/public/call-text/available?country=US®ion=NY&areaCode=212" \ -H "X-Api-Key: $XEROSMS_API_KEY"{ "statusCode": 200, "success": true, "message": "Available numbers retrieved successfully", "data": { "monthlyPrice": 4.2, "country": "US", "numbers": [ { "phoneNumber": "+12125550123", "friendlyName": "(212) 555-0123", "locality": "New York", "region": "NY" } ] }}/call-text/numbersBuy a number
Buys a number from the search and charges the first month. It renews every 30 days from your wallet at the price it was bought for, until you release it.
Body
phoneNumberstringrequiredA number from the search, e.g. "+12125550123".
country"US" | "CA"Default US.
Errors
- 400Insufficient balance, or the number is no longer available.
- 503Call & Text is paused for maintenance.
curl -X POST "https://xero-sms-backend.onrender.com/api/v1/public/call-text/numbers" \ -H "X-Api-Key: $XEROSMS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"phoneNumber":"+12125550123","country":"US"}'{ "statusCode": 200, "success": true, "message": "Number purchased successfully", "data": { "id": "b1c9e7a2-3f4d-4e8b-a6c5-9d0e1f2a3b4c", "phoneNumber": "+12125550123", "country": "US", "monthlyPrice": 4.2, "status": "active", "renewsAt": "2026-11-14T09:30:00.000Z", "createdAt": "2026-10-15T09:30:00.000Z", "updatedAt": "2026-10-15T09:30:00.000Z" }}/call-text/numbersList your numbers
Your active and suspended numbers with unread counts, plus your current prices: the API’s monthly price and lowest text price, and the app’s per-minute call price.
curl "https://xero-sms-backend.onrender.com/api/v1/public/call-text/numbers" \ -H "X-Api-Key: $XEROSMS_API_KEY"{ "statusCode": 200, "success": true, "message": "Numbers retrieved successfully", "data": { "lines": [ { "id": "b1c9e7a2-3f4d-4e8b-a6c5-9d0e1f2a3b4c", "phoneNumber": "+12125550123", "status": "active", "monthlyPrice": 4.2, "renewsAt": "2026-11-14T09:30:00.000Z", "unreadCount": 2 } ], "monthlyPrice": 4.2, "perSmsPrice": 0.35, "callPricePerMinute": 0.1, "enabled": true, "usTextingEnabled": false }}/call-text/rates/quotePrice a destination
What one text part sent through the API, and one minute of calling from the app, cost to a number. When a destination can’t be reached, available is false and reason says why.
Query parameters
tostringrequiredThe number in international form. Encode + as %2B.
curl "https://xero-sms-backend.onrender.com/api/v1/public/call-text/rates/quote?to=%2B2348031234567" \ -H "X-Api-Key: $XEROSMS_API_KEY"{ "statusCode": 200, "success": true, "message": "Quote retrieved successfully", "data": { "number": "+2348031234567", "iso": "NG", "call": { "perMinute": 0.36, "available": true }, "text": { "perPart": 0.49, "available": true } }}/call-text/numbers/:numberId/messagesSend a text
Sends a text from one of your numbers to any country we can reach. It’s charged per part at the destination’s price, and refunded automatically if it isn’t delivered.
Path parameters
numberIdstringrequiredThe id of one of your active numbers.
Body
tostringrequiredInternational form, e.g. "+2348031234567".
bodystringrequiredUp to 1,600 characters.
Errors
- 400The number isn’t active, the destination can’t be texted, the balance is too low, or today’s limit is reached.
curl -X POST "https://xero-sms-backend.onrender.com/api/v1/public/call-text/numbers/b1c9e7a2-3f4d-4e8b-a6c5-9d0e1f2a3b4c/messages" \ -H "X-Api-Key: $XEROSMS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"to":"+2348031234567","body":"Hello from XeroSMS"}'{ "statusCode": 200, "success": true, "message": "Message sent successfully", "data": { "id": "c2f0a7d4-…", "lineId": "b1c9e7a2-3f4d-4e8b-a6c5-9d0e1f2a3b4c", "direction": "outbound", "counterpart": "+2348031234567", "body": "Hello from XeroSMS", "price": 0.49, "status": "queued", "createdAt": "2026-10-15T09:41:07.215Z" }}/call-text/numbers/:numberId/messagesRead messages
The newest 200 texts sent from or received by a number, newest first. Each number gets 3 incoming texts free a month; after that each costs $0.30 from your balance.
Path parameters
numberIdstringrequiredThe number’s id.
curl "https://xero-sms-backend.onrender.com/api/v1/public/call-text/numbers/b1c9e7a2-3f4d-4e8b-a6c5-9d0e1f2a3b4c/messages" \ -H "X-Api-Key: $XEROSMS_API_KEY"{ "statusCode": 200, "success": true, "message": "Messages retrieved successfully", "data": [ { "id": "e81b…", "direction": "inbound", "counterpart": "+14155550188", "body": "See you at 6", "price": 0, "locked": false, "createdAt": "2026-10-15T10:02:44.031Z" } ]}/call-text/numbers/:numberId/messages/unlockUnlock texts
Pays for locked incoming texts so they can be read: oldest first, as far as your balance goes, at the incoming-text price. Send a counterpart to unlock one conversation; without it, every locked text on the number.
Path parameters
numberIdstringrequiredThe number’s id.
Body
counterpartstringOnly texts from this number, e.g. "+14155550188".
Errors
- 400Your balance is below the price of one text.
curl -X POST "https://xero-sms-backend.onrender.com/api/v1/public/call-text/numbers/b1c9e7a2-3f4d-4e8b-a6c5-9d0e1f2a3b4c/messages/unlock" \ -H "X-Api-Key: $XEROSMS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"counterpart":"+14155550188"}'{ "statusCode": 200, "success": true, "message": "Messages unlocked", "data": { "unlocked": 2, "stillLocked": 0, "price": 0.3 }}/call-text/numbers/:numberId/callsCall history
The newest 100 calls made or received on a number, with how long they lasted and what they cost.
Path parameters
numberIdstringrequiredThe number’s id.
curl "https://xero-sms-backend.onrender.com/api/v1/public/call-text/numbers/b1c9e7a2-3f4d-4e8b-a6c5-9d0e1f2a3b4c/calls" \ -H "X-Api-Key: $XEROSMS_API_KEY"{ "statusCode": 200, "success": true, "message": "Calls retrieved successfully", "data": [ { "id": "5d7c…", "direction": "outbound", "counterpart": "+447911123456", "status": "completed", "durationSeconds": 184, "price": 0.4, "answeredAt": "2026-10-15T11:10:03.000Z", "endedAt": "2026-10-15T11:13:07.000Z", "createdAt": "2026-10-15T11:09:55.000Z" } ]}/call-text/numbers/:numberId/renewRenew a suspended number
Brings back a number that was suspended because a renewal couldn’t be paid, and charges a month. Active numbers renew on their own, so this refuses them.
Path parameters
numberIdstringrequiredThe number’s id.
Errors
- 400The number is active or already released, or the balance is too low.
curl -X PATCH "https://xero-sms-backend.onrender.com/api/v1/public/call-text/numbers/b1c9e7a2-3f4d-4e8b-a6c5-9d0e1f2a3b4c/renew" \ -H "X-Api-Key: $XEROSMS_API_KEY"{ "statusCode": 200, "success": true, "message": "Number renewed successfully", "data": { "id": "b1c9e7a2-3f4d-4e8b-a6c5-9d0e1f2a3b4c", "phoneNumber": "+12125550123", "country": "US", "monthlyPrice": 4.2, "status": "active", "renewsAt": "2026-11-14T09:30:00.000Z", "createdAt": "2026-10-15T09:30:00.000Z", "updatedAt": "2026-10-15T09:30:00.000Z" }}/call-text/numbers/:numberId/cancelRelease a number
Gives a number up immediately. The current month isn’t refunded, and a released number can’t be renewed or bought back.
Path parameters
numberIdstringrequiredThe number’s id.
curl -X PATCH "https://xero-sms-backend.onrender.com/api/v1/public/call-text/numbers/b1c9e7a2-3f4d-4e8b-a6c5-9d0e1f2a3b4c/cancel" \ -H "X-Api-Key: $XEROSMS_API_KEY"{ "statusCode": 200, "success": true, "message": "Number released successfully", "data": { "id": "b1c9e7a2-3f4d-4e8b-a6c5-9d0e1f2a3b4c", "phoneNumber": "+12125550123", "country": "US", "monthlyPrice": 4.2, "status": "released", "renewsAt": "2026-11-14T09:30:00.000Z", "createdAt": "2026-10-15T09:30:00.000Z", "updatedAt": "2026-10-15T09:30:00.000Z" }}Reference
Statuses
SMS orders
| Status | Meaning |
|---|---|
pending | Waiting for the code. Keep checking. |
completed | The code arrived, or you closed the order. |
refunded | You cancelled it, or the provider gave the number back. The cost is in your wallet again. |
expired | The number timed out without a code. The cost is in your wallet again. |
cancelled | Closed at the provider without a code. |
Numbers
| Status | Meaning |
|---|---|
active | Working. Renews on renewsAt. |
suspended | A renewal couldn’t be paid. Released three days later unless renewed. |
released | Given up. It can’t be used again. |
Texts you send
| Status | Meaning |
|---|---|
queued | Accepted and waiting to go out. |
sent | Handed to the carrier. |
delivered | Reached the phone. |
undelivered | Didn’t arrive. The price is refunded. |
failed | Couldn’t be sent. The price is refunded. |
Calls
| Status | Meaning |
|---|---|
ringing | Not answered yet. |
in-progress | Connected. |
completed | Ended after being answered. |
busy | The other line was busy. |
no-answer | Nobody picked up. |
failed / canceled | Didn’t connect. |
Reference
Changelog
October 2026
API prices are 30% lower than in the app.
October 2026
Call & Text: buy US and Canadian numbers, send and read texts, see call history.
October 2026
API keys are self-serve. Create one instantly in Developer settings.
Ready to build?
Create a key in a few seconds. Questions about the API? Write to info@xerosms.com.