Routers

Router

A router is a single lead-submission endpoint that's able to distribute lead submissions to any one of an account's various Flows, based on evaluation of rules.

The first rules that match are used to select the Flow and Source; subsequent rules are ignored.

Only one Router for a given integration (module-id) should exist in an account.

id
string (ID) ^[0-9a-fA-F]{24}$

ID of this router

module_id
string (ID) ^[0-9a-fA-F]{24}$

A pointer to the integration code to use for this router

Array of objects (Route)

The routes to be evaluated by this router

created_at
string <date-time> (Timestamp)
updated_at
string <date-time> (Timestamp)
{
  • "id": "5fd4371e940df5a34a3888b2",
  • "module_id": "5fd4371e940df5a34a3888b2",
  • "routes": [
    • {
      • "id": "1aacd0",
      • "flow_id": "5fd4371e940df5a34a3888b2",
      • "source_id": "5fd4371e940df5a34a3888b2",
      • "rule_set": {
        • "id": "1aacd0",
        • "op": "and",
        • "rules": [
          • {
            • "id": "1aacd0",
            • "lhv": "lead.state",
            • "op": "is equal to",
            • "rhv": "TX",
            • "rule_set": { }
            }
          ]
        }
      }
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

List all routers

Get the list of all routers.

SecurityAPIKey
Responses
200

OK

get/routers
Request samples
Response samples
application/json
[
  • {
    • "id": "5fd4371e940df5a34a3888b2",
    • "module_id": "5fd4371e940df5a34a3888b2",
    • "routes": [
      • {
        • "id": "1aacd0",
        • "flow_id": "5fd4371e940df5a34a3888b2",
        • "source_id": "5fd4371e940df5a34a3888b2",
        • "rule_set": {
          • "id": "1aacd0",
          • "op": "and",
          • "rules": [
            • {
              • "id": "1aacd0",
              • "lhv": "lead.state",
              • "op": "is equal to",
              • "rhv": "TX",
              • "rule_set": { }
              }
            ]
          }
        }
      ],
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z"
    }
]

Create a router

Create a new custom router, adding it to the list of all routers in the account.

SecurityAPIKey
Request
Request Body schema: application/json
required

Create a new Router

Array of objects (Route)

The routes to be evaluated by this router

Responses
201

Created

post/routers
Request samples
application/json
{
  • "routes": [
    • {
      • "rule_set": {
        • "op": "and",
        • "rules": [
          • {
            • "lhv": "lead.state",
            • "op": "is equal to",
            • "rhv": "TX",
            • "rule_set": { }
            }
          ]
        }
      }
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}
Response samples
application/json
[
  • {
    • "id": "5fd4371e940df5a34a3888b2",
    • "module_id": "5fd4371e940df5a34a3888b2",
    • "routes": [
      • {
        • "id": "1aacd0",
        • "flow_id": "5fd4371e940df5a34a3888b2",
        • "source_id": "5fd4371e940df5a34a3888b2",
        • "rule_set": {
          • "id": "1aacd0",
          • "op": "and",
          • "rules": [
            • {
              • "id": "1aacd0",
              • "lhv": "lead.state",
              • "op": "is equal to",
              • "rhv": "TX",
              • "rule_set": { }
              }
            ]
          }
        }
      ],
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z"
    }
]

Get a router

Fetch a single router.

SecurityAPIKey
Request
path Parameters
id
required
string (ID) ^[0-9a-fA-F]{24}$

The ID of the router

Example: 5fd4371e940df5a34a3888b2
Responses
200

OK

get/routers/{id}
Request samples
Response samples
application/json
{
  • "id": "5fd4371e940df5a34a3888b2",
  • "module_id": "5fd4371e940df5a34a3888b2",
  • "routes": [
    • {
      • "id": "1aacd0",
      • "flow_id": "5fd4371e940df5a34a3888b2",
      • "source_id": "5fd4371e940df5a34a3888b2",
      • "rule_set": {
        • "id": "1aacd0",
        • "op": "and",
        • "rules": [
          • {
            • "id": "1aacd0",
            • "lhv": "lead.state",
            • "op": "is equal to",
            • "rhv": "TX",
            • "rule_set": { }
            }
          ]
        }
      }
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Update a router

Update an existing custom router. Standard routers cannot be updated.

SecurityAPIKey
Request
path Parameters
id
required
string (ID) ^[0-9a-fA-F]{24}$

The ID of the router

Example: 5fd4371e940df5a34a3888b2
Request Body schema: application/json
required

Update an existing Router

Array of objects (Route)

The routes to be evaluated by this router

Responses
200

OK

put/routers/{id}
Request samples
application/json
{
  • "routes": [
    • {
      • "rule_set": {
        • "op": "and",
        • "rules": [
          • {
            • "lhv": "lead.state",
            • "op": "is equal to",
            • "rhv": "TX",
            • "rule_set": { }
            }
          ]
        }
      }
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}
Response samples
application/json
[
  • {
    • "id": "5fd4371e940df5a34a3888b2",
    • "module_id": "5fd4371e940df5a34a3888b2",
    • "routes": [
      • {
        • "id": "1aacd0",
        • "flow_id": "5fd4371e940df5a34a3888b2",
        • "source_id": "5fd4371e940df5a34a3888b2",
        • "rule_set": {
          • "id": "1aacd0",
          • "op": "and",
          • "rules": [
            • {
              • "id": "1aacd0",
              • "lhv": "lead.state",
              • "op": "is equal to",
              • "rhv": "TX",
              • "rule_set": { }
              }
            ]
          }
        }
      ],
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z"
    }
]