Skip to main content
Inbound routing runs a workflow at call time to decide which agent answers an incoming call. Each organization has at most one inbound-routing config. When a call arrives on one of your numbers, Anyreach passes the call details into your workflow, and the workflow returns the agent (and any per-call context) that should handle it. Use this when a single number should route to different agents depending on who is calling, which number was dialed, the time of day, or any logic you can express in a workflow. If you do not need dynamic routing, assign an agent directly to a number instead — see Telephony overview.

How it works

When a call comes in, Anyreach checks for an inbound-routing config on your organization. If one exists and enabled is true, it runs your workflow_definition, feeds in the call details, and reads the workflow’s output to resolve the agent.
The config is built and edited with the same workflow builder used elsewhere in the product, so the input and output of the routing workflow are fixed contracts. See Workflows overview for how to build the workflow itself.

Workflow input

The workflow receives these fields on its input step:

Workflow output

The workflow’s output step returns these fields. Every field is optional.
If the workflow returns neither reject: true nor a resolvable agent, the config’s fallback agent is used. If there is no fallback agent, the call is disconnected.

Config fields

The routing workflow runs only when a config exists and enabled is true. If the workflow throws or times out, Anyreach falls back to fallback_agent_id; with no fallback configured, the call is disconnected.

API

All routes are org-scoped — the config is resolved from the organization on the token. There is exactly one config per organization. Authenticate with Authorization: Bearer <token>; user PATs (pat_) also require X-Anyreach-Org: <organization_id>. Reading requires the inbound_routing_configs:read or inbound_routing_configs:manage scope. Creating, updating, and deleting require inbound_routing_configs:manage.

Create

The response is the stored config:

Update

PUT accepts the same fields, all optional — only the fields you send are changed. Set fallback_agent_id to null to remove the fallback agent; fallback_agent_version is cleared automatically when you do.

Telephony overview

Numbers, trunks, and how inbound and outbound calls connect.

Workflows overview

Build the routing workflow and other automation.