Skip to content
KnockDevelopers
Routing

Get a routing rule

Chat with a Developer
GET
/v1/routing-rules/{routingId}

Returns one routing rule with its segments, in the order they are checked, and its fallback: how POST /v1/route routes a lead with it.

When crmOwnerFirst is true, a lead that already has an owner in your CRM goes to that owner first. Otherwise the first segment whose conditions all match the lead decides: qualify assigns the lead to its assignees in turn, disqualify assigns no one. When no segment matches, the fallback decides the same way.

Authorization

ApiKeyAuth
headerx-api-key<token>

Your Knock API key. Ask your Knock account team for one: a key with the Enrichment API role to enrich and route leads, or the Viewer role to read chats, meetings and routing rules.

Path Parameters

routingId*string

The routingId of a routing rule, from GET /v1/routing-rules or Copy Routing Rule ID in the Knock dashboard.

Formatuuid

Response Body

The routing rule.

application/json
  1. response

A routing rule, with its segments in the order they are checked.

routingId*string

ID of the routing rule: the routingId that POST /v1/route takes.

Formatuuid
name*string

Name of the routing rule.

isDefault*boolean

true for your workspace's default routing rule.

crmOwnerFirst*boolean

true when the rule first assigns a lead that already has an owner in your CRM to that owner, before any segment is checked: the crm_owner outcome of POST /v1/route. When the lead has no such owner, the segments are checked.

segments*array<>

The segments, in the order they are checked: the first segment that matches the lead (see conditionGroups) decides.

fallback*

What happens when no segment matches.

Example Request
curl -X GET 'https://app.knock-ai.com/v1/routing-rules/6c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f' \  -H 'x-api-key: <YOUR_API_KEY>'
Example Response
{  "routingId": "6c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",  "name": "Inbound demo requests",  "isDefault": false,  "crmOwnerFirst": false,  "segments": [    {      "id": "1f2e3d4c-5b6a-4978-8a6b-5c4d3e2f1a0b",      "name": "Enterprise NA",      "action": "qualify",      "assignees": [        {          "memberId": "5a7c9e1b-3d5f-4a6b-8c9d-0e1f2a3b4c5d",          "email": "alex@yourcompany.com",          "name": "Alex Kim"        }      ],      "conditionGroups": [        {          "conditions": [            {              "field": "leadCountries",              "label": "Origin Country",              "operator": "is",              "values": [                "United States",                "Canada"              ],              "valueCount": 2            }          ]        }      ]    }  ],  "fallback": {    "action": "qualify",    "assignees": [      {        "memberId": "5a7c9e1b-3d5f-4a6b-8c9d-0e1f2a3b4c5d",        "email": "alex@yourcompany.com",        "name": "Alex Kim"      }    ]  }}