Jump to

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

API reference

Call flows

How these fit together: the Call flows guide.

List call flows

get/v1/call-flows

Lists call flows, newest first.

Every call flow of the organization, newest first; archived flows only with includeArchived=true. Each names its published version (null until one is published); the documents themselves are on GET /v1/call-flows/{callFlowId}/versions.

Access: an organization key with the call-flows:read scope.

Query parameters

  • limitinteger

    How many items to return.

  • cursorstring

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

  • includeArchivedboolean

    Include archived flows.

Response 200PublicCallFlowPage

  • dataPublicCallFlow[]Required

    Its fields are listed under Get call flow

  • nextCursorstring | nullRequired

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

Errors

Request
curl 'https://api.trovacast.com/v1/call-flows' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "archivedAt": "2026-11-05T10:00:00.000Z",
      "createdAt": "2026-11-05T10:00:00.000Z",
      "description": "DESCRIPTION",
      "id": "ID",
      "livemode": true,
      "name": "NAME",
      "object": "call_flow",
      "published": {
        "definitionSha256": "DEFINITION_SHA256",
        "publishedAt": "2026-11-05T10:00:00.000Z",
        "version": 1,
        "versionId": "VERSION_ID"
      },
      "updatedAt": "2026-11-05T10:00:00.000Z",
      "version": 1
    }
  ],
  "nextCursor": "NEXT_CURSOR"
}

Create call flow

post/v1/call-flows

Creates a call flow, optionally with its first (draft) version.

A definition is validated before anything is saved — grammar, size, and every queue, schedule, seat, AI agent, application and caller ID it names (a live flow may name only live applications and agents) — and becomes version 1, a draft that nothing runs until it is published (its id is on GET /v1/call-flows/{callFlowId}/versions). Refused with 422 CALL_FLOW_INVALID and its issues; 409 FLOW_NAME_TAKEN for a name another flow has. A test key’s flow is a test flow (livemode: false). Audited against the key (desk.flow.create).

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

  • definitionobject

    The first version (a draft: publish it to make it run), a CallFlowDocument. Validated — grammar, size, and every queue, schedule, seat, AI agent, application and caller ID it names — before anything is saved.

  • descriptionstring | null

    at most 500 characters

  • namestringRequired

    at most 120 characters

Response 201PublicCallFlow

Its fields are listed under Get call flow.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/call-flows' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Main menu",
  "definition": {
    "version": 1,
    "start": "main",
    "nodes": {
      "main": [
        {
          "verb": "menu",
          "prompt": [
            {
              "verb": "say",
              "text": "Press 1 for sales, 2 for support."
            }
          ],
          "options": {
            "1": {
              "node": "sales"
            },
            "2": {
              "node": "support"
            }
          }
        }
      ],
      "sales": [
        {
          "verb": "connect",
          "to": {
            "number": "+918031150000"
          }
        }
      ],
      "support": [
        {
          "verb": "say",
          "text": "Please call back in office hours."
        },
        {
          "verb": "hangup"
        }
      ]
    }
  }
}'
Response 201 (json)
{
  "archivedAt": "2026-11-05T10:00:00.000Z",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "description": "DESCRIPTION",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "call_flow",
  "published": {
    "definitionSha256": "DEFINITION_SHA256",
    "publishedAt": "2026-11-05T10:00:00.000Z",
    "version": 1,
    "versionId": "VERSION_ID"
  },
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1
}

Validate call flow

post/v1/call-flows/validate

Validates a call-flow document without saving it.

The checks a save and a publish run — grammar and size caps, that every queue, schedule, seat, AI agent, application and caller ID the document names is this organization’s, and that this deployment can speak and listen where it asks to — with nothing saved. A document that fails is still 200: valid: false and each problem in issues (path, message), the list a refused save carries. Checked in the key’s mode: under a live key, only live applications and AI agents count.

Access: an organization key with the call-flows:read 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

  • definitionobjectRequired

    A call-flow document: { "version": 1, "start": "<node>", "nodes": { "<node>": [ verbs… ] } } — at most 64 KB, 100 nodes, 50 verbs a node. Its JSON Schema is CallFlowDocument in this contract.

Response 200PublicCallFlowValidation

  • issuesPublicCallFlowIssue[]Required

    2 fields of issues
    • messagestringRequired

    • pathstringRequired

  • objectstringRequired

    One ofcall_flow_validation

  • validbooleanRequired

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/call-flows/validate' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "definition": {
    "nodes": {
      "bye": [
        {
          "text": "Goodbye.",
          "verb": "say"
        },
        {
          "verb": "hangup"
        }
      ],
      "hours": [
        {
          "text": "We are open nine to six, Monday to Saturday.",
          "verb": "say"
        },
        {
          "verb": "hangup"
        }
      ],
      "main": [
        {
          "text": "Thanks for calling Acme.",
          "verb": "say"
        },
        {
          "onInvalid": {
            "node": "bye"
          },
          "onTimeout": {
            "node": "bye"
          },
          "options": {
            "1": {
              "node": "hours"
            }
          },
          "prompt": [
            {
              "text": "Press 1 to hear our opening hours.",
              "verb": "say"
            }
          ],
          "verb": "menu"
        }
      ]
    },
    "start": "main",
    "version": 1
  }
}'
Response 200 (json)
{
  "issues": [
    {
      "message": "MESSAGE",
      "path": "nodes.main.2.queue"
    }
  ],
  "object": "call_flow_validation",
  "valid": true
}

Get call flow

get/v1/call-flows/{callFlowId}

Retrieves a call flow.

Its name, description, version and the published version calls run (null until one is published); archivedAt once archived. The documents are on GET /v1/call-flows/{callFlowId}/versions.

Access: an organization key with the call-flows:read scope.

Path parameters

  • callFlowIdstringRequired

Response 200PublicCallFlow

Show the 10 fields
  • archivedAtstring (date-time) | nullRequired

  • createdAtstring (date-time)Required

  • descriptionstring | nullRequired

  • idstring (uuid)Required

  • livemodebooleanRequired

    false when a test key created it: it runs on test calls only — never routed from a number or run by a live call — and test keys may change it. A live flow is read-only to a test key, and may name only live applications and AI agents.

  • namestringRequired

  • objectstringRequired

    One ofcall_flow

  • publishedPublicCallFlowPublished | nullRequired

    The version calls run; null until one is published. Numbers route to — and /v1/calls FLOW runs — only a published flow.

    4 fields of published
    • definitionSha256stringRequired

      SHA-256 of the canonical document.

    • publishedAtstring (date-time) | nullRequired

    • versionintegerRequired

    • versionIdstring (uuid)Required

  • updatedAtstring (date-time)Required

  • versionintegerRequired

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

Errors

Request
curl 'https://api.trovacast.com/v1/call-flows/CALL_FLOW_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "archivedAt": "2026-11-05T10:00:00.000Z",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "description": "DESCRIPTION",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "call_flow",
  "published": {
    "definitionSha256": "DEFINITION_SHA256",
    "publishedAt": "2026-11-05T10:00:00.000Z",
    "version": 1,
    "versionId": "VERSION_ID"
  },
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1
}

Update call flow

patch/v1/call-flows/{callFlowId}

Renames or redescribes a call flow.

The name and description only: the document changes by drafting a new version and publishing it. Send the version you read for a compare-and-set (409 FLOW_VERSION_CONFLICT when it moved — an archived flow, which takes no changes, answers the same); a taken name is 409 FLOW_NAME_TAKEN. A test key may change only test flows (422 TEST_MODE_UNSUPPORTED). Audited against the key (desk.flow.update).

Access: an organization key with the call-flows:write scope.

Path parameters

  • callFlowIdstringRequired

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

  • descriptionstring | null

    at most 500 characters

  • namestring

    at most 120 characters

  • versioninteger

    The version you read (409 FLOW_VERSION_CONFLICT when it moved). Omitted: last write wins.

Response 200PublicCallFlow

Its fields are listed under Get call flow.

Errors

Request
curl -X PATCH 'https://api.trovacast.com/v1/call-flows/CALL_FLOW_ID' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{}'
Response 200 (json)
{
  "archivedAt": "2026-11-05T10:00:00.000Z",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "description": "DESCRIPTION",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "call_flow",
  "published": {
    "definitionSha256": "DEFINITION_SHA256",
    "publishedAt": "2026-11-05T10:00:00.000Z",
    "version": 1,
    "versionId": "VERSION_ID"
  },
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1
}

Archive call flow

post/v1/call-flows/{callFlowId}/archive

Archives a call flow.

An archived flow takes no new versions, cannot be published or named by a FLOW call, and is listed only with includeArchived=true; its versions stay as history, and archiving it again answers it unchanged. Refused with 409 FLOW_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 archive only test flows (422 TEST_MODE_UNSUPPORTED). Audited against the key (desk.flow.archive).

Access: an organization key with the call-flows:write scope.

Path parameters

  • callFlowIdstringRequired

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

Its fields are listed under Get call flow.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/call-flows/CALL_FLOW_ID/archive' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200 (json)
{
  "archivedAt": "2026-11-05T10:00:00.000Z",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "description": "DESCRIPTION",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "call_flow",
  "published": {
    "definitionSha256": "DEFINITION_SHA256",
    "publishedAt": "2026-11-05T10:00:00.000Z",
    "version": 1,
    "versionId": "VERSION_ID"
  },
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1
}

List call flow versions

get/v1/call-flows/{callFlowId}/versions

Lists a call flow’s versions, newest first (the last 100).

Each version’s full definition, its definitionSha256 and publishedAt (when it was first published; the one calls run now is the flow’s published). Versions never change: an edit is a new draft. Not paginated — versions older than the newest 100 are not listed.

Access: an organization key with the call-flows:read scope.

Path parameters

  • callFlowIdstringRequired

Response 200PublicCallFlowVersionList

  • dataPublicCallFlowVersion[]Required

    8 fields of data
    • createdAtstring (date-time)Required

    • definitionobjectRequired

    • definitionSha256stringRequired

    • flowIdstring (uuid)Required

    • idstring (uuid)Required

    • objectstringRequired

      One ofcall_flow_version

    • publishedAtstring (date-time) | nullRequired

      When it was first published; null for a draft never published.

    • versionintegerRequired

      1, 2, 3… per flow; never reused.

Errors

Request
curl 'https://api.trovacast.com/v1/call-flows/CALL_FLOW_ID/versions' \
  -H "Authorization: Bearer $TROVACAST_API_KEY"
Response 200 (json)
{
  "data": [
    {
      "createdAt": "2026-11-05T10:00:00.000Z",
      "definition": {},
      "definitionSha256": "DEFINITION_SHA256",
      "flowId": "FLOW_ID",
      "id": "ID",
      "object": "call_flow_version",
      "publishedAt": "2026-11-05T10:00:00.000Z",
      "version": 1
    }
  ]
}

Create call flow version

post/v1/call-flows/{callFlowId}/versions

Drafts a new version of a call flow (publish it to make it run).

Saved as the flow’s next version number, a draft: calls keep running the published version until this one is published. Validated first in the flow’s own mode (a live flow may name only live applications and agents) — refused with 422 CALL_FLOW_INVALID and its issues — and 409 FLOW_ARCHIVED on an archived flow. A test key may draft only on test flows (422 TEST_MODE_UNSUPPORTED). Audited against the key (desk.flow.version.create).

Access: an organization key with the call-flows:write scope.

Path parameters

  • callFlowIdstringRequired

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

  • definitionobjectRequired

    A call-flow document: { "version": 1, "start": "<node>", "nodes": { "<node>": [ verbs… ] } } — at most 64 KB, 100 nodes, 50 verbs a node. Its JSON Schema is CallFlowDocument in this contract.

Response 201PublicCallFlowVersion

  • createdAtstring (date-time)Required

  • definitionobjectRequired

  • definitionSha256stringRequired

  • flowIdstring (uuid)Required

  • idstring (uuid)Required

  • objectstringRequired

    One ofcall_flow_version

  • publishedAtstring (date-time) | nullRequired

    When it was first published; null for a draft never published.

  • versionintegerRequired

    1, 2, 3… per flow; never reused.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/call-flows/CALL_FLOW_ID/versions' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "definition": {
    "nodes": {
      "bye": [
        {
          "text": "Goodbye.",
          "verb": "say"
        },
        {
          "verb": "hangup"
        }
      ],
      "hours": [
        {
          "text": "We are open nine to six, Monday to Saturday.",
          "verb": "say"
        },
        {
          "verb": "hangup"
        }
      ],
      "main": [
        {
          "text": "Thanks for calling Acme.",
          "verb": "say"
        },
        {
          "onInvalid": {
            "node": "bye"
          },
          "onTimeout": {
            "node": "bye"
          },
          "options": {
            "1": {
              "node": "hours"
            }
          },
          "prompt": [
            {
              "text": "Press 1 to hear our opening hours.",
              "verb": "say"
            }
          ],
          "verb": "menu"
        }
      ]
    },
    "start": "main",
    "version": 1
  }
}'
Response 201 (json)
{
  "createdAt": "2026-11-05T10:00:00.000Z",
  "definition": {},
  "definitionSha256": "DEFINITION_SHA256",
  "flowId": "FLOW_ID",
  "id": "ID",
  "object": "call_flow_version",
  "publishedAt": "2026-11-05T10:00:00.000Z",
  "version": 1
}

Publish call flow version

post/v1/call-flows/{callFlowId}/versions/{versionId}/publish

Publishes a call flow version.

Makes the version the one numbers routed to the flow and FLOW calls run; any version of the flow may be published, an older one included (a rollback). Validated again first: a queue deleted or a number released since the draft was saved refuses it with 422 CALL_FLOW_INVALID; an archived flow is 409 FLOW_ARCHIVED and a stale version 409 FLOW_VERSION_CONFLICT. A test key may publish only test flows (422 TEST_MODE_UNSUPPORTED). Audited against the key (desk.flow.publish, with the document’s hash).

Access: an organization key with the call-flows:write scope.

Path parameters

  • callFlowIdstringRequired

  • versionIdstringRequired

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

  • versioninteger

    The flow’s version you read (409 FLOW_VERSION_CONFLICT when it moved). Omitted: publish over whatever is current.

Response 200PublicCallFlow

Its fields are listed under Get call flow.

Errors

Request
curl -X POST 'https://api.trovacast.com/v1/call-flows/CALL_FLOW_ID/versions/VERSION_ID/publish' \
  -H "Authorization: Bearer $TROVACAST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{
  "version": 1
}'
Response 200 (json)
{
  "archivedAt": "2026-11-05T10:00:00.000Z",
  "createdAt": "2026-11-05T10:00:00.000Z",
  "description": "DESCRIPTION",
  "id": "ID",
  "livemode": true,
  "name": "NAME",
  "object": "call_flow",
  "published": {
    "definitionSha256": "DEFINITION_SHA256",
    "publishedAt": "2026-11-05T10:00:00.000Z",
    "version": 1,
    "versionId": "VERSION_ID"
  },
  "updatedAt": "2026-11-05T10:00:00.000Z",
  "version": 1
}