API reference
Numbers
How these fit together: the Phone numbers guide.
List numbers
get
Lists the numbers the organization holds — on hold, assigned, suspended or being released.
Newest first. By default every number you hold — reserved, assigned, suspended and releasing — never one still on sale (search those with GET /v1/numbers/available); filter by status, or by capability (sms lists the numbers you may make SMS senders). Your own numbers, so each is answered in full, with its fees, inbound route, DLT header and version.
Access: an organization key with the numbers:read scope.
Query parameters
limitintegerHow many items to return.
cursorstringThe
nextCursorof the previous page. Omit for the first page.statusstringOnly numbers in this status. Default: every one you hold.
One of
reservedassignedsuspendedreleasingcapabilitystringOnly numbers with this capability —
smslists the long codes you may make SMS senders (POST /v1/numbers/{id}/sms-sender).One of
smsvoice_inboundvoice_outboundreferencestringOnly numbers carrying this
reference(yours, given when ordering or byPATCH).
Response 200PublicPhoneNumberPage
dataPublicPhoneNumber[]RequiredIts fields are listed under Get number
nextCursorstring | nullRequiredPass back as
cursorfor the next page; null on the last.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/numbers' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"data": [
{
"assignedAt": "2026-11-05T10:00:00.000Z",
"capabilities": {
"sms": true,
"voiceInbound": true,
"voiceOutbound": true
},
"country": "IN",
"currency": "INR",
"dltHeaderId": "DLT_HEADER_ID",
"id": "ID",
"label": "LABEL",
"livemode": true,
"metadata": {
"businessId": "biz_42"
},
"monthlyFeeMinor": 1,
"number": "+918035550100",
"object": "phone_number",
"paidThrough": "2026-11-05T10:00:00.000Z",
"pendingCompliance": true,
"provider": "airtel",
"reference": "customer_8812",
"releasedAt": "2026-11-05T10:00:00.000Z",
"reservedUntil": "2026-11-05T10:00:00.000Z",
"route": {
"ai": {
"firstMessage": "FIRST_MESSAGE",
"instructions": "INSTRUCTIONS",
"optOut": {
"key": "KEY",
"phrases": [
"PHRASES"
],
"reply": "REPLY"
},
"session": {
"timeoutSeconds": 1,
"url": "URL"
},
"tools": [
{
"description": "DESCRIPTION",
"name": "NAME",
"parameters": {},
"url": "URL"
}
],
"transfer": {
"phoneId": "PHONE_ID",
"ringTimeoutSeconds": 5,
"whisper": "WHISPER"
}
},
"identity": null,
"kind": "none",
"targetId": "TARGET_ID"
},
"setupFeeMinor": 1,
"status": "reserved",
"suspensionReason": "non_payment",
"type": "local",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1,
"warnings": [
{
"agentId": "AGENT_ID",
"callType": "manual",
"code": "BILLING_RATE_UNAVAILABLE",
"direction": "inbound",
"message": "The Pay as you go plan does not price inbound AI calls on plivo, so calls to this number are refused (BILLING_RATE_UNAVAILABLE): the caller hears a short apology and the call is recorded failed until it does. GET /v1/pricing lists the plan's rates.",
"provider": "airtel",
"reason": "voice_key_missing",
"step": {
"index": 1,
"node": "main"
}
}
]
}
],
"nextCursor": "NEXT_CURSOR"
}Order number
post
Orders a number — from the platform’s inventory, or a carrier’s live stock at your plan’s price: holds it, and activates it (charging its setup fee and first month) when it can.
Send numberId with the version your search returned (inventory), or number with provider (a carrier’s stock your plan prices). The number is held and activated at once when it can — an approved business verification, the paperwork its type needs (a letter of authority; for a 140-series number a verified DLT header) and credit for the setup fee and first month — and the answer is 201 either way: otherwise activated is false, the number stays reserved until reservedUntil and pending says why, for POST /v1/numbers/{numberId}/activate once that is fixed. Refused with 409 NUMBER_NOT_AVAILABLE when it is no longer on sale, 409 NUMBER_RESERVATION_LIMIT at five numbers on hold (two until your business is verified), 409 NUMBER_VERSION_CONFLICT when it changed since your search (its price may have moved), and 422 NUMBER_NOT_PRICED for supplier stock your plan has no price for. A test key orders a sandbox number — by country (and areaCode or prefix), or a number its search offered — assigned at once, never bought, held or charged (livemode: false); orderId, reference and metadata work as live, its order ids its own. numberId (an inventory number) is refused to a test key.
Access: an organization key with the numbers:write scope.
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
areaCodestringWith
country: the area code as dialled at home (415; UK020,0161,0330) — a leading national trunk prefix (the UK’s 0) is dropped. Not withprefix.countrystringT7 — order by place: the cheapest number on sale in this country (ISO 3166-1 alpha-2) that you may order — the platform’s inventory first, then a carrier’s live stock at your plan’s price — narrowed by
areaCodeorprefix,typeandsms. Nothing that matches is409 NO_NUMBERS_AVAILABLE(try another area code).metadataRecord<string, string>T7: your identifiers for the number, set as it is held — copied onto every inbound call to it, as
PATCH /v1/numbers/{id}sets them. At most 20 keys (1–40 ofA-Za-z0-9_.-), values ≤ 500 characters. Never personal data.numberstringSupplier stock: a number from
GET /v1/numbers/availablewithsource: supplierandorderable: true, in E.164, with itsprovider. It is held at your plan’s number rate, and bought from the carrier when it activates.numberIdstring (uuid)An inventory number from
GET /v1/numbers/available(source: inventory), with itsversion.orderIdstringT7: your own id for this order, for good: the same
orderIdagain answers this order — the number it bought, as it is now — never a second number, however late the retry; with another request it is409 NUMBER_ORDER_CONFLICT(as it is once the number is no longer yours), and while the first is still being placed409 NUMBER_ORDER_IN_PROGRESS. A refused order frees itsorderId.A-Za-z0-9_.:-, 1–200.at most 200 characters
prefixstringWith
country: digits right after the country code, asGET /v1/numbers/availabletakes them. Not withareaCode.providerstringWith
number: the channel the search named for it.One of
airtelexotelplivotelnyxtwilioreferencestringT7: your reference for the number (who it is for), kept on it (
reference) and listed byGET /v1/numbers?reference=.at most 200 characters
smsbooleanWith
country: only numbers that can send and receive texts.typestringWith
country: only numbers of this type.One of
localmobiletoll_freenationalpromotional_140transactional_160short_codeversionintegerWith
numberId: the number’sversionas read.at least 1
Response 201PublicNumberOrder
activatedbooleanRequiredTrue when the number is yours now (
assigned: setup fee and first month paid from the wallet).numberPublicPhoneNumberRequiredIts fields are listed under Get number
objectstringRequiredOne of
number_orderorderIdstring | nullRequiredYour
orderId, when you sent one: the same id again answers this order, with its number as it is now.pendingPublicNumberPending | nullRequiredWhy it stays
reserved, when it does. Fix it, thenPOST /v1/numbers/{numberId}/activatebeforereservedUntil.2 fields of
pendingcodestring | nullRequiredThe refusal activation met: VERIFICATION_REQUIRED, VERIFICATION_DOCUMENTS_REQUIRED, DLT_HEADER_REQUIRED, BILLING_INSUFFICIENT_CREDIT, NUMBER_CURRENCY_MISMATCH, … (null for a transient conflict: activate it again).
NUMBER_PENDING_COMPLIANCE(T7): the carrier bought it for you but holds it for its regulator’s review — nothing to do but wait fornumber.updated(it activates, and is charged, once approved).messagestringRequired
Errors
400VALIDATION_FAILED — not exactly one ofnumberId(withversion) ornumber(withprovider).401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.409NUMBER_NOT_AVAILABLE (taken, no longer on sale, or — supplier stock — not on sale from that carrier or gone from its stock), NUMBER_RESERVATION_LIMIT (at most 5 numbers on hold at once), NUMBER_VERSION_CONFLICT — the number changed since you read it: read it again and retry with itsversion(the platform changed it since your search — its price may have moved); or IDEMPOTENCY_KEY_IN_FLIGHT.422NUMBER_NOT_PRICED — supplier stock your plan has no price for; TEST_MODE_UNSUPPORTED — a test key cannot rent, port or register a real number (its own numbers are sandbox numbers); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X POST 'https://api.trovacast.com/v1/numbers' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H 'Idempotency-Key: order-NUMBER_ID' \
-H 'Content-Type: application/json' \
-d '{
"numberId": "NUMBER_ID",
"version": 1
}'{
"activated": true,
"number": {
"assignedAt": "2026-11-05T10:00:00.000Z",
"capabilities": {
"sms": true,
"voiceInbound": true,
"voiceOutbound": true
},
"country": "IN",
"currency": "INR",
"dltHeaderId": "DLT_HEADER_ID",
"id": "ID",
"label": "LABEL",
"livemode": true,
"metadata": {
"businessId": "biz_42"
},
"monthlyFeeMinor": 1,
"number": "+918035550100",
"object": "phone_number",
"paidThrough": "2026-11-05T10:00:00.000Z",
"pendingCompliance": true,
"provider": "airtel",
"reference": "customer_8812",
"releasedAt": "2026-11-05T10:00:00.000Z",
"reservedUntil": "2026-11-05T10:00:00.000Z",
"route": {
"ai": {
"firstMessage": "FIRST_MESSAGE",
"instructions": "INSTRUCTIONS",
"optOut": {
"key": "KEY",
"phrases": [
"PHRASES"
],
"reply": "REPLY"
},
"session": {
"timeoutSeconds": 1,
"url": "URL"
},
"tools": [
{
"description": "DESCRIPTION",
"name": "NAME",
"parameters": {},
"url": "URL"
}
],
"transfer": {
"phoneId": "PHONE_ID",
"ringTimeoutSeconds": 5,
"whisper": "WHISPER"
}
},
"identity": null,
"kind": "none",
"targetId": "TARGET_ID"
},
"setupFeeMinor": 1,
"status": "reserved",
"suspensionReason": "non_payment",
"type": "local",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1,
"warnings": [
{
"agentId": "AGENT_ID",
"callType": "manual",
"code": "BILLING_RATE_UNAVAILABLE",
"direction": "inbound",
"message": "The Pay as you go plan does not price inbound AI calls on plivo, so calls to this number are refused (BILLING_RATE_UNAVAILABLE): the caller hears a short apology and the call is recorded failed until it does. GET /v1/pricing lists the plan's rates.",
"provider": "airtel",
"reason": "voice_key_missing",
"step": {
"index": 1,
"node": "main"
}
}
]
},
"object": "number_order",
"orderId": "ORDER_ID",
"pending": {
"code": "VERIFICATION_REQUIRED",
"message": "MESSAGE"
}
}Search available numbers
get
Searches the numbers for sale: the platform’s priced inventory, plus indicative supplier stock.
One page, never paged: up to limit (default 20, at most 50) of the platform’s inventory in country, cheapest first, optionally by type and prefix (the digits after the country code), then the numbers a carrier has in stock right now unless includeSupplierStock is false. Supplier stock your plan prices is orderable at that price; the rest is indicative (orderable: false, no price). A supplier that cannot be searched just now does not fail the search: the answer holds the inventory and every supplier that answered, and warnings names each one missing (NUMBER_SUPPLIER_UNAVAILABLE, with orderable — whether you could have ordered its stock — and retryAfterSeconds). A test key is answered sandbox numbers instead — fictional numbers free to order (source: supplier, no price, id null: order one as number with provider), from ranges no real line can have — reserved for fiction in the US, Canada and the UK, and in India (P6) subscriber numbers no exchange issues (+91 <area> 0000 0XXX); it never reaches a carrier or the inventory.
Access: an organization key with the numbers:read scope.
Query parameters
countrystringRequiredISO 3166-1 alpha-2.
typestringOne of
localmobiletoll_freenationalpromotional_140transactional_160short_codeprefixstringDigits right after the country code (an area code).
limitintegerincludeSupplierStockbooleanAlso list stock at suppliers that provision by API (types local, mobile, toll_free and national): indicative, unpriced and not orderable. Always false for a test key.
Response 200PublicAvailableNumberList
dataPublicAvailableNumber[]Required14 fields of
datacapabilitiesPublicNumberCapabilitiesRequired3 fields of
capabilitiessmsbooleanRequiredvoiceInboundbooleanRequiredvoiceOutboundbooleanRequired
countrystringRequiredcurrencystring | nullRequiredidstring (uuid) | nullRequiredWhat
POST /v1/numberstakes asnumberId; null for supplier stock.monthlyFeeMinorinteger | nullRequiredThe monthly rental, minor units. Null for supplier stock: the platform has not priced it, and a carrier’s cost is not a price.
numberstringRequiredobjectstringRequiredOne of
available_numberorderablebooleanRequiredWhether
POST /v1/numberstakes it: inventory always; supplier stock when it is on sale at a price of your plan (withnumberandprovider).providerstringRequiredThe channel (carrier) the number lives on. Pass it as
providerwithnumberto order supplier stock.One of
airtelexotelplivosimtelnyxtwilioregionstring | nullRequiredsetupFeeMinorinteger | nullRequiredsourcestringRequiredinventoryis the platform’s stock;supplieris a carrier’s live stock — orderable (at your plan’s number rate) when the platform resells that carrier and your plan prices the number, else indicative (stocked by the platform on request).One of
inventorysuppliertypestringRequiredOne of
localmobiletoll_freenationalpromotional_140transactional_160short_codeversioninteger | nullRequiredPass back as
versiononPOST /v1/numbers(the price you saw is the price you pay); null for supplier stock.
nextCursorstring | nullRequiredPass back as
cursorfor the next page; null on the last.warningsPublicNumberSearchWarning[]RequiredThe suppliers that could not be searched just now — the inventory and every supplier that answered are still in
data. Empty when nothing is missing.5 fields of
warningscodestringRequiredOne of
NUMBER_SUPPLIER_UNAVAILABLEmessagestringRequiredorderablebooleanRequiredTrue when its stock would have been orderable at your plan’s price; false when it is indicative only.
retryAfterSecondsintegerRequiredWhen to search again for its stock.
supplierstringRequiredThe supplier whose stock is missing from this answer.
One of
airtelexotelplivosimtelnyxtwilio
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).503NUMBER_SUPPLIER_UNAVAILABLE — nothing could be searched: every supplier the search asked failed and the platform’s inventory has nothing that matches (suppliers,retryAfterSecondsin the body). Retry, or search the platform’s own stock withincludeSupplierStock=false.
curl 'https://api.trovacast.com/v1/numbers/available?country=IN&type=local&prefix=80' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"data": [
{
"capabilities": {
"sms": true,
"voiceInbound": true,
"voiceOutbound": true
},
"country": "IN",
"currency": "CURRENCY",
"id": "ID",
"monthlyFeeMinor": 1,
"number": "+918035550100",
"object": "available_number",
"orderable": true,
"provider": "airtel",
"region": "REGION",
"setupFeeMinor": 1,
"source": "inventory",
"type": "local",
"version": 1
}
],
"nextCursor": "NEXT_CURSOR",
"warnings": [
{
"code": "NUMBER_SUPPLIER_UNAVAILABLE",
"message": "MESSAGE",
"orderable": true,
"retryAfterSeconds": 1,
"supplier": "airtel"
}
]
}List port outs
get
Lists the organization’s port-outs (numbers unlocked for another carrier), newest first.
Newest first; filter by status or numberId. Each carries its number, status, the account number the gaining carrier quotes, when the PIN expires, the gaining carrier and its focDate once known, and why it failed. Never the PIN.
Access: an organization key with the numbers:read scope.
Query parameters
limitintegerHow many items to return.
cursorstringThe
nextCursorof the previous page. Omit for the first page.statusstringOne of
unlockedcompletedfailedcancellednumberIdstring (uuid)One number’s only.
Response 200PublicNumberPortOutPage
dataPublicNumberPortOut[]RequiredIts fields are listed under Get port out
nextCursorstring | nullRequiredPass back as
cursorfor the next page; null on the last.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/numbers/port-outs' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"data": [
{
"accountNumber": "TC3F2A9B1C4D5E",
"cancelledAt": "2026-11-05T10:00:00.000Z",
"completedAt": "2026-11-05T10:00:00.000Z",
"createdAt": "2026-11-05T10:00:00.000Z",
"failedAt": "2026-11-05T10:00:00.000Z",
"failure": {
"code": "PIN_EXPIRED",
"reason": "REASON"
},
"focDate": "2026-11-20",
"gainingCarrier": "GAINING_CARRIER",
"id": "ID",
"number": "+14155550123",
"numberId": "NUMBER_ID",
"object": "number_port_out",
"pinExpiresAt": "2026-11-05T10:00:00.000Z",
"status": "unlocked",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1
}
],
"nextCursor": "NEXT_CURSOR"
}Get port out
get
Reads one port-out.
Its number, status (unlocked, completed, failed or cancelled), account number, PIN expiry, gaining carrier, focDate and failure. Never the PIN.
Access: an organization key with the numbers:read scope.
Path parameters
portOutIdstringRequired
Response 200PublicNumberPortOut
Show the 16 fieldsHide the fields
accountNumberstringRequiredYour account number with the platform, as the gaining carrier quotes it. The same for every number of your organization; not a secret — the PIN is.
cancelledAtstring (date-time) | nullRequiredcompletedAtstring (date-time) | nullRequiredcreatedAtstring (date-time)RequiredfailedAtstring (date-time) | nullRequiredfailurePublicPortOutFailure | nullRequired2 fields of
failurecodestring | nullRequiredPIN_EXPIRED, or the carrier’s own code.reasonstring | nullRequired
focDatestring | nullRequiredThe date the gaining carrier committed to (YYYY-MM-DD).
gainingCarrierstring | nullRequiredidstring (uuid)RequirednumberstringRequirednumberIdstring (uuid)RequiredobjectstringRequiredOne of
number_port_outpinExpiresAtstring (date-time)RequiredstatusstringRequiredunlocked(a gaining carrier may take the number withaccountNumberand the transfer PIN untilpinExpiresAt; it stays live and yours meanwhile) →completed(it left the platform: no longer yours, no further rentals); orfailed(refused, given up, or the PIN expired —failuresays which — and relocked: still yours) orcancelled(you relocked it, or released the number).One of
unlockedcompletedfailedcancelledupdatedAtstring (date-time)RequiredversionintegerRequiredat least 1
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such port-out.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/numbers/port-outs/PORT_OUT_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"accountNumber": "TC3F2A9B1C4D5E",
"cancelledAt": "2026-11-05T10:00:00.000Z",
"completedAt": "2026-11-05T10:00:00.000Z",
"createdAt": "2026-11-05T10:00:00.000Z",
"failedAt": "2026-11-05T10:00:00.000Z",
"failure": {
"code": "PIN_EXPIRED",
"reason": "REASON"
},
"focDate": "2026-11-20",
"gainingCarrier": "GAINING_CARRIER",
"id": "ID",
"number": "+14155550123",
"numberId": "NUMBER_ID",
"object": "number_port_out",
"pinExpiresAt": "2026-11-05T10:00:00.000Z",
"status": "unlocked",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1
}List port requests
get
Lists the organization’s port-in requests, newest first.
Newest first; filter by status. Each request carries its numbers, the carrier they leave, its status, the reviewer’s reviewNote, the date the losing carrier committed to (focDate) and its version.
Access: an organization key with the numbers:read scope.
Query parameters
limitintegerHow many items to return.
cursorstringThe
nextCursorof the previous page. Omit for the first page.statusstringOne of
submittedin_reviewapprovedrejectedcompletedcancelled
Response 200PublicNumberPortRequestPage
dataPublicNumberPortRequest[]RequiredIts fields are listed under Get port request
nextCursorstring | nullRequiredPass back as
cursorfor the next page; null on the last.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/numbers/port-requests' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"data": [
{
"cancelledAt": "2026-11-05T10:00:00.000Z",
"completedAt": "2026-11-05T10:00:00.000Z",
"completedNumbers": [
{
"number": "+14155550123",
"numberId": "NUMBER_ID"
}
],
"country": "IN",
"createdAt": "2026-11-05T10:00:00.000Z",
"currentCarrier": "CURRENT_CARRIER",
"focDate": "2026-11-20",
"id": "ID",
"loaDocumentId": "LOA_DOCUMENT_ID",
"numberType": "local",
"numbers": [
"NUMBERS"
],
"object": "number_port_request",
"rejection": {
"code": "6D",
"reason": "Account number does not match"
},
"reviewNote": "REVIEW_NOTE",
"reviewedAt": "2026-11-05T10:00:00.000Z",
"status": "submitted",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1
}
],
"nextCursor": "NEXT_CURSOR"
}Create port request
post
Asks to port the organization’s own numbers in from another carrier, with a letter of authority.
Up to 50 numbers in international format, all in country, with a letter of authority already uploaded to your business verification as a NUMBER_LOA document (loaDocumentId). The platform’s team runs the port: the request moves submitted → in_review → approved → completed (or rejected), each step a number.port_request.updated event, and on completion the numbers are listed by GET /v1/numbers. Refused with 409 PORT_NUMBER_ON_PLATFORM when a number is already on the platform, 409 PORT_REQUEST_DUPLICATE when one is in another open request of yours, and 422 PORT_LOA_REQUIRED without a valid letter of authority.
Access: an organization key with the numbers:write scope.
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
countrystringRequiredISO 3166-1 alpha-2.
currentCarrierstringRequiredThe carrier the numbers are leaving.
at most 120 characters
loaDocumentIdstring (uuid)RequiredThe signed letter of authority: a
NUMBER_LOAdocument you uploaded to your business verification (console › Settings › Verification).numberTypestringRequiredOne of
localmobiletoll_freenationalpromotional_140transactional_160short_codenumbersstring[]RequiredThe numbers to bring over, E.164, all in
country(1–50). None may already be on the platform.
Response 201PublicNumberPortRequest
Its fields are listed under Get port request.
Errors
400VALIDATION_FAILED — a number not in international format or not incountry, or more than 50.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.409PORT_NUMBER_ON_PLATFORM (a number is already on the platform), PORT_REQUEST_DUPLICATE (a number is in another open request of yours); or IDEMPOTENCY_KEY_IN_FLIGHT.422PORT_LOA_REQUIRED — loaDocumentId is not a NUMBER_LOA document of your business verification; TEST_MODE_UNSUPPORTED — a test key cannot rent, port or register a real number (its own numbers are sandbox numbers); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X POST 'https://api.trovacast.com/v1/numbers/port-requests' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"country": "IN",
"currentCarrier": "Airtel",
"loaDocumentId": "fe74714f-8838-471e-8f98-03f324fb8e8a",
"numberType": "local",
"numbers": [
"+918031150000",
"+918031150001"
]
}'{
"cancelledAt": "2026-11-05T10:00:00.000Z",
"completedAt": "2026-11-05T10:00:00.000Z",
"completedNumbers": [
{
"number": "+14155550123",
"numberId": "NUMBER_ID"
}
],
"country": "IN",
"createdAt": "2026-11-05T10:00:00.000Z",
"currentCarrier": "CURRENT_CARRIER",
"focDate": "2026-11-20",
"id": "ID",
"loaDocumentId": "LOA_DOCUMENT_ID",
"numberType": "local",
"numbers": [
"NUMBERS"
],
"object": "number_port_request",
"rejection": {
"code": "6D",
"reason": "Account number does not match"
},
"reviewNote": "REVIEW_NOTE",
"reviewedAt": "2026-11-05T10:00:00.000Z",
"status": "submitted",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1
}Get port request
get
Reads one port-in request.
Its numbers, the carrier they leave, its status (submitted, in_review, approved, completed, rejected or cancelled), the reviewer’s reviewNote, the committed port date (focDate) once the carrier gives one, and the version a cancellation sends.
Access: an organization key with the numbers:read scope.
Path parameters
portRequestIdstringRequired
Response 200PublicNumberPortRequest
Show the 18 fieldsHide the fields
cancelledAtstring (date-time) | nullRequiredcompletedAtstring (date-time) | nullRequiredcompletedNumbersPublicPortedNumber[]RequiredT7: once
completed, each number as it now is on the platform — yours, with its id; empty before.2 fields of
completedNumbersnumberstringRequirednumberIdstring (uuid)RequiredGET /v1/numbers/{numberId}.
countrystringRequiredcreatedAtstring (date-time)RequiredcurrentCarrierstringRequiredfocDatestring | nullRequiredThe date the losing carrier committed to (YYYY-MM-DD).
idstring (uuid)RequiredloaDocumentIdstring (uuid) | nullRequirednumberTypestringRequiredOne of
localmobiletoll_freenationalpromotional_140transactional_160short_codenumbersstring[]RequiredobjectstringRequiredOne of
number_port_requestrejectionPublicPortRejection | nullRequiredT7: a
rejectedrequest’s reason in the losing carrier’s words, and its code (each null when it named none); null otherwise.reviewNoteis the platform’s own word.2 fields of
rejectioncodestring | nullRequiredreasonstring | nullRequired
reviewNotestring | nullRequiredreviewedAtstring (date-time) | nullRequiredstatusstringRequiredsubmitted→in_review→approved(the platform runs the port with the carrier;focDateonce committed) →completed(the numbers are yours:GET /v1/numbers); orrejected(reviewNotesays why) orcancelled(by you).One of
submittedin_reviewapprovedrejectedcompletedcancelledupdatedAtstring (date-time)RequiredversionintegerRequiredat least 1
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such port request.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/numbers/port-requests/PORT_REQUEST_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"cancelledAt": "2026-11-05T10:00:00.000Z",
"completedAt": "2026-11-05T10:00:00.000Z",
"completedNumbers": [
{
"number": "+14155550123",
"numberId": "NUMBER_ID"
}
],
"country": "IN",
"createdAt": "2026-11-05T10:00:00.000Z",
"currentCarrier": "CURRENT_CARRIER",
"focDate": "2026-11-20",
"id": "ID",
"loaDocumentId": "LOA_DOCUMENT_ID",
"numberType": "local",
"numbers": [
"NUMBERS"
],
"object": "number_port_request",
"rejection": {
"code": "6D",
"reason": "Account number does not match"
},
"reviewNote": "REVIEW_NOTE",
"reviewedAt": "2026-11-05T10:00:00.000Z",
"status": "submitted",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1
}Cancel port request
post
Withdraws an open port-in request.
Only while it is submitted, in_review or approved, under the version you read; the change fires number.port_request.updated and is audited. Refused with 409 PORT_REQUEST_INVALID_TRANSITION once it is completed, rejected or cancelled, and 409 PORT_REQUEST_VERSION_CONFLICT when it changed since you read it.
Access: an organization key with the numbers:write scope.
Path parameters
portRequestIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
versionintegerRequiredThe number’s
versionas read.at least 1
Response 200PublicNumberPortRequest
Its fields are listed under Get port request.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such port request.409PORT_REQUEST_INVALID_TRANSITION (already completed, rejected or cancelled), PORT_REQUEST_VERSION_CONFLICT; or IDEMPOTENCY_KEY_IN_FLIGHT.422TEST_MODE_UNSUPPORTED — a test key cannot rent, port or register a real number (its own numbers are sandbox numbers); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X POST 'https://api.trovacast.com/v1/numbers/port-requests/PORT_REQUEST_ID/cancel' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"version": 1
}'{
"cancelledAt": "2026-11-05T10:00:00.000Z",
"completedAt": "2026-11-05T10:00:00.000Z",
"completedNumbers": [
{
"number": "+14155550123",
"numberId": "NUMBER_ID"
}
],
"country": "IN",
"createdAt": "2026-11-05T10:00:00.000Z",
"currentCarrier": "CURRENT_CARRIER",
"focDate": "2026-11-20",
"id": "ID",
"loaDocumentId": "LOA_DOCUMENT_ID",
"numberType": "local",
"numbers": [
"NUMBERS"
],
"object": "number_port_request",
"rejection": {
"code": "6D",
"reason": "Account number does not match"
},
"reviewNote": "REVIEW_NOTE",
"reviewedAt": "2026-11-05T10:00:00.000Z",
"status": "submitted",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1
}Get number
get
Reads one number the organization holds.
One number you hold (reserved, assigned, suspended or releasing): its capabilities, monthly and setup fees, inbound route, voice DLT header, reservedUntil for a hold, and the version every change sends back. A number on sale, released for good or held by another organization is not found.
Access: an organization key with the numbers:read scope.
Path parameters
numberIdstringRequired
Response 200PublicPhoneNumber
Show the 26 fieldsHide the fields
assignedAtstring (date-time) | nullRequiredcapabilitiesPublicNumberCapabilitiesRequired3 fields of
capabilitiessmsbooleanRequiredvoiceInboundbooleanRequiredvoiceOutboundbooleanRequired
countrystringRequiredcurrencystringRequireddltHeaderIdstring (uuid) | nullRequiredThe VERIFIED voice DLT header a 140/160-series number is registered under (India).
idstring (uuid)Requiredlabelstring | nullRequiredlivemodebooleanRequiredFalse for a sandbox number a test key ordered: a fictional number (a range reserved for drama — NANP 555-01XX, Ofcom’s — or, in India, a subscriber number no exchange issues:
+91 <area> 0000 0XXX) no carrier holds and no wallet pays for, whose calls are simulated (POST /v1/sandbox/inbound-calls). A key sees and changes the numbers of its own mode only.metadataRecord<string, string>RequiredYour identifiers for the number, copied onto every inbound call to it (the call’s
metadata, echoed on its events;GET /v1/calls?metadata=key:value). Empty when you set none.monthlyFeeMinorintegerRequiredThe monthly rental, minor units of
currency.numberstringRequiredE.164 with the leading
+. The business’s own number, so it is never masked.objectstringRequiredOne of
phone_numberpaidThroughstring (date-time) | nullRequiredThe rental is paid up to (exclusive) this instant; the next month is debited then.
pendingCompliancebooleanRequiredTrue while the number’s carrier holds it for its regulator’s review: bought for you but not live,
reservedwithout areservedUntil(it does not lapse) and not charged. Once the carrier approves it, it is activated and charged (or, if that cannot happen yet, waits on hold with a freshreservedUntil); a rejection hands it back. Either is told asnumber.updated. Release it to give it up.providerstringRequiredThe channel (carrier) the number lives on.
One of
airtelexotelplivosimtelnyxtwilioreferencestring | nullRequiredYour own reference for the number — who it is for — given when you ordered it (
POST /v1/numbers) or byPATCH;GET /v1/numbers?reference=finds it. Cleared when the number leaves you.at most 200 characters
releasedAtstring (date-time) | nullRequiredreservedUntilstring (date-time) | nullRequiredWhen a
reservedhold lapses and the number goes back on sale.routePublicNumberRouteRequired4 fields of
routeaiPublicAiRouteOptions | nullRequiredT5: an
airoute’s own options for the calls it answers; null for every other kind, and for anairoute that sets none.6 fields of
aifirstMessagestring | nullRequiredinstructionsstring | nullRequiredoptOutPublicAiOptOutRead | nullRequired3 fields of
optOutkeystring | nullRequiredphrasesstring[]RequiredreplystringRequired
sessionPublicAgentSessionRead | nullRequired2 fields of
sessiontimeoutSecondsintegerRequired1–10
urlstringRequired
toolsPublicAiCallToolRead[] | nullRequiredNull: the agent’s own tools.
4 fields of
toolsdescriptionstringRequirednamestringRequiredparametersobjectRequiredurlstringRequired
transferPublicAiTransferRead | nullRequired3 fields of
transferphoneIdstring (uuid)RequiredringTimeoutSecondsintegerRequired5–120
whisperstring | nullRequired
identitystring | nullRequiredThe client identity a
clientroute rings (POST /v1/voice/access-tokens); null for every other kind.kindstringRequiredWhere an inbound call goes: a published call flow, a voice application (its answer URL), a queue, one seat (
agent: a person’s organization membership — not an AI agent), an AI agent (ai: it answers the call itself), a client identity of your own app (client: every app connected as it rings — client voice), ornone(the organization’s default routing).One of
noneflowapplicationqueueagentaiclienttargetIdstring (uuid) | nullRequiredThe flow, application, queue, membership or AI agent id; null for
noneandclient.
setupFeeMinorintegerRequiredThe one-off setup fee, minor units.
statusstringRequiredreserved(on hold: not yet verified or paid),assigned(yours, dialling and taking calls),suspended(suspensionReason),releasing(quarantined after a release).availableonly in the answer that cancelled a hold: the number went back on sale.One of
reservedassignedsuspendedreleasingavailablesuspensionReasonstring | nullRequirednon_payment: a rental the wallet could not pay (lifted once one is paid);platform: held by the platform.One of
non_paymentplatformtypestringRequiredOne of
localmobiletoll_freenationalpromotional_140transactional_160short_codeupdatedAtstring (date-time)RequiredversionintegerRequiredPass back as
versionon every change: each is a compare-and-set on it (409 NUMBER_VERSION_CONFLICTwhen it moved).warningsPublicNumberWarning[]RequiredWhat will stop this number’s calls, though nothing is wrong with the request (2026-11-07): a route whose inbound calls your plan does not price (
BILLING_RATE_UNAVAILABLE); since 2026-11-07 also an AI agent that cannot speak on this deployment (AI_PROVIDER_UNAVAILABLE) — the route’s own, or one an AI step of its flow hands the caller to — and a flow AI step whose AI call the plan does not price. Read on every answer — the one that saved the route included — and empty once nothing stands in the way.8 fields of
warningsagentIdstring (uuid) | nullRequiredThe AI agent it is about — an
airoute’s, or the flow step’s (2026-11-07); null for a route with none.callTypestringRequiredWhat the warning prices or runs:
full_aifor an AI agent — a route to one, or a flow’s AI step — andmanualfor every other route (a flow, an application, a queue, a seat, a client identity).One of
manualfull_aicodestringRequiredBILLING_RATE_UNAVAILABLE: your plan has no rate for the inbound calls this route answers (stepnull) — each is refused with a short apology and recordedfailedwith this code (call.failed) — or for the AI call an AI step of the route’s flow makes of them (stepset) — the step is refused and the caller takes its fallback. In shadow billing such a call is taken instead, recorded unpriced, and charged only if the plan prices it within 7 days of the call.GET /v1/pricinglists the plan’s rates.AI_PROVIDER_UNAVAILABLE(2026-11-07): the AI agent the route answers with (stepnull) — each call is refusedAI_AGENT_UNAVAILABLE— or an AI step of its flow hands the caller to (stepset) — the caller takes the step’s fallback — cannot speak on this deployment;reasonsays why, asGET /v1/agents/{agentId}reports it.AI_AGENT_UNAVAILABLE: the same agent cannot take the caller for any other reason the call is refused on —reasonAI_CALLS_DISABLED(AI calls are switched off for your organization:PATCH /v1/settings/calls),AGENT_INACTIVE(the agent is switched off — switch it on — or archived — an archived agent cannot be switched on, so the route or step must name another agent;messagesays which) orTEST_AGENT(a test agent answers test calls only); a route’s calls are refusedAI_AGENT_UNAVAILABLE, and a flow step’s caller takes its fallback (the step refusedAI_CALLS_DISABLEDorAI_AGENT_UNAVAILABLE). A route is saved with these warnings whenever its target is unchanged; pointing a number at a new AI target that cannot run is refused instead. A route or step that fails for more than one cause has one warning per cause (2026-11-07), the one its calls fail with first. A warning goes once its cause does.One of
BILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLEdirectionstringRequiredOne of
inboundmessagestringRequiredproviderstringRequiredThe channel the calls arrive on: the number’s own.
One of
airtelexotelplivosimtelnyxtwilioreasonstring | nullRequiredAI_PROVIDER_UNAVAILABLE(2026-11-07): why the agent cannot speak here, as itsavailability.reasonreads (lower case).AI_AGENT_UNAVAILABLE: why it cannot take the caller —AI_CALLS_DISABLED,AGENT_INACTIVEorTEST_AGENT. Null forBILLING_RATE_UNAVAILABLE.One of
voice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENTstepPublicNumberWarningStep | nullRequiredThe AI step of the route’s flow it is about (2026-11-07); null when it is about the route itself.
2 fields of
stepindexintegerRequiredIts position in the node, from 0: the step is
nodes.<node>.<index>of the flow’s published version (the pathPOST /v1/call-flows/validatenames its issues by).at least 0
nodestringRequiredThe node the step is in.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such number held by the organization (on sale, released for good, or another organization’s).429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/numbers/NUMBER_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"assignedAt": "2026-11-05T10:00:00.000Z",
"capabilities": {
"sms": true,
"voiceInbound": true,
"voiceOutbound": true
},
"country": "IN",
"currency": "INR",
"dltHeaderId": "DLT_HEADER_ID",
"id": "ID",
"label": "LABEL",
"livemode": true,
"metadata": {
"businessId": "biz_42"
},
"monthlyFeeMinor": 1,
"number": "+918035550100",
"object": "phone_number",
"paidThrough": "2026-11-05T10:00:00.000Z",
"pendingCompliance": true,
"provider": "airtel",
"reference": "customer_8812",
"releasedAt": "2026-11-05T10:00:00.000Z",
"reservedUntil": "2026-11-05T10:00:00.000Z",
"route": {
"ai": {
"firstMessage": "FIRST_MESSAGE",
"instructions": "INSTRUCTIONS",
"optOut": {
"key": "KEY",
"phrases": [
"PHRASES"
],
"reply": "REPLY"
},
"session": {
"timeoutSeconds": 1,
"url": "URL"
},
"tools": [
{
"description": "DESCRIPTION",
"name": "NAME",
"parameters": {},
"url": "URL"
}
],
"transfer": {
"phoneId": "PHONE_ID",
"ringTimeoutSeconds": 5,
"whisper": "WHISPER"
}
},
"identity": null,
"kind": "none",
"targetId": "TARGET_ID"
},
"setupFeeMinor": 1,
"status": "reserved",
"suspensionReason": "non_payment",
"type": "local",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1,
"warnings": [
{
"agentId": "AGENT_ID",
"callType": "manual",
"code": "BILLING_RATE_UNAVAILABLE",
"direction": "inbound",
"message": "The Pay as you go plan does not price inbound AI calls on plivo, so calls to this number are refused (BILLING_RATE_UNAVAILABLE): the caller hears a short apology and the call is recorded failed until it does. GET /v1/pricing lists the plan's rates.",
"provider": "airtel",
"reason": "voice_key_missing",
"step": {
"index": 1,
"node": "main"
}
}
]
}Update number
patch
Labels a number, routes its inbound calls (to a flow, an application, a queue, a seat or an AI agent) or links its voice DLT header.
Any of label, route and dltHeaderId in one call, under the number’s version; a refusal from any part leaves the number as it was. A route sends inbound calls to a published call flow, a voice application, a queue, one seat, an AI agent, or back to the organization’s default (none). Refused with 409 NUMBER_NOT_ASSIGNED when routing a number that is not assigned, and 409 NUMBER_VERSION_CONFLICT when it changed since you read it. A route to a new AI agent that cannot take calls is refused with the code POST /v1/calls answers an AI_AGENT call with for the same cause (2026-11-07): 409 AI_CALLS_DISABLED while the organization’s call policy turns AI calls off, 404 AI_AGENT_NOT_FOUND for an agent that is not this organization’s live one (a test agent reads exactly as an unknown id), 409 AI_AGENT_INACTIVE for one switched off or archived (it was 400), and 422 AI_PROVIDER_UNAVAILABLE (with reason, provider, leg) for one whose voice cannot run on this deployment. Those target checks apply only when the PATCH changes the route’s target: one that leaves it as it is — a label or dltHeaderId change, the same route sent again, or both — always saves, and the answer’s warnings say what would stop its calls (a price gap never refuses a save either).
Access: an organization key with the numbers:write scope.
Path parameters
numberIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
dltHeaderIdstring (uuid) | nullLinks a VERIFIED voice DLT header of your organization naming this number, of its own series (VOICE_140 for a 140-series number, VOICE_160 for 160); null unlinks.
labelstring | nullYour name for the number; null clears it.
at most 120 characters
metadataRecord<string, string>Your identifiers for the number, copied onto every inbound call to it as the call’s
metadata(echoed on its events, and asked byGET /v1/calls?metadata=key:value). Replaces what it had;{}clears it (null is refused). At most 20 keys (1–40 ofA-Za-z0-9_.-), values ≤ 500 characters. Never put personal data here: it is stored unencrypted.referencestring | nullT7: your own reference for the number (who it is for); null clears it.
at most 200 characters
routePublicNumberRouteInputWhere inbound calls go. An
assignednumber that takes inbound calls only.4 fields of
routeaiPublicAiCallOptionsT5 — with
aionly: the calls this route answers run with these besides the agent’s own configuration — a session webhook asked at each call’s start, a first message, instructions and tools. The route is replaced as sent: a route saved withoutaikeeps none. A session webhook that does not answer leaves the call on these and the agent’s own configuration (the caller is never left in silence).6 fields of
aifirstMessagestringWhat the agent says first, word for word, in place of its own first message (the agent then speaks first). Stored sealed with the call: it may name the person.
1–1000 characters
instructionsstringThe agent’s instructions for this call, in place of its own (its language and the call’s
objectiveare still added). Stored sealed with the call.1–20000 characters
optOutPublicAiOptOutThe built-in opt-out: the caller presses
keyor says one ofphrases, and at once the contact is marked do-not-call (call.ai.opt_outtells it), the agent saysreplyand the call ends. A key or phrases, or both.3 fields of
optOutkeystringThe key that opts the caller out.
One of
0123456789*#phrasesstring[]Phrases that opt the caller out when they say one (2–120 characters each; matched ignoring case and punctuation, on word boundaries).
at most 10 items
replystringSaid to the caller, in the agent’s voice, before the call ends.
at most 500 charactersdefault "Understood. We will not call you again. Goodbye."
sessionPublicAgentSessionYour session webhook, asked when the conversation starts for its first message, instructions, tools and options. Needs an agent with a tool-signing secret (
422 AGENT_TOOL_SECRET_REQUIRED).2 fields of
sessiontimeoutSecondsintegerHow long the caller may wait for your answer, in seconds. They hear silence meanwhile.
1–10default 5
urlstringRequiredYour HTTPS endpoint, asked once when the conversation starts: a POST of
{ event: "agent.session", requestId, agentId, callId, source, call, timestamp }(source:call,number_routeorflow_step;callthe tool call’s context), signed with the agent’s tool-signing secret (Trovacast-Signature). Answer2xxJSON (at most 64 KB) with any offirstMessage(null: none),firstSpeaker,instructions,language,endCallPhrases,maxTurns,tools,transferandoptOut— each replaces what the call already had; a field you leave out keeps it. A timeout, a non-2xx or an answer that does not validate is the session being unavailable: the conversation runs on the call’s own options and the agent’s configuration (a flow step can branch instead,onUnavailable). The URL rules of webhook endpoints apply.at most 2048 characters
toolsPublicAiCallTool[]The tools the agent may call on this call, in place of its own — each your HTTPS endpoint, called as an agent’s own tools are (signed with the agent’s tool-signing secret, 4 s, 16 KB). Needs an agent with a tool-signing secret (
422 AGENT_TOOL_SECRET_REQUIRED; rotate one withPOST /v1/agents/{agentId}/tool-secret).at most 10 items
4 fields of
toolsdescriptionstringRequiredWhen the model should use it — the model reads this.
1–1000 characters
namestringRequiredWhat the model calls it: a letter, then letters, digits,
_or-(at most 64). Unique within the call.parametersobjectRequiredThe arguments, as an object schema — the JSON Schema subset an agent’s own tools take (
POST /v1/agents).urlstringRequiredYour HTTPS endpoint, called as an agent’s own tool is: a POST of
{ event: "agent.tool_call", requestId, agentId, callId, toolCallId, tool, arguments, call, timestamp }, signed with the agent’s tool-signing secret, answered2xxwithin 4 seconds. The URL rules of webhook endpoints apply.at most 2048 characters
transferPublicAiTransferA person the agent may hand the caller to: the agent is offered a
transfer_to_persontool, says it is connecting them, and the person rings with the caller on hold. Answered, the person has the caller and the agent leaves; not answered (or busy, or the leg refused), the caller goes back to the agent, which is told why.call.ai.transfersays what came of it. Exactly one ofnumberorphoneId(a route takesphoneIdonly).4 fields of
transfernumberstringAn outside number, international format, rung as a leg of the call (every dial rule applies: the destination policy, the calling window of a called party, billing). On
POST /v1/callsonly — a number’s route names a registered phone (phoneId), so no number is kept in its configuration.phoneIdstring (uuid)One of your own phones (
GET /v1/phones): rung as your staff’s handset (legRole: agent_phone), so the called party’s calling window is not asked of it.ringTimeoutSecondsintegerHow long the person rings before the caller goes back to the agent.
5–120default 30
whisperstringSpoken to the person who answers, before they are connected.
at most 500 characters
identitystringRequired for
client(and refused with any other kind): the client identity to ring — letters, digits,_ . : -, at least one letter. Every app connected as it (@trovacast/sdk/voice, with a token whoseincominggrant is on) rings; the first to accept takes the call, and nobody answering in 30 s ends it as busy.at most 64 characters
kindstringRequiredOne of
noneflowapplicationqueueagentaiclienttargetIdstring (uuid) | nullRequired except for
none: a published call flow, a voice application, an active queue, an active seat (membership), or an active AI agent (ai, while AI calls are on) of your organization.
versionintegerRequiredThe number’s
versionas read.at least 1
Response 200PublicPhoneNumber
Its fields are listed under Get number.
Errors
400VALIDATION_FAILED — nothing to change; a route target that is not a published flow, a voice application, an active queue or an active seat of yours; a number that takes no inbound calls; or a DLT header of the wrong series, naming another number, or not verified.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such number (or no such DLT header). AI_AGENT_NOT_FOUND — a route to an AI agent that is not this organization’s live one.409NUMBER_NOT_ASSIGNED (only an assigned number can be routed), NUMBER_NOT_AVAILABLE (only an assigned or suspended number can be labelled or linked), AI_CALLS_DISABLED (a route to an AI agent while the organization’s call policy turns AI calls off), AI_AGENT_INACTIVE (a route to an AI agent that is switched off or archived), NUMBER_VERSION_CONFLICT — the number changed since you read it: read it again and retry with itsversion; or IDEMPOTENCY_KEY_IN_FLIGHT.422AI_PROVIDER_UNAVAILABLE (a route to an AI agent whose voice cannot run on this deployment, with its reason, provider and leg); TEST_MODE_UNSUPPORTED — a test key cannot rent, port or register a real number (its own numbers are sandbox numbers); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X PATCH 'https://api.trovacast.com/v1/numbers/NUMBER_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"version": 3,
"label": "Support line",
"route": {
"kind": "flow",
"targetId": "CALL_FLOW_ID"
}
}'{
"assignedAt": "2026-11-05T10:00:00.000Z",
"capabilities": {
"sms": true,
"voiceInbound": true,
"voiceOutbound": true
},
"country": "IN",
"currency": "INR",
"dltHeaderId": "DLT_HEADER_ID",
"id": "ID",
"label": "LABEL",
"livemode": true,
"metadata": {
"businessId": "biz_42"
},
"monthlyFeeMinor": 1,
"number": "+918035550100",
"object": "phone_number",
"paidThrough": "2026-11-05T10:00:00.000Z",
"pendingCompliance": true,
"provider": "airtel",
"reference": "customer_8812",
"releasedAt": "2026-11-05T10:00:00.000Z",
"reservedUntil": "2026-11-05T10:00:00.000Z",
"route": {
"ai": {
"firstMessage": "FIRST_MESSAGE",
"instructions": "INSTRUCTIONS",
"optOut": {
"key": "KEY",
"phrases": [
"PHRASES"
],
"reply": "REPLY"
},
"session": {
"timeoutSeconds": 1,
"url": "URL"
},
"tools": [
{
"description": "DESCRIPTION",
"name": "NAME",
"parameters": {},
"url": "URL"
}
],
"transfer": {
"phoneId": "PHONE_ID",
"ringTimeoutSeconds": 5,
"whisper": "WHISPER"
}
},
"identity": null,
"kind": "none",
"targetId": "TARGET_ID"
},
"setupFeeMinor": 1,
"status": "reserved",
"suspensionReason": "non_payment",
"type": "local",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1,
"warnings": [
{
"agentId": "AGENT_ID",
"callType": "manual",
"code": "BILLING_RATE_UNAVAILABLE",
"direction": "inbound",
"message": "The Pay as you go plan does not price inbound AI calls on plivo, so calls to this number are refused (BILLING_RATE_UNAVAILABLE): the caller hears a short apology and the call is recorded failed until it does. GET /v1/pricing lists the plan's rates.",
"provider": "airtel",
"reason": "voice_key_missing",
"step": {
"index": 1,
"node": "main"
}
}
]
}Activate number
post
Activates a number on hold, charging its setup fee and first month.
For a number on hold once what its pending named is in place: the setup fee and first month are debited from the wallet in the same transaction that assigns the number, under the version you read. Refused with 402 BILLING_INSUFFICIENT_CREDIT when the wallet cannot pay, 403 VERIFICATION_REQUIRED or 403 VERIFICATION_DOCUMENTS_REQUIRED while the business verification or a document the number type needs is missing, 422 DLT_HEADER_REQUIRED for a 140-series number without its verified header, and 409 NUMBER_NOT_AVAILABLE once the hold has lapsed or the number is no longer on hold.
Access: an organization key with the numbers:write scope.
Path parameters
numberIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
versionintegerRequiredThe number’s
versionas read.at least 1
Response 200PublicPhoneNumber
Its fields are listed under Get number.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.402BILLING_INSUFFICIENT_CREDIT — the wallet cannot pay the setup fee and first month (neededMinor,balanceMinor).403VERIFICATION_REQUIRED — the business verification is not approved yet; VERIFICATION_DOCUMENTS_REQUIRED — this number type needs a document not on file (missingDocuments). API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such number.409NUMBER_NOT_AVAILABLE (not on hold for you: activated, released, or the hold lapsed), NUMBER_CURRENCY_MISMATCH, NUMBER_VERSION_CONFLICT — the number changed since you read it: read it again and retry with itsversion; or IDEMPOTENCY_KEY_IN_FLIGHT.422DLT_HEADER_REQUIRED — a 140-series number needs a VERIFIED VOICE_140 DLT header for this exact number first; or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X POST 'https://api.trovacast.com/v1/numbers/NUMBER_ID/activate' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"version": 2
}'{
"assignedAt": "2026-11-05T10:00:00.000Z",
"capabilities": {
"sms": true,
"voiceInbound": true,
"voiceOutbound": true
},
"country": "IN",
"currency": "INR",
"dltHeaderId": "DLT_HEADER_ID",
"id": "ID",
"label": "LABEL",
"livemode": true,
"metadata": {
"businessId": "biz_42"
},
"monthlyFeeMinor": 1,
"number": "+918035550100",
"object": "phone_number",
"paidThrough": "2026-11-05T10:00:00.000Z",
"pendingCompliance": true,
"provider": "airtel",
"reference": "customer_8812",
"releasedAt": "2026-11-05T10:00:00.000Z",
"reservedUntil": "2026-11-05T10:00:00.000Z",
"route": {
"ai": {
"firstMessage": "FIRST_MESSAGE",
"instructions": "INSTRUCTIONS",
"optOut": {
"key": "KEY",
"phrases": [
"PHRASES"
],
"reply": "REPLY"
},
"session": {
"timeoutSeconds": 1,
"url": "URL"
},
"tools": [
{
"description": "DESCRIPTION",
"name": "NAME",
"parameters": {},
"url": "URL"
}
],
"transfer": {
"phoneId": "PHONE_ID",
"ringTimeoutSeconds": 5,
"whisper": "WHISPER"
}
},
"identity": null,
"kind": "none",
"targetId": "TARGET_ID"
},
"setupFeeMinor": 1,
"status": "reserved",
"suspensionReason": "non_payment",
"type": "local",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1,
"warnings": [
{
"agentId": "AGENT_ID",
"callType": "manual",
"code": "BILLING_RATE_UNAVAILABLE",
"direction": "inbound",
"message": "The Pay as you go plan does not price inbound AI calls on plivo, so calls to this number are refused (BILLING_RATE_UNAVAILABLE): the caller hears a short apology and the call is recorded failed until it does. GET /v1/pricing lists the plan's rates.",
"provider": "airtel",
"reason": "voice_key_missing",
"step": {
"index": 1,
"node": "main"
}
}
]
}Unlock number port out
post
Unlocks a number for the carrier you are moving it to: the account number and a transfer PIN.
For an assigned or suspended number of yours. Answers the port-out with accountNumber and transferPin — the PIN this once, never on a read or an event — valid validForDays (default 7, at most 30). The number stays live and yours until the gaining carrier takes it: then the port-out is completed and the number leaves the platform (no further rentals). Told as number.port_out.updated at every step: a carrier that refuses or gives up, or a PIN that expires (failure.code: PIN_EXPIRED), failed — the number relocked, still yours. Unlocking a number already unlocked issues a new PIN and voids the old (the same port-out, a new version). Releasing the number cancels it. Refused with 409 PORT_OUT_NUMBER_NOT_PORTABLE for a number on hold or being released.
Access: an organization key with the numbers:write scope.
Path parameters
numberIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
validForDaysintegerHow many days the transfer PIN works. Past it, the port-out fails (
PIN_EXPIRED) and the number is relocked.1–30default 7
Response 201PublicNumberPortOutUnlock
Show the 17 fieldsHide the fields
accountNumberstringRequiredYour account number with the platform, as the gaining carrier quotes it. The same for every number of your organization; not a secret — the PIN is.
cancelledAtstring (date-time) | nullRequiredcompletedAtstring (date-time) | nullRequiredcreatedAtstring (date-time)RequiredfailedAtstring (date-time) | nullRequiredfailurePublicPortOutFailure | nullRequired2 fields of
failurecodestring | nullRequiredPIN_EXPIRED, or the carrier’s own code.reasonstring | nullRequired
focDatestring | nullRequiredThe date the gaining carrier committed to (YYYY-MM-DD).
gainingCarrierstring | nullRequiredidstring (uuid)RequirednumberstringRequirednumberIdstring (uuid)RequiredobjectstringRequiredOne of
number_port_outpinExpiresAtstring (date-time)RequiredstatusstringRequiredunlocked(a gaining carrier may take the number withaccountNumberand the transfer PIN untilpinExpiresAt; it stays live and yours meanwhile) →completed(it left the platform: no longer yours, no further rentals); orfailed(refused, given up, or the PIN expired —failuresays which — and relocked: still yours) orcancelled(you relocked it, or released the number).One of
unlockedcompletedfailedcancelledtransferPinstringRequiredThe transfer PIN the gaining carrier quotes (8 digits). Answered once, here, and never again — not on reads, not in events. Unlocking again issues a new one and voids this.
updatedAtstring (date-time)RequiredversionintegerRequiredat least 1
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such number.409PORT_OUT_NUMBER_NOT_PORTABLE (only an assigned or suspended number of yours), PORT_OUT_VERSION_CONFLICT (moved meanwhile: retry); or IDEMPOTENCY_KEY_IN_FLIGHT.422TEST_MODE_UNSUPPORTED — a test key cannot rent, port or register a real number (its own numbers are sandbox numbers); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X POST 'https://api.trovacast.com/v1/numbers/NUMBER_ID/port-out' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{}'{
"accountNumber": "TC3F2A9B1C4D5E",
"cancelledAt": "2026-11-05T10:00:00.000Z",
"completedAt": "2026-11-05T10:00:00.000Z",
"createdAt": "2026-11-05T10:00:00.000Z",
"failedAt": "2026-11-05T10:00:00.000Z",
"failure": {
"code": "PIN_EXPIRED",
"reason": "REASON"
},
"focDate": "2026-11-20",
"gainingCarrier": "GAINING_CARRIER",
"id": "ID",
"number": "+14155550123",
"numberId": "NUMBER_ID",
"object": "number_port_out",
"pinExpiresAt": "2026-11-05T10:00:00.000Z",
"status": "unlocked",
"transferPin": "04718263",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1
}Cancel number port out
post
Relocks a number being ported out; its transfer PIN is void.
Stops the move while the number is unlocked: the port-out is cancelled, its PIN void at once, the number stays yours (number.port_out.updated). Refused with 409 PORT_OUT_NOT_OPEN when the number is not being ported out.
Access: an organization key with the numbers:write scope.
Path parameters
numberIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Response 200PublicNumberPortOut
Its fields are listed under Get port out.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such number.409PORT_OUT_NOT_OPEN (nothing to relock), PORT_OUT_VERSION_CONFLICT (moved meanwhile: read it again); or IDEMPOTENCY_KEY_IN_FLIGHT.422TEST_MODE_UNSUPPORTED — a test key cannot rent, port or register a real number (its own numbers are sandbox numbers); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X POST 'https://api.trovacast.com/v1/numbers/NUMBER_ID/port-out/cancel' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"accountNumber": "TC3F2A9B1C4D5E",
"cancelledAt": "2026-11-05T10:00:00.000Z",
"completedAt": "2026-11-05T10:00:00.000Z",
"createdAt": "2026-11-05T10:00:00.000Z",
"failedAt": "2026-11-05T10:00:00.000Z",
"failure": {
"code": "PIN_EXPIRED",
"reason": "REASON"
},
"focDate": "2026-11-20",
"gainingCarrier": "GAINING_CARRIER",
"id": "ID",
"number": "+14155550123",
"numberId": "NUMBER_ID",
"object": "number_port_out",
"pinExpiresAt": "2026-11-05T10:00:00.000Z",
"status": "unlocked",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1
}Release number
post
Cancels a hold, or releases a number (no further rentals).
A number on hold goes straight back on sale (available in this answer: it is no longer yours). An assigned or suspended number stops renting, loses its inbound route, caller-ID allocations and SMS sender, and is quarantined (releasing) before it is sold again. A test key’s sandbox number is deleted at once (retired in this answer), its digits free again, and its open sandbox 10DLC assignments end with it (sms.registration.updated, removed). Sent under the version you read; refused with 409 NUMBER_NOT_AVAILABLE when it is already being released.
Access: an organization key with the numbers:write scope.
Path parameters
numberIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
versionintegerRequiredThe number’s
versionas read.at least 1
Response 200PublicPhoneNumber
Its fields are listed under Get number.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such number.409NUMBER_NOT_AVAILABLE (already being released), NUMBER_VERSION_CONFLICT — the number changed since you read it: read it again and retry with itsversion; or IDEMPOTENCY_KEY_IN_FLIGHT.422IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X POST 'https://api.trovacast.com/v1/numbers/NUMBER_ID/release' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"version": 5
}'{
"assignedAt": "2026-11-05T10:00:00.000Z",
"capabilities": {
"sms": true,
"voiceInbound": true,
"voiceOutbound": true
},
"country": "IN",
"currency": "INR",
"dltHeaderId": "DLT_HEADER_ID",
"id": "ID",
"label": "LABEL",
"livemode": true,
"metadata": {
"businessId": "biz_42"
},
"monthlyFeeMinor": 1,
"number": "+918035550100",
"object": "phone_number",
"paidThrough": "2026-11-05T10:00:00.000Z",
"pendingCompliance": true,
"provider": "airtel",
"reference": "customer_8812",
"releasedAt": "2026-11-05T10:00:00.000Z",
"reservedUntil": "2026-11-05T10:00:00.000Z",
"route": {
"ai": {
"firstMessage": "FIRST_MESSAGE",
"instructions": "INSTRUCTIONS",
"optOut": {
"key": "KEY",
"phrases": [
"PHRASES"
],
"reply": "REPLY"
},
"session": {
"timeoutSeconds": 1,
"url": "URL"
},
"tools": [
{
"description": "DESCRIPTION",
"name": "NAME",
"parameters": {},
"url": "URL"
}
],
"transfer": {
"phoneId": "PHONE_ID",
"ringTimeoutSeconds": 5,
"whisper": "WHISPER"
}
},
"identity": null,
"kind": "none",
"targetId": "TARGET_ID"
},
"setupFeeMinor": 1,
"status": "reserved",
"suspensionReason": "non_payment",
"type": "local",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1,
"warnings": [
{
"agentId": "AGENT_ID",
"callType": "manual",
"code": "BILLING_RATE_UNAVAILABLE",
"direction": "inbound",
"message": "The Pay as you go plan does not price inbound AI calls on plivo, so calls to this number are refused (BILLING_RATE_UNAVAILABLE): the caller hears a short apology and the call is recorded failed until it does. GET /v1/pricing lists the plan's rates.",
"provider": "airtel",
"reason": "voice_key_missing",
"step": {
"index": 1,
"node": "main"
}
}
]
}Replace number route
put
Replaces a number’s whole routing with a call-flow document, under your own rising version.
The flow document (hours, ringing, voicemail and all — the grammar of POST /v1/call-flows) becomes a new published version of the number’s own call flow — one per number, named after it and made on first use — and the number routes to it, in one transaction: every call that arrives after the answer runs it, a call already running keeps the version it started with. version is yours and only rises: a version higher than the one the number holds is applied; a lower one — a change that arrived late, after a newer one — is ignored (stale), so two quick changes sent out of order leave the newer one live; the applied version sent again with the same flow is unchanged (a safe retry), with another flow stale. The answer says which, with the version the number holds and the number. Validated first: 422 CALL_FLOW_INVALID with its issues (paths under flow.). Only an assigned number that takes inbound calls (409 NUMBER_NOT_ASSIGNED). Audited against the key (phone_number.route_document, with the document’s hash).
Access: an organization key with the numbers:write scope.
Path parameters
numberIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
flowobjectRequiredThe whole of the number’s routing as a call-flow document (
{ "version": 1, "start": "…", "nodes": { … } }, the grammar ofPOST /v1/call-flows; JSON SchemaCallFlowDocument) — hours, ringing, voicemail and all. Validated first, every queue, seat, AI agent and caller ID it names included (422 CALL_FLOW_INVALID, issues underflow.…). At most 64 KB.versionintegerRequiredYour own version of this routing, rising with every change you make (a counter, or a timestamp in milliseconds). Only a version higher than the one the number holds replaces it: one that arrives late, after a newer one, is ignored (
outcome: stale), so two quick changes sent out of order leave the newer one live. Sending the applied version again with the sameflowisunchanged— a safe retry.1–9007199254740991
Response 200PublicNumberRouteDocument
callFlowIdstring (uuid) | nullRequiredThe number’s own call flow — one per number, named after it, a new published version per change (
GET /v1/call-flows/{callFlowId}/versionsis its history).callFlowVersionIdstring (uuid) | nullRequiredThe version of that flow the number runs.
numberPublicPhoneNumberRequiredIts fields are listed under Get number
numberIdstring (uuid)RequiredobjectstringRequiredOne of
number_routeoutcomestringRequiredapplied: yourflowis the number’s routing now.unchanged: thisversionwith thisflowwas already applied (a retry).stale: the number holds a newer version — or this version with another flow — so nothing changed.One of
appliedunchangedstaleversionintegerRequiredYour version the number holds now: yours when applied, the newer one when stale.
Errors
400VALIDATION_FAILED — noflowobject, aversionthat is not a whole number from 1, or a number that takes no inbound calls.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such number.409NUMBER_NOT_ASSIGNED (only an assigned number can be routed); or IDEMPOTENCY_KEY_IN_FLIGHT.422CALL_FLOW_INVALID (withissues: each problem’spathandmessage); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X PUT 'https://api.trovacast.com/v1/numbers/NUMBER_ID/route' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"flow": {
"nodes": {
"hours": [
{
"closed": {
"node": "voicemail"
},
"open": {
"node": "ring"
},
"schedule": {
"holidays": [
"2026-12-25"
],
"timezone": "America/New_York",
"weekly": [
{
"day": 1,
"end": "18:00",
"start": "08:00"
},
{
"day": 2,
"end": "18:00",
"start": "08:00"
},
{
"day": 3,
"end": "18:00",
"start": "08:00"
},
{
"day": 4,
"end": "18:00",
"start": "08:00"
},
{
"day": 5,
"end": "18:00",
"start": "08:00"
}
]
},
"verb": "hours"
}
],
"ring": [
{
"confirm": {
"key": "1",
"prompt": "A customer is calling. Press 1 to take it."
},
"notice": "This call may be recorded.",
"onNoAnswer": {
"node": "voicemail"
},
"record": true,
"strategy": "sequential",
"targets": [
{
"number": "+14155550101",
"reference": "staff_sam"
},
{
"number": "+14155550102",
"reference": "staff_alex",
"skip": {
"spans": [
{
"end": "2026-12-08T00:00:00Z",
"start": "2026-12-01T00:00:00Z"
}
]
}
}
],
"timeoutSeconds": 20,
"totalTimeoutSeconds": 45,
"verb": "connect"
}
],
"voicemail": [
{
"keys": [
"9"
],
"notice": "Your message will be recorded.",
"prompt": [
{
"text": "Please leave a message after the tone, or press 9 to stop our calls.",
"verb": "say"
}
],
"reply": "Done. We will not call you again.",
"verb": "voicemail"
},
{
"verb": "hangup"
}
]
},
"start": "hours",
"version": 1
},
"version": 1731740000000
}'{
"callFlowId": "CALL_FLOW_ID",
"callFlowVersionId": "CALL_FLOW_VERSION_ID",
"number": {
"assignedAt": "2026-11-05T10:00:00.000Z",
"capabilities": {
"sms": true,
"voiceInbound": true,
"voiceOutbound": true
},
"country": "IN",
"currency": "INR",
"dltHeaderId": "DLT_HEADER_ID",
"id": "ID",
"label": "LABEL",
"livemode": true,
"metadata": {
"businessId": "biz_42"
},
"monthlyFeeMinor": 1,
"number": "+918035550100",
"object": "phone_number",
"paidThrough": "2026-11-05T10:00:00.000Z",
"pendingCompliance": true,
"provider": "airtel",
"reference": "customer_8812",
"releasedAt": "2026-11-05T10:00:00.000Z",
"reservedUntil": "2026-11-05T10:00:00.000Z",
"route": {
"ai": {
"firstMessage": "FIRST_MESSAGE",
"instructions": "INSTRUCTIONS",
"optOut": {
"key": "KEY",
"phrases": [
"PHRASES"
],
"reply": "REPLY"
},
"session": {
"timeoutSeconds": 1,
"url": "URL"
},
"tools": [
{
"description": "DESCRIPTION",
"name": "NAME",
"parameters": {},
"url": "URL"
}
],
"transfer": {
"phoneId": "PHONE_ID",
"ringTimeoutSeconds": 5,
"whisper": "WHISPER"
}
},
"identity": null,
"kind": "none",
"targetId": "TARGET_ID"
},
"setupFeeMinor": 1,
"status": "reserved",
"suspensionReason": "non_payment",
"type": "local",
"updatedAt": "2026-11-05T10:00:00.000Z",
"version": 1,
"warnings": [
{
"agentId": "AGENT_ID",
"callType": "manual",
"code": "BILLING_RATE_UNAVAILABLE",
"direction": "inbound",
"message": "The Pay as you go plan does not price inbound AI calls on plivo, so calls to this number are refused (BILLING_RATE_UNAVAILABLE): the caller hears a short apology and the call is recorded failed until it does. GET /v1/pricing lists the plan's rates.",
"provider": "airtel",
"reason": "voice_key_missing",
"step": {
"index": 1,
"node": "main"
}
}
]
},
"numberId": "NUMBER_ID",
"object": "number_route",
"outcome": "applied",
"version": 1
}Register number SMS sender
post
Registers one of your SMS-capable numbers outside India as an SMS sender (long code).
For texts to destinations where a long code is the sender: the number must be assigned, SMS-capable and outside India (India texts from a DLT header). Active at once and idempotent — registering it again answers the same sender, listed by GET /v1/sms/senders; releasing the number removes it. Refused with 409 NUMBER_NOT_AVAILABLE for a number that is not assigned and 422 NUMBER_SMS_UNSUPPORTED for one without SMS or an Indian one.
Access: an organization key with the numbers:write scope.
Path parameters
numberIdstringRequired
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Response 200PublicSmsLongCodeSender
countrystringRequiredidstring (uuid)RequirednumberIdstring (uuid)RequiredobjectstringRequiredOne of
sms_sendersenderstringRequiredThe long code texts are sent from.
statusstringRequiredOne of
activepending_verificationrestricteddisabled
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such number.409NUMBER_NOT_AVAILABLE — only an assigned number can send SMS; or IDEMPOTENCY_KEY_IN_FLIGHT.422NUMBER_SMS_UNSUPPORTED — the number has no SMS, or is Indian (India texts from a DLT header); TEST_MODE_UNSUPPORTED — a test key cannot rent, port or register a real number (its own numbers are sandbox numbers); or IDEMPOTENCY_KEY_REUSED.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X POST 'https://api.trovacast.com/v1/numbers/NUMBER_ID/sms-sender' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"country": "US",
"id": "ID",
"numberId": "NUMBER_ID",
"object": "sms_sender",
"sender": "+14155550123",
"status": "active"
}