Routing for Number Pools

Number Pool Call Routing

Call routing decides where an inbound call to a number in a pool is forwarded. Every number in the pool shares the pool's call_routes. Set them when you create or update a number pool.

POST https://edgeapi.marchex.io/marketingedge/v5/api/groups/{group_id}/numberpools


Routing options

A number pool accepts these routing options:

Routing optionroute_type
BasicBasic
Business HoursA schedule on Caller Segmentation or Follow Me
Follow MeFollowMe
Caller SegmentationKeyPress

Business Hours is turned on for the organization by Marchex. If a request is rejected because Business Hours is not enabled, contact Customer Success.

Number replacement rules (replacement_configuration), quantity, and match_period are covered in Creating a Number Pool.

Where call features go

Two objects hold call features:

  • features on the number pool. These run on every inbound call before a route is chosen.
  • features on a route (call_routes.routes[].features). These apply to calls handled by that route.
FeatureWhere to set it
stop_callfeatures on the pool
call_verifyfeatures on the pool
call_tag_rulesfeatures on the pool
call_record and whisperDepends on the route type. See each section.

call_record and whisper accept either notification_text or notification_file. notification_file is a Data Store id. When call_record.record is true, supply one of those so the caller hears the recording notice.

For Caller Segmentation, set call_record and whisper on each route that should use them. A route with no features block does not record or whisper. A route that omits call_record or whisper inherits that feature from features on the pool.

For Basic and Follow Me, set call_record and whisper on features of the pool. On a Basic pool, call_routes.route.features is ignored. On Follow Me, per-route features are ignored. The same recording and whisper apply to every call on that pool.


Business Hours

Business Hours sends a call to one destination while the business is open and a different destination after it closes. You keep the same route_type and mark each route with business_hours_routing:

ValueWhen the route is eligible
DuringInside the open window
AfterOutside the open window
AlwaysEither window

On a number pool, use Business Hours with Caller Segmentation or Follow Me. During and After are a pair for the same Caller Segmentation key or Follow Me step. Always stands alone for that key. Always cannot be combined with During or After on the same key.

Supply the weekly schedule on call_routes.business_hours. On create, include all seven days. Each day needs open_time and close_time (HH:mm, open before close) or all_day set to Open or Closed. If you omit business_hours and a route uses During or After, the API uses the Advertiser's business hours. The request fails when neither the pool nor the Advertiser has a schedule.

Call recording and whisper follow the underlying route type. On Caller Segmentation you can give the During route and the After route different call_record and whisper settings. On Follow Me, recording and whisper are set once on the pool.

This example is Caller Segmentation: press 1 reaches the office during business hours and an answering service after hours. The same business_hours block and business_hours_routing values work on Follow Me.

{
  "name": "Google Ads pool - business hours",
  "phone_number_request": {
    "match_type": "TollFree"
  },
  "match_period": 30,
  "quantity": 3,
  "call_routes": {
    "route_type": "KeyPress",
    "notification_text": "Press 1 to speak with our team.",
    "business_hours": {
      "days": [
        { "day_of_week": "Monday", "open_time": "09:00", "close_time": "17:00" },
        { "day_of_week": "Tuesday", "open_time": "09:00", "close_time": "17:00" },
        { "day_of_week": "Wednesday", "open_time": "09:00", "close_time": "17:00" },
        { "day_of_week": "Thursday", "open_time": "09:00", "close_time": "17:00" },
        { "day_of_week": "Friday", "open_time": "09:00", "close_time": "17:00" },
        { "day_of_week": "Saturday", "open_time": "10:00", "close_time": "14:00" },
        { "day_of_week": "Sunday", "all_day": "Closed" }
      ]
    },
    "routes": [
      {
        "key_press": "1",
        "name": "Office",
        "business_hours_routing": "During",
        "termination_number": "4045550100",
        "features": {
          "call_record": {
            "enabled": true,
            "record": true,
            "notification_text": "This call may be recorded."
          }
        }
      },
      {
        "key_press": "1",
        "name": "After hours",
        "business_hours_routing": "After",
        "termination_number": "4045550199",
        "features": {
          "whisper": {
            "enabled": true,
            "notification_text": "After hours call."
          }
        }
      },
      {
        "key_press": "default",
        "name": "Default",
        "default": true,
        "business_hours_routing": "Always",
        "termination_number": "4045550100"
      }
    ]
  }
}

Follow Me

Follow Me tries destinations in order. Each route rings for ring_count rings (2 through 8). If nobody answers, the next ordinal is tried. Routes that share an ordinal ring at the same time, and they must use the same ring_count.

ordinal starts at 1 and increases by 1 with no gaps, up to 10. Send at least two routes and no more than 10.

Set call_record and whisper on features of the pool. Per-route feature blocks are ignored. The same recording and whisper apply to every step.

business_hours_routing (During, After, or Always) is optional. See Business Hours for the schedule.

{
  "name": "Google Ads pool - follow me",
  "phone_number_request": {
    "match_type": "TollFree"
  },
  "match_period": 30,
  "quantity": 3,
  "features": {
    "call_record": {
      "enabled": true,
      "record": true,
      "notification_text": "This call may be recorded."
    },
    "whisper": {
      "enabled": true,
      "notification_text": "Call from the website."
    }
  },
  "call_routes": {
    "route_type": "FollowMe",
    "routes": [
      {
        "name": "Front desk",
        "ordinal": 1,
        "ring_count": 4,
        "business_hours_routing": "Always",
        "termination_number": "4045550100"
      },
      {
        "name": "On call",
        "ordinal": 2,
        "ring_count": 4,
        "business_hours_routing": "Always",
        "termination_number": "4045550199"
      }
    ]
  }
}

To ring two phones together before falling through, give both the same ordinal and the same ring_count, then use the next ordinal for the fallback.


Caller Segmentation

Caller Segmentation plays a prompt and forwards the call based on the key the caller presses. In the API this route type is KeyPress.

Put the prompt on call_routes.notification_text or call_routes.notification_file. When Business Hours is in use, after_business_hours_notification_text or after_business_hours_notification_file is the prompt played outside the open window.

Each route sets key_press:

  • A digit the caller presses, such as "1" or "2".
  • "default" for callers who do not press a key. Set "default": true on that route. A menu can have one default route.
  • "other" for any other key.

Send at least two routes and no more than 25. The same key_press cannot appear twice for the same business_hours_routing value.

Set call_record and whisper on call_routes.routes[].features for the keys that need them. Omit the block on a key that should not record or whisper. If a route omits one of those features, it inherits the value from features on the pool. stop_call, call_verify, and call_tag_rules stay on the pool.

{
  "name": "Google Ads pool - caller segmentation",
  "phone_number_request": {
    "match_type": "TollFree"
  },
  "match_period": 30,
  "quantity": 3,
  "call_routes": {
    "route_type": "KeyPress",
    "notification_text": "Press 1 for sales. Press 2 for support.",
    "routes": [
      {
        "key_press": "1",
        "name": "Sales",
        "termination_number": "4045550101",
        "features": {
          "call_record": {
            "enabled": true,
            "record": true,
            "notification_text": "This call may be recorded."
          },
          "whisper": {
            "enabled": true,
            "notification_text": "Sales call."
          }
        }
      },
      {
        "key_press": "2",
        "name": "Support",
        "termination_number": "4045550102",
        "features": {
          "whisper": {
            "enabled": true,
            "notification_text": "Support call."
          }
        }
      },
      {
        "key_press": "default",
        "name": "Default",
        "default": true,
        "termination_number": "4045550100"
      }
    ]
  }
}

Basic

Basic routing forwards every call to one termination number. Use call_routes.route (singular). There is no routes array.

Set call_record, whisper, stop_call, call_verify, scheduled_call_verify, and call_tag_rules on features of the pool. scheduled_call_verify is only accepted for Basic. call_routes.route.features is ignored on a number pool.

{
  "name": "Google Ads pool",
  "phone_number_request": {
    "match_type": "TollFree"
  },
  "match_period": 30,
  "quantity": 3,
  "features": {
    "call_record": {
      "enabled": true,
      "record": true,
      "notification_text": "This call may be recorded."
    },
    "whisper": {
      "enabled": true,
      "notification_text": "Call from the website."
    }
  },
  "call_routes": {
    "route_type": "Basic",
    "route": {
      "termination_number": "4045550100"
    }
  }
}