All API resources
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.
Add a DID for sale
POST/sellers/did/add
Lists a new phone number (DID) for sale on the DID market under your seller account. The number appears in the market while its status is idle. Returns a confirmation message; call List your DIDs to get the new i_did. Free, except anonymous listings, which charge the anonymous DID fee to your seller balance. Point voice numbers at sip01.telecomsxchange.com (SIP) and SMS numbers at smpp01.telecomsxchange.com port 2776 (SMPP 3.4 or 5.0).
Parameters
numberintegerform fieldRequiredThe phone number in international format, digits only, 4 to 15 digits. A leading + is accepted and dropped; leading zeros are dropped.
price_1numberform fieldRequiredPrice per minute, in USD, the buyer pays for incoming voice calls.
interval_1integerform fieldRequiredBilling increment in seconds, 1 to 300 (for example 1 for per-second or 60 for per-minute billing).
smpp_pricenumberform fieldRequiredPrice per incoming SMS, in USD. Send 0 for numbers without SMS.
periodic_feenumberform fieldRequiredRecurring fee, in USD, charged to the buyer every periodic_interval.
periodic_intervalstringform fieldRequiredHow often periodic_fee is charged. Case-sensitive.
setup_feenumberform fieldRequiredOne-time fee, in USD, charged to the buyer at purchase. Send 0 for none.
parentstringform fieldRequiredWho may buy the number: international (anyone, shown as Any in the portal) or domestic (local buyers only, shown as Local Only).
statusstringform fieldRequiredidle lists the number for sale; blocked hides it from the market.
capacityintegerform fieldRequiredNumber of simultaneous calls the number supports.
voiceintegerform fieldOptional1 if the number receives voice calls. At least one of voice, sms, fax and video must be 1.
smsintegerform fieldOptional1 if the number receives SMS.
faxintegerform fieldOptional1 if the number receives fax.
videointegerform fieldOptional1 if the number receives video calls.
did_typestringform fieldOptionalNumber type shown to buyers and used by the market's did_type filter, for example national, mobile or tollfree.
notesstringform fieldOptionalFree-text notes shown to buyers, for example the documents you need.
verification_requiredintegerform fieldOptional1 if buyers must send identity documents before the number is activated.
documents_verifiedintegerform fieldOptionalDocuments-verified flag stored with the number.
anonymousintegerform fieldOptional1 to sell the number anonymously (buyers see the seller as Anonymous). Charges the anonymous DID fee to your seller balance.
Errors
| Message | When |
|---|---|
"DID number should contain only digits" | number is missing or not an integer |
"DID number should be of length 4..15 digits" | number has fewer than 4 or more than 15 digits |
"This DID number already exists in the system" | the number is already listed |
"Local Requirements can only be 'Any' or 'Local Only'" | parent is missing or not international or domestic |
"Price should be numeric" | price_1 is missing or not a number |
"SMS Price should be numeric" | smpp_price is missing or not a number |
"Interval should contain only digits" | interval_1 is missing or not an integer |
"Voice can be only 1 or 0" | voice is not 0 or 1 (SMS, Fax and Video return the same message with their own name) |
"Voice SMS Fax or Video access should be enabled" | voice, sms, fax and video are all 0 or missing |
"Capacity should be numeric" | capacity is missing or not a number |
" Interval should be between 1 and 300 seconds" | interval_1 is below 1 or above 300 |
"Periodic Fee should be numeric" | periodic_fee is missing or not a number |
"Periodic Interval should be one of Monthly, Quarterly or Annual" | periodic_interval is missing or another value |
"Setup Fee should be numeric" | setup_fee is missing or not a number |
"Only idle or blocked status allowed" | status is missing or another value |
"Not enough balance to pay for DID anonymous fee <fee>" | anonymous is 1 and your seller balance is below the anonymous DID fee |
"DID has not been added. DB ERROR. Please check all fields." | the number could not be saved |
curl --digest -u "$TCXC_USERNAME:$TCXC_API_KEY" -X POST \
"https://apiv2.telecomsxchange.com/sellers/did/add" \
-d number=19545550142 \
-d price_1=0.004 \
-d interval_1=60 \
-d smpp_price=0.005 \
-d periodic_fee=3.50 \
-d periodic_interval=Monthly \
-d setup_fee=1.00 \
-d parent=international \
-d status=idle \
-d capacity=5 \
-d voice=1 \
-d sms=1 \
-d fax=0 \
-d video=0 \
-d did_type=mobile \
-d notes='Proof of local address required' \
-d verification_required=0 \
-d documents_verified=0 \
-d anonymous=0import os
import requests
from requests.auth import HTTPDigestAuth
resp = requests.post(
"https://apiv2.telecomsxchange.com/sellers/did/add",
auth=HTTPDigestAuth(os.environ["TCXC_USERNAME"], os.environ["TCXC_API_KEY"]),
data={"number": "19545550142", "price_1": "0.004", "interval_1": "60", "smpp_price": "0.005", "periodic_fee": "3.50", "periodic_interval": "Monthly", "setup_fee": "1.00", "parent": "international", "status": "idle", "capacity": "5", "voice": "1", "sms": "1", "fax": "0", "video": "0", "did_type": "mobile", "notes": "Proof of local address required", "verification_required": "0", "documents_verified": "0", "anonymous": "0"},
)
print(resp.json())$ch = curl_init("https://apiv2.telecomsxchange.com/sellers/did/add");
curl_setopt_array($ch, [
CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
CURLOPT_USERPWD => getenv('TCXC_USERNAME') . ':' . getenv('TCXC_API_KEY'),
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(['number' => "19545550142", 'price_1' => "0.004", 'interval_1' => "60", 'smpp_price' => "0.005", 'periodic_fee' => "3.50", 'periodic_interval' => "Monthly", 'setup_fee' => "1.00", 'parent' => "international", 'status' => "idle", 'capacity' => "5", 'voice' => "1", 'sms' => "1", 'fax' => "0", 'video' => "0", 'did_type' => "mobile", 'notes' => "Proof of local address required", 'verification_required' => "0", 'documents_verified' => "0", 'anonymous' => "0"]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);{
"status": "success",
"message": "The DID has been successfully added."
}List your DIDs (seller)
POST/sellers/did/list
Lists the phone numbers you sell, newest first, with their prices, capabilities and status. Purchased numbers also show the buyer's login and customer ID. A pending price increase appears as an upcoming object on the number's row and as an extra row whose number is "<number> <effective date>" and whose i_did is 0. All matching numbers are returned in one reply. Free.
Parameters
prefixstringform fieldOptionalReturn only numbers that start with these digits.
countrystringform fieldOptionalReturn only numbers whose destination country name contains this text, for example United States.
descriptionstringform fieldOptionalReturn only numbers whose destination description contains this text, for example Mobile.
statusstringform fieldOptionalReturn only numbers in this state. Any other value returns all.
curl --digest -u "$TCXC_USERNAME:$TCXC_API_KEY" -X POST \
"https://apiv2.telecomsxchange.com/sellers/did/list" \
-d prefix=1954 \
-d country='United States' \
-d description=Fixed \
-d status=purchasedimport os
import requests
from requests.auth import HTTPDigestAuth
resp = requests.post(
"https://apiv2.telecomsxchange.com/sellers/did/list",
auth=HTTPDigestAuth(os.environ["TCXC_USERNAME"], os.environ["TCXC_API_KEY"]),
data={"prefix": "1954", "country": "United States", "description": "Fixed", "status": "purchased"},
)
print(resp.json())$ch = curl_init("https://apiv2.telecomsxchange.com/sellers/did/list");
curl_setopt_array($ch, [
CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
CURLOPT_USERPWD => getenv('TCXC_USERNAME') . ':' . getenv('TCXC_API_KEY'),
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(['prefix' => "1954", 'country' => "United States", 'description' => "Fixed", 'status' => "purchased"]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);{
"status": "success",
"dids": [
{
"i_did": "2318",
"number": "19545550142",
"price_1": "0.004",
"price_n": "0.004",
"interval_1": "60",
"interval_n": "60",
"periodic_fee": "3.5",
"periodic_interval": "Monthly",
"setup_fee": "1",
"billing_i_account": "1501",
"i_vendor": "114",
"status": "purchased",
"contact": "sip:19545550142@203.0.113.14:5060",
"contact2": "",
"smpp_contact": "smpp:buyer01:secret:19545550142@203.0.113.15:2776",
"notes": "",
"billed_to": "2026-11-21 10:51:17",
"monthly_start_ts": "2026-11-21 10:51:17",
"voice": "1",
"sms": "1",
"fax": "0",
"video": "0",
"capacity": "5",
"did_type": "national",
"verification_required": "0",
"documents_verified": "0",
"smpp_price": "0.005",
"is_nexmo": "0",
"email_warned": "0",
"anonymous": "0",
"anonymous_billed_to": "2026-10-21 10:51:17",
"parent": "international",
"config_changed": "0",
"anonymous_billed_ok": "0",
"country_code": "us",
"country_name": "UNITED STATES",
"description": "Fixed - Florida",
"customer_login": "acme-voice",
"i_customer": "3307"
}
]
}Update a DID you sell
POST/sellers/did/edit/{i_did}
Changes the prices, capabilities, status and document settings of a number you sell. Send every field, as on Add a DID for sale: missing fields fail validation. Price changes are dated 30 days ahead. A price increase on a number that has been bought takes effect after 30 days, and the other changes sent in the same request are not applied either; send those in a separate request without the increase. Setting documents_verified to 1 emails the buyer that their documents were accepted. Free.
Parameters
i_didintegerpathRequiredID of the number, from List your DIDs.
numberintegerform fieldOptionalNew phone number, 4 to 15 digits. Required while the number is not purchased; a purchased number cannot be changed.
price_1numberform fieldRequiredPrice per minute, in USD, for incoming voice calls.
interval_1integerform fieldRequiredBilling increment in seconds.
smpp_pricenumberform fieldRequiredPrice per incoming SMS, in USD.
periodic_feenumberform fieldRequiredRecurring fee, in USD.
periodic_intervalstringform fieldRequiredHow often periodic_fee is charged.
setup_feenumberform fieldRequiredOne-time fee, in USD, charged at purchase.
parentstringform fieldRequiredWho may buy the number: international (anyone) or domestic (local buyers only).
capacityintegerform fieldRequiredNumber of simultaneous calls the number supports.
statusstringform fieldOptionalRequired while the number is not purchased. A purchased number stays purchased.
voiceintegerform fieldOptional1 if the number receives voice calls. At least one of voice, sms, fax and video must be 1.
smsintegerform fieldOptional1 if the number receives SMS.
faxintegerform fieldOptional1 if the number receives fax.
videointegerform fieldOptional1 if the number receives video calls.
did_typestringform fieldOptionalNumber type, for example national, mobile or tollfree. Sending nothing clears it.
notesstringform fieldOptionalNotes shown to buyers. Sending nothing clears them.
verification_requiredintegerform fieldOptional1 if buyers must send documents. Cannot be turned on for a purchased number.
documents_verifiedintegerform fieldOptional1 to mark the buyer's documents as accepted (only when verification_required is on). Emails the buyer.
Errors
| Message | When |
|---|---|
"DID number should be of length 4..15 digits" | the number is not purchased and number is missing or not 4 to 15 digits |
"DID number should contain only digits" | the number is not purchased and number is not an integer |
"DID not found." | i_did is not one of your numbers |
"Price should be numeric" | price_1 is missing or not a number |
"SMS Price should be numeric" | smpp_price is missing or not a number |
"Interval should contain only digits" | interval_1 is missing or not an integer |
"Periodic Fee should be numeric" | periodic_fee is missing or not a number |
"Periodic Interval should be one of Monthly, Quarterly or Annual" | periodic_interval is missing or another value |
"Parent can only be international or domestic" | parent is missing or another value |
"Setup Fee should be numeric" | setup_fee is missing or not a number |
"Voice can be only 1 or 0" | voice is not 0 or 1 (SMS, Fax and Video return the same message with their own name) |
"Voice SMS Fax or Video access should be enabled" | voice, sms, fax and video are all 0 or missing |
"Capacity should be numeric" | capacity is missing or not a number |
"Only idle or blocked status allowed" | the number is not purchased and status is missing or another value |
"You can't enable document verification for a purchased DID" | verification_required is 1 for a purchased number that did not require it |
"You can not verify documents for DIDs which do not have it enabled, enable verification first" | documents_verified is 1 but the number does not require verification |
"You can not change number of purchased DID" | number differs from the current number of a purchased DID |
curl --digest -u "$TCXC_USERNAME:$TCXC_API_KEY" -X POST \
"https://apiv2.telecomsxchange.com/sellers/did/edit/2318" \
-d number=19545550142 \
-d price_1=0.004 \
-d interval_1=60 \
-d smpp_price=0.005 \
-d periodic_fee=3.50 \
-d periodic_interval=Monthly \
-d setup_fee=1.00 \
-d parent=international \
-d capacity=5 \
-d status=idle \
-d voice=1 \
-d sms=1 \
-d fax=0 \
-d video=0 \
-d did_type=national \
-d notes='Proof of local address required' \
-d verification_required=0 \
-d documents_verified=0import os
import requests
from requests.auth import HTTPDigestAuth
resp = requests.post(
"https://apiv2.telecomsxchange.com/sellers/did/edit/2318",
auth=HTTPDigestAuth(os.environ["TCXC_USERNAME"], os.environ["TCXC_API_KEY"]),
data={"number": "19545550142", "price_1": "0.004", "interval_1": "60", "smpp_price": "0.005", "periodic_fee": "3.50", "periodic_interval": "Monthly", "setup_fee": "1.00", "parent": "international", "capacity": "5", "status": "idle", "voice": "1", "sms": "1", "fax": "0", "video": "0", "did_type": "national", "notes": "Proof of local address required", "verification_required": "0", "documents_verified": "0"},
)
print(resp.json())$ch = curl_init("https://apiv2.telecomsxchange.com/sellers/did/edit/2318");
curl_setopt_array($ch, [
CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
CURLOPT_USERPWD => getenv('TCXC_USERNAME') . ':' . getenv('TCXC_API_KEY'),
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(['number' => "19545550142", 'price_1' => "0.004", 'interval_1' => "60", 'smpp_price' => "0.005", 'periodic_fee' => "3.50", 'periodic_interval' => "Monthly", 'setup_fee' => "1.00", 'parent' => "international", 'capacity' => "5", 'status' => "idle", 'voice' => "1", 'sms' => "1", 'fax' => "0", 'video' => "0", 'did_type' => "national", 'notes' => "Proof of local address required", 'verification_required' => "0", 'documents_verified' => "0"]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);{
"status": "success",
"message": "DID entry has been updated. "
}Search the DID market
POST/number/market
Searches phone numbers for sale from TCXC sellers and, for international searches, from partner inventory. Give at least one of prefix, country or description. Returns each number with its setup fee, recurring fee, per-minute and per-SMS prices (USD, including the TCXC commission), capabilities and seller. Numbers already sold are hidden. Free.
Parameters
prefixstringform fieldOptionalReturn numbers that start with these digits, for example 1954. Prefixes shorter than 3 digits that contain a 1 are rejected.
countrystringform fieldOptionalDestination country name, or part of it, for example United Kingdom.
descriptionstringform fieldOptionalDestination description, or part of it, for example Mobile.
sellerstringform fieldOptionalReturn only this seller's numbers, by seller login. An unknown login returns no seller numbers.
did_typestringform fieldOptionalNumber type.
voiceintegerform fieldOptional1 returns only numbers that receive voice calls.
smsintegerform fieldOptional1 returns only numbers that receive SMS.
faxintegerform fieldOptional1 returns only numbers that receive fax.
videointegerform fieldOptional1 returns only numbers that receive video calls.
parentstringform fieldOptionalinternational searches numbers open to all buyers, including partner inventory; domestic searches local-only numbers.
Errors
| Message | When |
|---|---|
"You have to specify some search pattern, prefix or country or description" | prefix, country and description are all empty |
"You have to specify longer prefix for this country code" | prefix is shorter than 3 digits and contains a 1 |
curl --digest -u "$TCXC_USERNAME:$TCXC_API_KEY" -X POST \
"https://apiv2.telecomsxchange.com/number/market" \
-d prefix=1954 \
-d country='United Kingdom' \
-d description=Mobile \
-d seller=acme-numbers \
-d did_type=mobile \
-d voice=1 \
-d sms=0 \
-d fax=0 \
-d video=0 \
-d parent=internationalimport os
import requests
from requests.auth import HTTPDigestAuth
resp = requests.post(
"https://apiv2.telecomsxchange.com/number/market",
auth=HTTPDigestAuth(os.environ["TCXC_USERNAME"], os.environ["TCXC_API_KEY"]),
data={"prefix": "1954", "country": "United Kingdom", "description": "Mobile", "seller": "acme-numbers", "did_type": "mobile", "voice": "1", "sms": "0", "fax": "0", "video": "0", "parent": "international"},
)
print(resp.json())$ch = curl_init("https://apiv2.telecomsxchange.com/number/market");
curl_setopt_array($ch, [
CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
CURLOPT_USERPWD => getenv('TCXC_USERNAME') . ':' . getenv('TCXC_API_KEY'),
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(['prefix' => "1954", 'country' => "United Kingdom", 'description' => "Mobile", 'seller' => "acme-numbers", 'did_type' => "mobile", 'voice' => "1", 'sms' => "0", 'fax' => "0", 'video' => "0", 'parent' => "international"]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);{
"status": "success",
"dids": [
{
"i_did": "2318",
"number": "441615550123",
"price_1": "0.0055",
"price_n": "0.0055",
"interval_1": "60",
"interval_n": "60",
"periodic_fee": "3.8500",
"periodic_interval": "Monthly",
"setup_fee": "1.1000",
"i_vendor": "114",
"status": "idle",
"notes": "",
"voice": "1",
"sms": "0",
"fax": "0",
"video": "0",
"capacity": "5",
"did_type": "national",
"verification_required": "0",
"documents_verified": "0",
"smpp_price": "0.0000",
"is_nexmo": "0",
"email_warned": "0",
"anonymous": "0",
"anonymous_billed_to": "2026-10-01 00:00:00",
"parent": "international",
"config_changed": "0",
"vendor_name": "Acme",
"vendor_short_memo": "UK geographic numbers",
"country_code": "gb",
"country_name": "UNITED KINGDOM",
"description": "Fixed - Manchester"
}
]
}Purchase a DID
POST/number/purchase
Buys a phone number and points it at your SIP and/or SMPP endpoint. Charges the setup fee and the first recurring fee (both including commission) at once to the billing account, or to the account whose balance it uses; later fees renew automatically every periodic_interval. Numbers that need documents start working once the seller verifies them. Returns a confirmation message.
Parameters
i_didintegerform fieldOptionalID of the number, from Search the DID market. Required unless is_nexmo is 1.
billing_i_accountintegerform fieldRequiredYour account to charge, from List buyer accounts. If it uses another account's balance, that account is charged.
contactstringform fieldOptionalWhere to send calls, as sip:<user>@<host>[:port]. Required for voice, fax or video numbers. Stored in lower case.
contact2stringform fieldOptionalFailover SIP address, same format as contact.
smpp_contactstringform fieldOptionalWhere to deliver SMS, as smpp:<login>:<password>:<number>@<host>:<port>. Required for SMS numbers.
is_nexmointegerform fieldOptionalSet to 1 when buying a number from partner inventory (rows marked is_nexmo 1 in the market). The number is then identified by country and number instead of i_did.
countrystringform fieldOptionalPartner inventory only: the row's ISO country code, from the market's country field.
numberstringform fieldOptionalPartner inventory only: the number to buy.
voiceintegerform fieldOptionalPartner inventory only, and then required: 1 to enable voice on the number.
smsintegerform fieldOptionalPartner inventory only, and then required: 1 to enable SMS on the number.
Errors
| Message | When |
|---|---|
"Point to SIP should be in format sip:12345abc@sip.domain.com:5060" | the number has voice, fax or video and contact is missing or malformed |
"Point to SIP(secondary) should be in format sip:12345abc@sip.domain.com:5060" | contact2 is given and malformed |
"Point to SMPP should be in format smpp:login:pass:12345abc@smpp.domain.com:2776" | the number has SMS and smpp_contact is missing or malformed |
"Can not purchase DID on this account" | billing_i_account is not one of your accounts |
"This DID can not be purchased, it has been already sold to other buyer" | the number is not available, or i_did does not exist |
"Selected account does not have enough funds: this DID needs $<total> up front ($<setup> setup + $<fee> first <interval> fee). Choose another account or top up." | balance plus credit limit is below the setup fee plus the first recurring fee |
"DID subscribe error:<reason>" | a partner-inventory number cannot be reserved |
"DID subscribe/configure error:<reason>" | a partner-inventory number is reserved but cannot be configured |
curl --digest -u "$TCXC_USERNAME:$TCXC_API_KEY" -X POST \
"https://apiv2.telecomsxchange.com/number/purchase" \
-d i_did=2318 \
-d billing_i_account=1501 \
-d contact=sip:19545550142@203.0.113.14:5060 \
-d contact2=sip:19545550142@203.0.113.24:5060 \
-d smpp_contact=smpp:buyer01:secret:19545550142@203.0.113.15:2776 \
-d is_nexmo=0 \
-d country=GB \
-d number=447700900123 \
-d voice=1 \
-d sms=1import os
import requests
from requests.auth import HTTPDigestAuth
resp = requests.post(
"https://apiv2.telecomsxchange.com/number/purchase",
auth=HTTPDigestAuth(os.environ["TCXC_USERNAME"], os.environ["TCXC_API_KEY"]),
data={"i_did": "2318", "billing_i_account": "1501", "contact": "sip:19545550142@203.0.113.14:5060", "contact2": "sip:19545550142@203.0.113.24:5060", "smpp_contact": "smpp:buyer01:secret:19545550142@203.0.113.15:2776", "is_nexmo": "0", "country": "GB", "number": "447700900123", "voice": "1", "sms": "1"},
)
print(resp.json())$ch = curl_init("https://apiv2.telecomsxchange.com/number/purchase");
curl_setopt_array($ch, [
CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
CURLOPT_USERPWD => getenv('TCXC_USERNAME') . ':' . getenv('TCXC_API_KEY'),
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(['i_did' => "2318", 'billing_i_account' => "1501", 'contact' => "sip:19545550142@203.0.113.14:5060", 'contact2' => "sip:19545550142@203.0.113.24:5060", 'smpp_contact' => "smpp:buyer01:secret:19545550142@203.0.113.15:2776", 'is_nexmo' => "0", 'country' => "GB", 'number' => "447700900123", 'voice' => "1", 'sms' => "1"]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);{
"status": "success",
"message": "DID has been purchased"
}List purchased DIDs
POST/number/list
Lists the numbers you have bought, ordered by number, with their current prices (including commission), the account billed, where calls and SMS are sent and the next billing date. A pending price increase appears as an upcoming object on the row and as an extra row dated in its number. Free.
Parameters
prefixstringform fieldOptionalReturn only numbers that start with these digits.
countrystringform fieldOptionalReturn only numbers whose destination country name contains this text.
descriptionstringform fieldOptionalReturn only numbers whose destination description contains this text.
pagerintegerform fieldOptionalPage size. Takes effect only together with an off of 1 or more.
offintegerform fieldOptionalOffset of the first row.
curl --digest -u "$TCXC_USERNAME:$TCXC_API_KEY" -X POST \
"https://apiv2.telecomsxchange.com/number/list" \
-d prefix=44 \
-d country='United Kingdom' \
-d description=Mobile \
-d pager=50 \
-d off=50import os
import requests
from requests.auth import HTTPDigestAuth
resp = requests.post(
"https://apiv2.telecomsxchange.com/number/list",
auth=HTTPDigestAuth(os.environ["TCXC_USERNAME"], os.environ["TCXC_API_KEY"]),
data={"prefix": "44", "country": "United Kingdom", "description": "Mobile", "pager": "50", "off": "50"},
)
print(resp.json())$ch = curl_init("https://apiv2.telecomsxchange.com/number/list");
curl_setopt_array($ch, [
CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
CURLOPT_USERPWD => getenv('TCXC_USERNAME') . ':' . getenv('TCXC_API_KEY'),
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(['prefix' => "44", 'country' => "United Kingdom", 'description' => "Mobile", 'pager' => "50", 'off' => "50"]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);{
"status": "success",
"dids": [
{
"i_did": "2318",
"number": "441615550123",
"price_1": "0.0055",
"price_n": "0.0055",
"interval_1": "60",
"interval_n": "60",
"periodic_fee": "3.8500",
"periodic_interval": "Monthly",
"setup_fee": "1.1000",
"i_vendor": "114",
"status": "purchased",
"contact": "sip:441615550123@203.0.113.14:5060",
"contact2": "",
"smpp_contact": "",
"notes": "",
"billed_to": "2026-11-21 10:51:17",
"monthly_start_ts": "2026-11-21 10:51:17",
"voice": "1",
"sms": "0",
"fax": "0",
"video": "0",
"capacity": "5",
"did_type": "national",
"verification_required": "0",
"documents_verified": "0",
"smpp_price": "0.0000",
"is_nexmo": "0",
"email_warned": "0",
"anonymous": "0",
"anonymous_billed_to": "2026-10-01 00:00:00",
"parent": "international",
"config_changed": "0",
"account_name": "Main trunk",
"vendor_name": "Acme",
"country_code": "gb",
"country_name": "UNITED KINGDOM",
"description": "Fixed - Manchester"
}
]
}Update a purchased DID's destination
POST/number/update
Changes where a number you bought sends calls (contact, contact2) and SMS (smpp_contact). Free.
Parameters
editintegerform fieldRequiredID (i_did) of the purchased number, from List purchased DIDs. This is the record ID, not the phone number.
contactstringform fieldOptionalWhere to send calls, as sip:<user>@<host>[:port]. Required for voice, fax or video numbers. Stored in lower case.
contact2stringform fieldOptionalFailover SIP address, same format. Send it empty to remove it.
smpp_contactstringform fieldOptionalWhere to deliver SMS, as smpp:<login>:<password>:<number>@<host>:<port>. Required for SMS numbers.
sip_srvintegerform fieldOptional1 to resolve the SIP host by DNS SRV (_sip._udp. is inserted after the @ of contact and contact2). Give the host without a port.
Errors
| Message | When |
|---|---|
"There was an error." | edit is not one of your purchased numbers |
curl --digest -u "$TCXC_USERNAME:$TCXC_API_KEY" -X POST \
"https://apiv2.telecomsxchange.com/number/update" \
-d edit=2318 \
-d contact=sip:441615550123@203.0.113.14:5060 \
-d contact2=sip:441615550123@203.0.113.24:5060 \
-d smpp_contact=smpp:buyer01:secret:441615550123@203.0.113.15:2776 \
-d sip_srv=0import os
import requests
from requests.auth import HTTPDigestAuth
resp = requests.post(
"https://apiv2.telecomsxchange.com/number/update",
auth=HTTPDigestAuth(os.environ["TCXC_USERNAME"], os.environ["TCXC_API_KEY"]),
data={"edit": "2318", "contact": "sip:441615550123@203.0.113.14:5060", "contact2": "sip:441615550123@203.0.113.24:5060", "smpp_contact": "smpp:buyer01:secret:441615550123@203.0.113.15:2776", "sip_srv": "0"},
)
print(resp.json())$ch = curl_init("https://apiv2.telecomsxchange.com/number/update");
curl_setopt_array($ch, [
CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
CURLOPT_USERPWD => getenv('TCXC_USERNAME') . ':' . getenv('TCXC_API_KEY'),
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(['edit' => "2318", 'contact' => "sip:441615550123@203.0.113.14:5060", 'contact2' => "sip:441615550123@203.0.113.24:5060", 'smpp_contact' => "smpp:buyer01:secret:441615550123@203.0.113.15:2776", 'sip_srv' => "0"]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);{
"status": "success",
"message": "DID entry has been updated."
}Cancel a purchased DID
POST/number/unsubscribe
Cancels a number you bought. The number stops working and returns to the market at once, its SIP and SMPP destinations and document verification are cleared, and no further recurring fees are charged. Fees already paid are not refunded. The seller is emailed a cancellation notice.
Parameters
unsubscribeintegerform fieldRequiredID (i_did) of the purchased number, from List purchased DIDs.
Errors
| Message | When |
|---|---|
"There was an error" | unsubscribe is not one of your purchased numbers |
"Error: <reason>" | a partner-inventory number cannot be released; returned as plain text, not JSON |
curl --digest -u "$TCXC_USERNAME:$TCXC_API_KEY" -X POST \
"https://apiv2.telecomsxchange.com/number/unsubscribe" \
-d unsubscribe=2318import os
import requests
from requests.auth import HTTPDigestAuth
resp = requests.post(
"https://apiv2.telecomsxchange.com/number/unsubscribe",
auth=HTTPDigestAuth(os.environ["TCXC_USERNAME"], os.environ["TCXC_API_KEY"]),
data={"unsubscribe": "2318"},
)
print(resp.json())$ch = curl_init("https://apiv2.telecomsxchange.com/number/unsubscribe");
curl_setopt_array($ch, [
CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
CURLOPT_USERPWD => getenv('TCXC_USERNAME') . ':' . getenv('TCXC_API_KEY'),
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(['unsubscribe' => "2318"]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);{
"status": "success",
"message": "Unsubscribed successfully"
}