Jump to

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

API reference

Phones

List phones

get/v1/phones

Lists the organization’s own phones — the staff handsets its calls may be forwarded to.

Every phone registered with POST /v1/phones, oldest first, in one page (nextCursor is always null). Numbers are masked to their last four digits; tell phones apart by the reference and label you gave them.

Access: an organization key with the settings:read scope.

Response 200PublicPhonePage

  • dataPublicPhone[]Required

    Its fields are listed under Get phone

  • nextCursorstring | nullRequired

    Always null: every phone is in one page.

Errors

Request
curl 'https://api.trovacast.com/v1/phones' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "country": "US",
      "createdAt": "2026-11-05T10:00:00.000Z",
      "id": "ID",
      "label": "Sam’s mobile",
      "number": "•••• ••0142",
      "object": "phone",
      "reference": "staff_8f2c",
      "updatedAt": "2026-11-05T10:00:00.000Z"
    }
  ],
  "nextCursor": "NEXT_CURSOR"
}

Register phone

post/v1/phones

Registers a staff handset as one of the organization’s own phones.

Declares number as a handset your own staff answer. From then on a leg a call flow’s connect, or a transfer, dials to that number is your staff answering their own phone, not a called party: the called party’s calling window (the +1 TCPA window, DESTINATION_CALLING_WINDOW_CLOSED) is not asked of it. It is still a number you dial: it must be one the organization may call — refused with the destination policy’s own code otherwise (422 DESTINATION_BLOCKED, DESTINATION_ACKNOWLEDGEMENT_REQUIRED, DESTINATION_NOT_PRICED) — and every dial to it is priced and asked again. One phone per number: registering a number again updates its label and reference and answers the same phone. Refused 400 OWN_PHONE_IS_CARRIER_NUMBER for one of your own business numbers (nothing would answer it) and 409 OWN_PHONE_LIMIT_REACHED at the limit. Register only handsets of your own staff: a customer’s number registered here would be called outside the hours the law allows, and the registration is audited. A test key registers test phones: a separate list only test keys read, asked only of test calls.

Access: an organization key with the settings: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

  • labelstring

    What you call it. Never read by a rule.

    at most 120 characters

  • numberstringRequired

    The handset, in international format. Stored encrypted and shown masked afterwards.

  • referencestring

    Your own id for whoever holds the phone, echoed back on the resource. Not personal data: it is stored in clear.

    at most 200 characters

Response 201PublicPhone

Its fields are listed under Get phone.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/phones' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "label": "Sam’s mobile",
  "number": "+12125550142",
  "reference": "staff_8f2c"
}'
Response 201 (json)
{
  "country": "US",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "id": "ID",
  "label": "Sam’s mobile",
  "number": "•••• ••0142",
  "object": "phone",
  "reference": "staff_8f2c",
  "updatedAt": "2026-11-05T10:00:00.000Z"
}

Get phone

get/v1/phones/{phoneId}

Reads one of the organization’s own phones.

The phone as GET /v1/phones lists it. 404 for an id that is not one of this organization’s phones.

Access: an organization key with the settings:read scope.

Path parameters

  • phoneIdstringRequired

Response 200PublicPhone

  • countrystringRequired

    ISO 3166-1 alpha-2.

  • createdAtstring (date-time)Required

  • idstring (uuid)Required

  • labelstring | nullRequired

  • numberstringRequired

    The number, masked to its last four digits.

  • objectstringRequired

    One ofphone

  • referencestring | nullRequired

  • updatedAtstring (date-time)Required

Errors

Request
curl 'https://api.trovacast.com/v1/phones/PHONE_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "country": "US",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "id": "ID",
  "label": "Sam’s mobile",
  "number": "•••• ••0142",
  "object": "phone",
  "reference": "staff_8f2c",
  "updatedAt": "2026-11-05T10:00:00.000Z"
}

Remove phone

delete/v1/phones/{phoneId}

Removes one of the organization’s own phones.

Takes the phone off the list: a leg dialled to its number afterwards is a called party’s again, held to every rule of one. Calls already ringing or connected are not touched. Audited. 404 for an id that is not one of this organization’s phones (a phone removed already included).

Access: an organization key with the settings:write scope.

Path parameters

  • phoneIdstringRequired

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 200PublicPhoneDeleted

  • deletedbooleanRequired

    One oftrue

  • idstring (uuid)Required

  • objectstringRequired

    One ofphone

Errors

Request
curl -X DELETE 'https://api.trovacast.com/v1/phones/PHONE_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200 (json)
{
  "deleted": true,
  "id": "ID",
  "object": "phone"
}