All API resources
API reference
70 endpoints for buying and selling on TelecomsXchange, each with its parameters, a request in cURL, Python and PHP, and an example response.
The TelecomsXchange API is organised around the same objects you use in the members portal: accounts, routes and interconnects, phone numbers, eSIMs, records and balances. It accepts form-encoded request bodies, returns JSON, and uses HTTP Digest authentication. Everything you can do in the portal as a buyer or a seller, you can automate here.
Base URL#
https://apiv2.telecomsxchange.comEvery endpoint in this reference is relative to that host, except the message classifiers (Open Text Shield), which
are served from https://ots.telecomsxchange.com and need no credentials.
The whole reference is also available as an OpenAPI 3.0 spec for code generators, API
clients and AI agents, and each page has a Markdown version (add .md to the address, such as
/reference/hlr.md).
Authentication#
Authenticate with HTTP Digest: your portal username as the user name and your API key as the password. Calls run as your account, with its balances, routes and limits, so keep the key secret: never put it in client-side code or a public repository.
- In the members portal, go to Settings → Profile & Preferences.
- Tick Allow API Access and click Save.
- Copy the API Key. Regenerate replaces it at once, and the old key stops working.
curl --digest -u "$TCXC_USERNAME:$TCXC_API_KEY" -X POST \
https://apiv2.telecomsxchange.com/buyers/balanceA request without credentials gets 401 Unauthorized with a Digest challenge, which every HTTP client that supports
Digest answers automatically. Wrong credentials, or Allow API Access switched off, return:
{"status": "fail", "error": "authorization error"}Requests and responses#
- Send parameters as
application/x-www-form-urlencodedform fields, or in the query string forGETendpoints. Path parameters are part of the URL, such as the number in/buyers/hlr/lookup/{number}. - Every response is JSON with a
statusfield:successwhen the call worked,errororfailwhen it didn't. - Many buyer endpoints take
i_account, the ID of one of your accounts. Get the IDs from List buyer accounts. - List endpoints page with
pager(rows per page) andoff(the offset of the first row).
Errors#
A call that fails validation answers HTTP 200 with status: error and a message that says what to fix:
{"status": "error", "message": "Account balance insufficient to run query"}Each endpoint in this reference lists the messages it can return and when. Check status on every reply rather than
relying on the HTTP status code.
| HTTP status | Meaning |
|---|---|
200 |
The request was processed. Read status for the outcome. |
401 |
Missing or wrong credentials, or API access is off for the account. |
429 |
Too many requests. Wait and retry with backoff. |
Rate limits#
Each account has an hourly request quota and a per-second cap. Above either, the API answers 429 with
{"status": "error", "message": "Rate limit exceeded"}. Contact support if your
integration needs more.
Calls that spend money#
Some calls charge a balance exactly as the portal does: purchasing a phone number or an eSIM, HLR lookups ($0.05 each), and route tests. Their reference entries say what they charge and when. There is no sandbox, so test against a low-balance account first.
Use the API from an AI assistant#
TelecomsXchange publishes an MCP server that gives assistants such as Claude the same endpoints with your API key, so you can search routes, read records or check a balance in a chat.
Resources
- AccountsA buyer account is how traffic reaches TelecomsXchange: a SIP trunk authorised by IP or digest login, an SMPP bind, or an IoT (MQTT) login. Each account has its own balance (or uses another account's), its own purchased routes and its own alerts. Create accounts, change their credentials and authorise extra IP addresses.3 endpoints
- Voice and SMS marketMarket View is the exchange's live order book: every seller's routes with their current price, quality (ASR, ACD) and capacity. Search it for a destination, download a seller's full rate deck, read the busiest destinations, and list your active calls and call or message records.11 endpoints
- InterconnectsBuying a route from Market View creates an interconnect between one of your accounts and the seller's route. Traffic sent with the route's tech prefix then terminates on it, billed per minute or per message from the account's balance. Purchasing is free; you pay only for traffic.2 endpoints
- Routing groupsA routing group combines several purchased routes behind one tech prefix (444 and three digits) and chooses a route for each call or message by least cost, failover order or weighted load balancing, with optional rules per destination or caller prefix.13 endpoints
- Phone numbers (DIDs)Buy and sell virtual phone numbers. Buyers search the number market, purchase numbers and point them at a SIP or SMPP endpoint; sellers list their numbers with setup and recurring fees. Numbers renew automatically from the billing account's balance.8 endpoints
- eSIMsPrepaid data eSIMs for single countries, regions and the whole world, sold by the eSIM providers on the exchange, such as Airalo and eSimplified. Purchases are charged to an account balance and return the activation code, LPA string and QR code at once.9 endpoints
- HLR lookupsAsk the mobile networks about a number: its current carrier and MCC/MNC, whether it has been ported and whether it is roaming. Each lookup costs $0.05 and is charged as soon as it is sent.2 endpoints
- Balances and paymentsRead buyer account balances and payment history, and the seller balance and payout history.4 endpoints
- ReportsTraffic summaries by period, and the detail records for IoT (MQTT) messages.3 endpoints
- MessagesThe exchange's internal messaging between buyers and sellers: read your inbox, reply, write to a seller about one of their routes, and, as a seller, list your buyers and message them.8 endpoints
- ToolsHelpers for testing and integration: list seller IDs and score a phone number by whether it has carried traffic on the exchange.1 endpoint
- Message classification (AI)Open Text Shield, the TelecomsXchange SMS classifiers, served from their own host. The threat classifier labels a message as ham, spam or phishing; the category classifier labels what kind of message it is.6 endpoints