Jump to

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

API reference

Voice applications

How these fit together: the Inbound calls guide.

List applications

get/v1/applications

Lists voice applications, newest first.

Every voice application of the organization, newest first. Only the signing secret’s last four characters are listed (secretLast4); livemode: false marks one a test key made, which answers test calls only.

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

Query parameters

  • limitinteger

    How many items to return.

  • cursorstring

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

Response 200PublicApplicationPage

  • dataPublicApplication[]Required

    Its fields are listed under Get application

  • nextCursorstring | nullRequired

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

Errors

Request
curl 'https://api.trovacast.com/v1/applications' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "answerUrl": "ANSWER_URL",
      "createdAt": "2026-11-05T10:00:00.000Z",
      "fallbackFlowId": "FALLBACK_FLOW_ID",
      "fallbackUrl": "FALLBACK_URL",
      "id": "ID",
      "livemode": true,
      "name": "NAME",
      "object": "voice_application",
      "payloadVersion": 1,
      "secretLast4": "a1B2",
      "timeoutMs": 1,
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "version": 1
    }
  ],
  "nextCursor": "NEXT_CURSOR"
}

Create application

post/v1/applications

Creates a voice application (its signing secret is shown once).

answerUrl — and fallbackUrl, asked once when the answer URL fails — must be https on a public host and a port the platform calls, checked now and again on every request. Each request is a JSON POST signed with the application’s secret (Trovacast-Signature, the webhook scheme), returned in this response only, as secret. Refused with 409 VOICE_APPLICATION_NAME_TAKEN for a name another application has; a test key’s application is a test one (livemode: false). Audited against the key (desk.voice_application.create).

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

  • answerUrlstringRequired

    Asked for call instructions (a JSON document of verbs) when a call to a number routed here is answered, and when a /v1/calls FLOW call names the application. https on a public host and a web or unprivileged port, checked now and on every request.

    at most 2048 characters

  • fallbackFlowIdstring (uuid) | null

    T9: a published call flow of yours (of this key’s mode) the call runs when neither the answer URL nor fallbackUrl gives usable instructions — your own routing (ring a phone, take a message) while your server is down, instead of the apology. The call’s timeline says so (application.fallback).

  • fallbackUrlstring | null

    Asked once when the answer URL fails (no answer in time, an error status, an invalid document). Without one — or when it fails too — the call runs fallbackFlowId, or the caller hears an apology and the call ends.

    at most 2048 characters

  • namestringRequired

    at most 120 characters

  • payloadVersioninteger

    The shape of the request the platform sends your answer and fallback URLs (and branch URLs): 2 — call reads as the call resource does (from the calling number and to the number dialled whichever way the call goes, so on an outbound call from is your caller ID and to the contact masked •••• ••3210; lowercase direction; livemode, numberId, contactId), with livemode on the request too — or 1 (deprecated, removed after 2027-02-08): call.from is the contact { contactId, last4 } whichever way the call goes, call.to the business number, direction uppercase. Every request carries version. An application made before 2026-11-06 22:35 UTC (when payload 2 shipped) is on 1 until you switch it.

    One of12

    default 2

  • timeoutMsinteger

    Milliseconds each request may take, connection to last byte (at most 4 s).

    1000–4000default 4000

Response 201PublicApplicationWithSecret

Show the 14 fields
  • answerUrlstringRequired

  • createdAtstring (date-time)Required

  • fallbackFlowIdstring (uuid) | nullRequired

    T9: the call flow a call runs when neither URL gives usable instructions; null: the caller hears an apology.

  • fallbackUrlstring | nullRequired

  • idstring (uuid)Required

  • livemodebooleanRequired

    false when a test key created it: it answers test calls only — never a live call or a number — and test keys may change it. A live application is read-only to a test key.

  • namestringRequired

  • objectstringRequired

    One ofvoice_application

  • payloadVersionintegerRequired

    The shape of the request the platform sends your answer and fallback URLs (and branch URLs): 2 — call reads as the call resource does (from the calling number and to the number dialled whichever way the call goes, so on an outbound call from is your caller ID and to the contact masked •••• ••3210; lowercase direction; livemode, numberId, contactId), with livemode on the request too — or 1 (deprecated, removed after 2027-02-08): call.from is the contact { contactId, last4 } whichever way the call goes, call.to the business number, direction uppercase. Every request carries version. An application made before 2026-11-06 22:35 UTC (when payload 2 shipped) is on 1 until you switch it.

    One of12

  • secretstringRequired

    The signing secret (Trovacast-Signature on every request to your URLs, the webhook scheme). Shown in this response only — store it now.

  • secretLast4stringRequired

    The signing secret’s last four characters. The secret itself is shown only when the application is created and when it is rotated.

  • timeoutMsintegerRequired

  • updatedAtstring (date-time)Required

  • versionintegerRequired

    Bumped on every change; send it back to update safely.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/applications' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Support line",
  "answerUrl": "https://voice.example.com/answer",
  "fallbackUrl": "https://voice.example.com/fallback",
  "timeoutMs": 3000
}'
Response 201 (json)
{
  "answerUrl": "ANSWER_URL",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "fallbackFlowId": "FALLBACK_FLOW_ID",
  "fallbackUrl": "FALLBACK_URL",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "voice_application",
  "payloadVersion": 1,
  "secret": "whsec_…",
  "secretLast4": "a1B2",
  "timeoutMs": 1,
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1
}

Get application

get/v1/applications/{applicationId}

Retrieves a voice application.

Its URLs, timeoutMs and version. The signing secret is never returned again — secretLast4 only; POST /v1/applications/{applicationId}/rotate-secret mints a new one.

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

Path parameters

  • applicationIdstringRequired

Response 200PublicApplication

Show the 13 fields
  • answerUrlstringRequired

  • createdAtstring (date-time)Required

  • fallbackFlowIdstring (uuid) | nullRequired

    T9: the call flow a call runs when neither URL gives usable instructions; null: the caller hears an apology.

  • fallbackUrlstring | nullRequired

  • idstring (uuid)Required

  • livemodebooleanRequired

    false when a test key created it: it answers test calls only — never a live call or a number — and test keys may change it. A live application is read-only to a test key.

  • namestringRequired

  • objectstringRequired

    One ofvoice_application

  • payloadVersionintegerRequired

    The shape of the request the platform sends your answer and fallback URLs (and branch URLs): 2 — call reads as the call resource does (from the calling number and to the number dialled whichever way the call goes, so on an outbound call from is your caller ID and to the contact masked •••• ••3210; lowercase direction; livemode, numberId, contactId), with livemode on the request too — or 1 (deprecated, removed after 2027-02-08): call.from is the contact { contactId, last4 } whichever way the call goes, call.to the business number, direction uppercase. Every request carries version. An application made before 2026-11-06 22:35 UTC (when payload 2 shipped) is on 1 until you switch it.

    One of12

  • secretLast4stringRequired

    The signing secret’s last four characters. The secret itself is shown only when the application is created and when it is rotated.

  • timeoutMsintegerRequired

  • updatedAtstring (date-time)Required

  • versionintegerRequired

    Bumped on every change; send it back to update safely.

Errors

Request
curl 'https://api.trovacast.com/v1/applications/APPLICATION_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "answerUrl": "ANSWER_URL",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "fallbackFlowId": "FALLBACK_FLOW_ID",
  "fallbackUrl": "FALLBACK_URL",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "voice_application",
  "payloadVersion": 1,
  "secretLast4": "a1B2",
  "timeoutMs": 1,
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1
}

Update application

patch/v1/applications/{applicationId}

Changes a voice application.

Only the fields sent change (fallbackUrl: null removes the fallback); new URLs pass the same checks as on create. Send the version you read for a compare-and-set (409 VOICE_APPLICATION_VERSION_CONFLICT when it moved; omitted, last write wins); a taken name is 409 VOICE_APPLICATION_NAME_TAKEN. A test key may change only test applications (422 TEST_MODE_UNSUPPORTED). Audited against the key (desk.voice_application.update).

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

Path parameters

  • applicationIdstringRequired

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

  • answerUrlstring

    at most 2048 characters

  • fallbackFlowIdstring (uuid) | null

    T9: the call flow a call runs when the application cannot answer; null removes it (the apology again).

  • fallbackUrlstring | null

    at most 2048 characters

  • namestring

    at most 120 characters

  • payloadVersioninteger

    Switches the answer-URL request shape (see payloadVersion on create). Move an application made before 2026-11-06 22:35 UTC to 2 once your handler reads it; 1 is removed after 2027-02-08.

    One of12

  • timeoutMsinteger

    1000–4000

  • versioninteger

    The version you read: the change applies only if nobody changed the application since (409 VOICE_APPLICATION_VERSION_CONFLICT). Omitted: last write wins.

Response 200PublicApplication

Its fields are listed under Get application.

Errors

Request
curl -X PATCH 'https://api.trovacast.com/v1/applications/APPLICATION_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{}'
Response 200 (json)
{
  "answerUrl": "ANSWER_URL",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "fallbackFlowId": "FALLBACK_FLOW_ID",
  "fallbackUrl": "FALLBACK_URL",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "voice_application",
  "payloadVersion": 1,
  "secretLast4": "a1B2",
  "timeoutMs": 1,
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1
}

Delete application

delete/v1/applications/{applicationId}

Deletes a voice application.

Deletes it outright (applications are not archived). Refused with 409 VOICE_APPLICATION_IN_USE while a number routes its inbound calls to it — re-route the number with PATCH /v1/numbers/{numberId} first; a test key may delete only test applications (422 TEST_MODE_UNSUPPORTED). Audited against the key (desk.voice_application.delete).

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

Path parameters

  • applicationIdstringRequired

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 204

Deleted.

Errors

Request
curl -X DELETE 'https://api.trovacast.com/v1/applications/APPLICATION_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Answers 204 with no body.

Rotate application secret

post/v1/applications/{applicationId}/rotate-secret

Rotates an application’s signing secret (the new one is shown once).

Returns the new secret once, as secret; the previous one stops signing at once, so every request after this one carries the new signature in Trovacast-Signature. A test key may rotate only test applications (422 TEST_MODE_UNSUPPORTED). Audited against the key (desk.voice_application.rotate_secret).

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

Path parameters

  • applicationIdstringRequired

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

Show the 14 fields
  • answerUrlstringRequired

  • createdAtstring (date-time)Required

  • fallbackFlowIdstring (uuid) | nullRequired

    T9: the call flow a call runs when neither URL gives usable instructions; null: the caller hears an apology.

  • fallbackUrlstring | nullRequired

  • idstring (uuid)Required

  • livemodebooleanRequired

    false when a test key created it: it answers test calls only — never a live call or a number — and test keys may change it. A live application is read-only to a test key.

  • namestringRequired

  • objectstringRequired

    One ofvoice_application

  • payloadVersionintegerRequired

    The shape of the request the platform sends your answer and fallback URLs (and branch URLs): 2 — call reads as the call resource does (from the calling number and to the number dialled whichever way the call goes, so on an outbound call from is your caller ID and to the contact masked •••• ••3210; lowercase direction; livemode, numberId, contactId), with livemode on the request too — or 1 (deprecated, removed after 2027-02-08): call.from is the contact { contactId, last4 } whichever way the call goes, call.to the business number, direction uppercase. Every request carries version. An application made before 2026-11-06 22:35 UTC (when payload 2 shipped) is on 1 until you switch it.

    One of12

  • secretstringRequired

    The signing secret (Trovacast-Signature on every request to your URLs, the webhook scheme). Shown in this response only — store it now.

  • secretLast4stringRequired

    The signing secret’s last four characters. The secret itself is shown only when the application is created and when it is rotated.

  • timeoutMsintegerRequired

  • updatedAtstring (date-time)Required

  • versionintegerRequired

    Bumped on every change; send it back to update safely.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/applications/APPLICATION_ID/rotate-secret' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200 (json)
{
  "answerUrl": "ANSWER_URL",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "fallbackFlowId": "FALLBACK_FLOW_ID",
  "fallbackUrl": "FALLBACK_URL",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "voice_application",
  "payloadVersion": 1,
  "secret": "whsec_…",
  "secretLast4": "a1B2",
  "timeoutMs": 1,
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1
}