Jump to

  • Quickstarts
  • API reference
  • Webhook events
  • Error codes
  • SDKs

API reference

Numbers

How these fit together: the Phone numbers guide.

List numbers

get/v1/numbers

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

  • limitinteger

    How many items to return.

  • cursorstring

    The nextCursor of the previous page. Omit for the first page.

  • statusstring

    Only numbers in this status. Default: every one you hold.

    One ofreservedassignedsuspendedreleasing

  • capabilitystring

    Only numbers with this capability — sms lists the long codes you may make SMS senders (POST /v1/numbers/{id}/sms-sender).

    One ofsmsvoice_inboundvoice_outbound

  • referencestring

    Only numbers carrying this reference (yours, given when ordering or by PATCH).

Response 200PublicPhoneNumberPage

  • dataPublicPhoneNumber[]Required

    Its fields are listed under Get number

  • nextCursorstring | nullRequired

    Pass back as cursor for the next page; null on the last.

Errors

Request
curl 'https://api.trovacast.com/v1/numbers' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/numbers

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-Keystring

    Makes 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

  • areaCodestring

    With country: the area code as dialled at home (415; UK 020, 0161, 0330) — a leading national trunk prefix (the UK’s 0) is dropped. Not with prefix.

  • countrystring

    T7 — 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 areaCode or prefix, type and sms. Nothing that matches is 409 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 of A-Za-z0-9_.-), values ≤ 500 characters. Never personal data.

  • numberstring

    Supplier stock: a number from GET /v1/numbers/available with source: supplier and orderable: true, in E.164, with its provider. 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 its version.

  • orderIdstring

    T7: your own id for this order, for good: the same orderId again answers this order — the number it bought, as it is now — never a second number, however late the retry; with another request it is 409 NUMBER_ORDER_CONFLICT (as it is once the number is no longer yours), and while the first is still being placed 409 NUMBER_ORDER_IN_PROGRESS. A refused order frees its orderId. A-Za-z0-9_.:-, 1–200.

    at most 200 characters

  • prefixstring

    With country: digits right after the country code, as GET /v1/numbers/available takes them. Not with areaCode.

  • providerstring

    With number: the channel the search named for it.

    One ofairtelexotelplivotelnyxtwilio

  • referencestring

    T7: your reference for the number (who it is for), kept on it (reference) and listed by GET /v1/numbers?reference=.

    at most 200 characters

  • smsboolean

    With country: only numbers that can send and receive texts.

  • typestring

    With country: only numbers of this type.

    One oflocalmobiletoll_freenationalpromotional_140transactional_160short_code

  • versioninteger

    With numberId: the number’s version as read.

    at least 1

Response 201PublicNumberOrder

  • activatedbooleanRequired

    True when the number is yours now (assigned: setup fee and first month paid from the wallet).

  • numberPublicPhoneNumberRequired

    Its fields are listed under Get number

  • objectstringRequired

    One ofnumber_order

  • orderIdstring | nullRequired

    Your orderId, when you sent one: the same id again answers this order, with its number as it is now.

  • pendingPublicNumberPending | nullRequired

    Why it stays reserved, when it does. Fix it, then POST /v1/numbers/{numberId}/activate before reservedUntil.

    2 fields of pending
    • codestring | nullRequired

      The 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 for number.updated (it activates, and is charged, once approved).

    • messagestringRequired

Errors

Request
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
}'
Response 201 (json)
{
  "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/v1/numbers/available

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

  • countrystringRequired

    ISO 3166-1 alpha-2.

  • typestring

    One oflocalmobiletoll_freenationalpromotional_140transactional_160short_code

  • prefixstring

    Digits right after the country code (an area code).

  • limitinteger

  • includeSupplierStockboolean

    Also 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[]Required

    14 fields of data
    • capabilitiesPublicNumberCapabilitiesRequired

      3 fields of capabilities
      • smsbooleanRequired

      • voiceInboundbooleanRequired

      • voiceOutboundbooleanRequired

    • countrystringRequired

    • currencystring | nullRequired

    • idstring (uuid) | nullRequired

      What POST /v1/numbers takes as numberId; null for supplier stock.

    • monthlyFeeMinorinteger | nullRequired

      The monthly rental, minor units. Null for supplier stock: the platform has not priced it, and a carrier’s cost is not a price.

    • numberstringRequired

    • objectstringRequired

      One ofavailable_number

    • orderablebooleanRequired

      Whether POST /v1/numbers takes it: inventory always; supplier stock when it is on sale at a price of your plan (with number and provider).

    • providerstringRequired

      The channel (carrier) the number lives on. Pass it as provider with number to order supplier stock.

      One ofairtelexotelplivosimtelnyxtwilio

    • regionstring | nullRequired

    • setupFeeMinorinteger | nullRequired

    • sourcestringRequired

      inventory is the platform’s stock; supplier is 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 ofinventorysupplier

    • typestringRequired

      One oflocalmobiletoll_freenationalpromotional_140transactional_160short_code

    • versioninteger | nullRequired

      Pass back as version on POST /v1/numbers (the price you saw is the price you pay); null for supplier stock.

  • nextCursorstring | nullRequired

    Pass back as cursor for the next page; null on the last.

  • warningsPublicNumberSearchWarning[]Required

    The 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 warnings
    • codestringRequired

      One ofNUMBER_SUPPLIER_UNAVAILABLE

    • messagestringRequired

    • orderablebooleanRequired

      True when its stock would have been orderable at your plan’s price; false when it is indicative only.

    • retryAfterSecondsintegerRequired

      When to search again for its stock.

    • supplierstringRequired

      The supplier whose stock is missing from this answer.

      One ofairtelexotelplivosimtelnyxtwilio

Errors

Request
curl 'https://api.trovacast.com/v1/numbers/available?country=IN&type=local&prefix=80' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/numbers/port-outs

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

  • limitinteger

    How many items to return.

  • cursorstring

    The nextCursor of the previous page. Omit for the first page.

  • statusstring

    One ofunlockedcompletedfailedcancelled

  • numberIdstring (uuid)

    One number’s only.

Response 200PublicNumberPortOutPage

  • dataPublicNumberPortOut[]Required

    Its fields are listed under Get port out

  • nextCursorstring | nullRequired

    Pass back as cursor for the next page; null on the last.

Errors

Request
curl 'https://api.trovacast.com/v1/numbers/port-outs' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/numbers/port-outs/{portOutId}

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 fields
  • accountNumberstringRequired

    Your 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) | nullRequired

  • completedAtstring (date-time) | nullRequired

  • createdAtstring (date-time)Required

  • failedAtstring (date-time) | nullRequired

  • failurePublicPortOutFailure | nullRequired

    2 fields of failure
    • codestring | nullRequired

      PIN_EXPIRED, or the carrier’s own code.

    • reasonstring | nullRequired

  • focDatestring | nullRequired

    The date the gaining carrier committed to (YYYY-MM-DD).

  • gainingCarrierstring | nullRequired

  • idstring (uuid)Required

  • numberstringRequired

  • numberIdstring (uuid)Required

  • objectstringRequired

    One ofnumber_port_out

  • pinExpiresAtstring (date-time)Required

  • statusstringRequired

    unlocked (a gaining carrier may take the number with accountNumber and the transfer PIN until pinExpiresAt; it stays live and yours meanwhile) → completed (it left the platform: no longer yours, no further rentals); or failed (refused, given up, or the PIN expired — failure says which — and relocked: still yours) or cancelled (you relocked it, or released the number).

    One ofunlockedcompletedfailedcancelled

  • updatedAtstring (date-time)Required

  • versionintegerRequired

    at least 1

Errors

Request
curl 'https://api.trovacast.com/v1/numbers/port-outs/PORT_OUT_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/numbers/port-requests

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

  • limitinteger

    How many items to return.

  • cursorstring

    The nextCursor of the previous page. Omit for the first page.

  • statusstring

    One ofsubmittedin_reviewapprovedrejectedcompletedcancelled

Response 200PublicNumberPortRequestPage

  • dataPublicNumberPortRequest[]Required

    Its fields are listed under Get port request

  • nextCursorstring | nullRequired

    Pass back as cursor for the next page; null on the last.

Errors

Request
curl 'https://api.trovacast.com/v1/numbers/port-requests' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/numbers/port-requests

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-Keystring

    Makes 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

  • countrystringRequired

    ISO 3166-1 alpha-2.

  • currentCarrierstringRequired

    The carrier the numbers are leaving.

    at most 120 characters

  • loaDocumentIdstring (uuid)Required

    The signed letter of authority: a NUMBER_LOA document you uploaded to your business verification (console › Settings › Verification).

  • numberTypestringRequired

    One oflocalmobiletoll_freenationalpromotional_140transactional_160short_code

  • numbersstring[]Required

    The 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

Request
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"
  ]
}'
Response 201 (json)
{
  "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/v1/numbers/port-requests/{portRequestId}

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 fields
  • cancelledAtstring (date-time) | nullRequired

  • completedAtstring (date-time) | nullRequired

  • completedNumbersPublicPortedNumber[]Required

    T7: once completed, each number as it now is on the platform — yours, with its id; empty before.

    2 fields of completedNumbers
    • numberstringRequired

    • numberIdstring (uuid)Required

      GET /v1/numbers/{numberId}.

  • countrystringRequired

  • createdAtstring (date-time)Required

  • currentCarrierstringRequired

  • focDatestring | nullRequired

    The date the losing carrier committed to (YYYY-MM-DD).

  • idstring (uuid)Required

  • loaDocumentIdstring (uuid) | nullRequired

  • numberTypestringRequired

    One oflocalmobiletoll_freenationalpromotional_140transactional_160short_code

  • numbersstring[]Required

  • objectstringRequired

    One ofnumber_port_request

  • rejectionPublicPortRejection | nullRequired

    T7: a rejected request’s reason in the losing carrier’s words, and its code (each null when it named none); null otherwise. reviewNote is the platform’s own word.

    2 fields of rejection
    • codestring | nullRequired

    • reasonstring | nullRequired

  • reviewNotestring | nullRequired

  • reviewedAtstring (date-time) | nullRequired

  • statusstringRequired

    submitted → in_review → approved (the platform runs the port with the carrier; focDate once committed) → completed (the numbers are yours: GET /v1/numbers); or rejected (reviewNote says why) or cancelled (by you).

    One ofsubmittedin_reviewapprovedrejectedcompletedcancelled

  • updatedAtstring (date-time)Required

  • versionintegerRequired

    at least 1

Errors

Request
curl 'https://api.trovacast.com/v1/numbers/port-requests/PORT_REQUEST_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/numbers/port-requests/{portRequestId}/cancel

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-Keystring

    Makes 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

  • versionintegerRequired

    The number’s version as read.

    at least 1

Response 200PublicNumberPortRequest

Its fields are listed under Get port request.

Errors

Request
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
}'
Response 200 (json)
{
  "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/v1/numbers/{numberId}

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 fields
  • assignedAtstring (date-time) | nullRequired

  • capabilitiesPublicNumberCapabilitiesRequired

    3 fields of capabilities
    • smsbooleanRequired

    • voiceInboundbooleanRequired

    • voiceOutboundbooleanRequired

  • countrystringRequired

  • currencystringRequired

  • dltHeaderIdstring (uuid) | nullRequired

    The VERIFIED voice DLT header a 140/160-series number is registered under (India).

  • idstring (uuid)Required

  • labelstring | nullRequired

  • livemodebooleanRequired

    False 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>Required

    Your 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.

  • monthlyFeeMinorintegerRequired

    The monthly rental, minor units of currency.

  • numberstringRequired

    E.164 with the leading +. The business’s own number, so it is never masked.

  • objectstringRequired

    One ofphone_number

  • paidThroughstring (date-time) | nullRequired

    The rental is paid up to (exclusive) this instant; the next month is debited then.

  • pendingCompliancebooleanRequired

    True while the number’s carrier holds it for its regulator’s review: bought for you but not live, reserved without a reservedUntil (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 fresh reservedUntil); a rejection hands it back. Either is told as number.updated. Release it to give it up.

  • providerstringRequired

    The channel (carrier) the number lives on.

    One ofairtelexotelplivosimtelnyxtwilio

  • referencestring | nullRequired

    Your own reference for the number — who it is for — given when you ordered it (POST /v1/numbers) or by PATCH; GET /v1/numbers?reference= finds it. Cleared when the number leaves you.

    at most 200 characters

  • releasedAtstring (date-time) | nullRequired

  • reservedUntilstring (date-time) | nullRequired

    When a reserved hold lapses and the number goes back on sale.

  • routePublicNumberRouteRequired

    4 fields of route
    • aiPublicAiRouteOptions | nullRequired

      T5: an ai route’s own options for the calls it answers; null for every other kind, and for an ai route that sets none.

      6 fields of ai
      • firstMessagestring | nullRequired

      • instructionsstring | nullRequired

      • optOutPublicAiOptOutRead | nullRequired

        3 fields of optOut
        • keystring | nullRequired

        • phrasesstring[]Required

        • replystringRequired

      • sessionPublicAgentSessionRead | nullRequired

        2 fields of session
        • timeoutSecondsintegerRequired

          1–10

        • urlstringRequired

      • toolsPublicAiCallToolRead[] | nullRequired

        Null: the agent’s own tools.

        4 fields of tools
        • descriptionstringRequired

        • namestringRequired

        • parametersobjectRequired

        • urlstringRequired

      • transferPublicAiTransferRead | nullRequired

        3 fields of transfer
        • phoneIdstring (uuid)Required

        • ringTimeoutSecondsintegerRequired

          5–120

        • whisperstring | nullRequired

    • identitystring | nullRequired

      The client identity a client route rings (POST /v1/voice/access-tokens); null for every other kind.

    • kindstringRequired

      Where 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), or none (the organization’s default routing).

      One ofnoneflowapplicationqueueagentaiclient

    • targetIdstring (uuid) | nullRequired

      The flow, application, queue, membership or AI agent id; null for none and client.

  • setupFeeMinorintegerRequired

    The one-off setup fee, minor units.

  • statusstringRequired

    reserved (on hold: not yet verified or paid), assigned (yours, dialling and taking calls), suspended (suspensionReason), releasing (quarantined after a release). available only in the answer that cancelled a hold: the number went back on sale.

    One ofreservedassignedsuspendedreleasingavailable

  • suspensionReasonstring | nullRequired

    non_payment: a rental the wallet could not pay (lifted once one is paid); platform: held by the platform.

    One ofnon_paymentplatform

  • typestringRequired

    One oflocalmobiletoll_freenationalpromotional_140transactional_160short_code

  • updatedAtstring (date-time)Required

  • versionintegerRequired

    Pass back as version on every change: each is a compare-and-set on it (409 NUMBER_VERSION_CONFLICT when it moved).

  • warningsPublicNumberWarning[]Required

    What 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 warnings
    • agentIdstring (uuid) | nullRequired

      The AI agent it is about — an ai route’s, or the flow step’s (2026-11-07); null for a route with none.

    • callTypestringRequired

      What the warning prices or runs: full_ai for an AI agent — a route to one, or a flow’s AI step — and manual for every other route (a flow, an application, a queue, a seat, a client identity).

      One ofmanualfull_ai

    • codestringRequired

      BILLING_RATE_UNAVAILABLE: your plan has no rate for the inbound calls this route answers (step null) — each is refused with a short apology and recorded failed with this code (call.failed) — or for the AI call an AI step of the route’s flow makes of them (step set) — 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/pricing lists the plan’s rates. AI_PROVIDER_UNAVAILABLE (2026-11-07): the AI agent the route answers with (step null) — each call is refused AI_AGENT_UNAVAILABLE — or an AI step of its flow hands the caller to (step set) — the caller takes the step’s fallback — cannot speak on this deployment; reason says why, as GET /v1/agents/{agentId} reports it. AI_AGENT_UNAVAILABLE: the same agent cannot take the caller for any other reason the call is refused on — reason AI_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; message says which) or TEST_AGENT (a test agent answers test calls only); a route’s calls are refused AI_AGENT_UNAVAILABLE, and a flow step’s caller takes its fallback (the step refused AI_CALLS_DISABLED or AI_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 ofBILLING_RATE_UNAVAILABLEAI_PROVIDER_UNAVAILABLEAI_AGENT_UNAVAILABLE

    • directionstringRequired

      One ofinbound

    • messagestringRequired

    • providerstringRequired

      The channel the calls arrive on: the number’s own.

      One ofairtelexotelplivosimtelnyxtwilio

    • reasonstring | nullRequired

      AI_PROVIDER_UNAVAILABLE (2026-11-07): why the agent cannot speak here, as its availability.reason reads (lower case). AI_AGENT_UNAVAILABLE: why it cannot take the caller — AI_CALLS_DISABLED, AGENT_INACTIVE or TEST_AGENT. Null for BILLING_RATE_UNAVAILABLE.

      One ofvoice_key_missingagent_id_missingtranscription_key_missingreasoning_key_missingmodel_unknownAI_CALLS_DISABLEDAGENT_INACTIVETEST_AGENT

    • stepPublicNumberWarningStep | nullRequired

      The AI step of the route’s flow it is about (2026-11-07); null when it is about the route itself.

      2 fields of step
      • indexintegerRequired

        Its position in the node, from 0: the step is nodes.<node>.<index> of the flow’s published version (the path POST /v1/call-flows/validate names its issues by).

        at least 0

      • nodestringRequired

        The node the step is in.

Errors

Request
curl 'https://api.trovacast.com/v1/numbers/NUMBER_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "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/v1/numbers/{numberId}

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-Keystring

    Makes 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) | null

    Links 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 | null

    Your 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 by GET /v1/calls?metadata=key:value). Replaces what it had; {} clears it (null is refused). At most 20 keys (1–40 of A-Za-z0-9_.-), values ≤ 500 characters. Never put personal data here: it is stored unencrypted.

  • referencestring | null

    T7: your own reference for the number (who it is for); null clears it.

    at most 200 characters

  • routePublicNumberRouteInput

    Where inbound calls go. An assigned number that takes inbound calls only.

    4 fields of route
    • aiPublicAiCallOptions

      T5 — with ai only: 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 without ai keeps 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 ai
      • firstMessagestring

        What 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

      • instructionsstring

        The agent’s instructions for this call, in place of its own (its language and the call’s objective are still added). Stored sealed with the call.

        1–20000 characters

      • optOutPublicAiOptOut

        The built-in opt-out: the caller presses key or says one of phrases, and at once the contact is marked do-not-call (call.ai.opt_out tells it), the agent says reply and the call ends. A key or phrases, or both.

        3 fields of optOut
        • keystring

          The key that opts the caller out.

          One of0123456789*#

        • 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

        • replystring

          Said to the caller, in the agent’s voice, before the call ends.

          at most 500 charactersdefault "Understood. We will not call you again. Goodbye."

      • sessionPublicAgentSession

        Your 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 session
        • timeoutSecondsinteger

          How long the caller may wait for your answer, in seconds. They hear silence meanwhile.

          1–10default 5

        • urlstringRequired

          Your HTTPS endpoint, asked once when the conversation starts: a POST of { event: "agent.session", requestId, agentId, callId, source, call, timestamp } (source: call, number_route or flow_step; call the tool call’s context), signed with the agent’s tool-signing secret (Trovacast-Signature). Answer 2xx JSON (at most 64 KB) with any of firstMessage (null: none), firstSpeaker, instructions, language, endCallPhrases, maxTurns, tools, transfer and optOut — 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 with POST /v1/agents/{agentId}/tool-secret).

        at most 10 items

        4 fields of tools
        • descriptionstringRequired

          When the model should use it — the model reads this.

          1–1000 characters

        • namestringRequired

          What the model calls it: a letter, then letters, digits, _ or - (at most 64). Unique within the call.

        • parametersobjectRequired

          The arguments, as an object schema — the JSON Schema subset an agent’s own tools take (POST /v1/agents).

        • urlstringRequired

          Your 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, answered 2xx within 4 seconds. The URL rules of webhook endpoints apply.

          at most 2048 characters

      • transferPublicAiTransfer

        A person the agent may hand the caller to: the agent is offered a transfer_to_person tool, 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.transfer says what came of it. Exactly one of number or phoneId (a route takes phoneId only).

        4 fields of transfer
        • numberstring

          An 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/calls only — 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.

        • ringTimeoutSecondsinteger

          How long the person rings before the caller goes back to the agent.

          5–120default 30

        • whisperstring

          Spoken to the person who answers, before they are connected.

          at most 500 characters

    • identitystring

      Required 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 whose incoming grant is on) rings; the first to accept takes the call, and nobody answering in 30 s ends it as busy.

      at most 64 characters

    • kindstringRequired

      One ofnoneflowapplicationqueueagentaiclient

    • targetIdstring (uuid) | null

      Required 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.

  • versionintegerRequired

    The number’s version as read.

    at least 1

Response 200PublicPhoneNumber

Its fields are listed under Get number.

Errors

Request
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"
  }
}'
Response 200 (json)
{
  "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/v1/numbers/{numberId}/activate

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-Keystring

    Makes 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

  • versionintegerRequired

    The number’s version as read.

    at least 1

Response 200PublicPhoneNumber

Its fields are listed under Get number.

Errors

Request
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
}'
Response 200 (json)
{
  "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/v1/numbers/{numberId}/port-out

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-Keystring

    Makes 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

  • validForDaysinteger

    How 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 fields
  • accountNumberstringRequired

    Your 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) | nullRequired

  • completedAtstring (date-time) | nullRequired

  • createdAtstring (date-time)Required

  • failedAtstring (date-time) | nullRequired

  • failurePublicPortOutFailure | nullRequired

    2 fields of failure
    • codestring | nullRequired

      PIN_EXPIRED, or the carrier’s own code.

    • reasonstring | nullRequired

  • focDatestring | nullRequired

    The date the gaining carrier committed to (YYYY-MM-DD).

  • gainingCarrierstring | nullRequired

  • idstring (uuid)Required

  • numberstringRequired

  • numberIdstring (uuid)Required

  • objectstringRequired

    One ofnumber_port_out

  • pinExpiresAtstring (date-time)Required

  • statusstringRequired

    unlocked (a gaining carrier may take the number with accountNumber and the transfer PIN until pinExpiresAt; it stays live and yours meanwhile) → completed (it left the platform: no longer yours, no further rentals); or failed (refused, given up, or the PIN expired — failure says which — and relocked: still yours) or cancelled (you relocked it, or released the number).

    One ofunlockedcompletedfailedcancelled

  • transferPinstringRequired

    The 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)Required

  • versionintegerRequired

    at least 1

Errors

Request
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 '{}'
Response 201 (json)
{
  "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/v1/numbers/{numberId}/port-out/cancel

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-Keystring

    Makes 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

Request
curl -X POST 'https://api.trovacast.com/v1/numbers/NUMBER_ID/port-out/cancel' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200 (json)
{
  "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/v1/numbers/{numberId}/release

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-Keystring

    Makes 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

  • versionintegerRequired

    The number’s version as read.

    at least 1

Response 200PublicPhoneNumber

Its fields are listed under Get number.

Errors

Request
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
}'
Response 200 (json)
{
  "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/v1/numbers/{numberId}/route

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-Keystring

    Makes 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

  • flowobjectRequired

    The whole of the number’s routing as a call-flow document ({ "version": 1, "start": "…", "nodes": { … } }, the grammar of POST /v1/call-flows; JSON Schema CallFlowDocument) — hours, ringing, voicemail and all. Validated first, every queue, seat, AI agent and caller ID it names included (422 CALL_FLOW_INVALID, issues under flow.…). At most 64 KB.

  • versionintegerRequired

    Your 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 same flow is unchanged — a safe retry.

    1–9007199254740991

Response 200PublicNumberRouteDocument

  • callFlowIdstring (uuid) | nullRequired

    The number’s own call flow — one per number, named after it, a new published version per change (GET /v1/call-flows/{callFlowId}/versions is its history).

  • callFlowVersionIdstring (uuid) | nullRequired

    The version of that flow the number runs.

  • numberPublicPhoneNumberRequired

    Its fields are listed under Get number

  • numberIdstring (uuid)Required

  • objectstringRequired

    One ofnumber_route

  • outcomestringRequired

    applied: your flow is the number’s routing now. unchanged: this version with this flow was already applied (a retry). stale: the number holds a newer version — or this version with another flow — so nothing changed.

    One ofappliedunchangedstale

  • versionintegerRequired

    Your version the number holds now: yours when applied, the newer one when stale.

Errors

Request
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
}'
Response 200 (json)
{
  "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/v1/numbers/{numberId}/sms-sender

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-Keystring

    Makes 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

  • countrystringRequired

  • idstring (uuid)Required

  • numberIdstring (uuid)Required

  • objectstringRequired

    One ofsms_sender

  • senderstringRequired

    The long code texts are sent from.

  • statusstringRequired

    One ofactivepending_verificationrestricteddisabled

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/numbers/NUMBER_ID/sms-sender' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200 (json)
{
  "country": "US",
  "id": "ID",
  "numberId": "NUMBER_ID",
  "object": "sms_sender",
  "sender": "+14155550123",
  "status": "active"
}