{"_id":"57624356653c2d2200fec7da","project":"55c8cff571d7580d0063a5e5","__v":4,"category":{"_id":"57624356653c2d2200fec7a8","project":"55c8cff571d7580d0063a5e5","version":"57624356653c2d2200fec79c","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-04-27T14:03:08.031Z","from_sync":false,"order":24,"slug":"routes","title":"Account Routes"},"version":{"_id":"57624356653c2d2200fec79c","__v":22,"project":"55c8cff571d7580d0063a5e5","createdAt":"2016-06-16T06:12:38.244Z","releaseDate":"2016-06-16T06:12:38.244Z","categories":["57624356653c2d2200fec79d","57624356653c2d2200fec79e","57624356653c2d2200fec79f","57624356653c2d2200fec7a0","57624356653c2d2200fec7a1","57624356653c2d2200fec7a2","57624356653c2d2200fec7a3","57624356653c2d2200fec7a4","57624356653c2d2200fec7a5","57624356653c2d2200fec7a6","57624356653c2d2200fec7a7","57624356653c2d2200fec7a8","57624356653c2d2200fec7a9","57624356653c2d2200fec7aa","5779ca1b99b40b0e005abb3a","5779d198aea88b0e00f63277","5797d3ab17ced017003c4be4","57ac170ef1cdae0e0053cdfc","57dbfc723ed3450e00dc9e6d","5804d12d16161c0f0077df9b","5841064b652e5b0f0015a7c8","588b5e5f2966b2230009cbf9","58a68ebf3239fa0f00857619","58c23c8b4922930f0050ac91","58fd1460809fc30f00f2ee07","5934eaf5328680002d77de6a","594bf91601cfe6000f40f4c5","595c4ed696b447001ba0cf6d","596524495cee50001575f5be","5970d4f1313162004dd303b5","59780fac24dbd1001a1fa057","59a8cfd3ead78a002d63cafe","59e0323d93da1f001c9ec170","5b0c16f2be9fcb0003e28222","5ba8fd1a4c8c220003a08f0f"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"4.0.0","version":"4"},"githubsync":"","parentDoc":null,"user":"55c8cf9471d7580d0063a5e4","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-27T14:04:12.329Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":0,"body":"Routes, a.k.a. \"Call Handling Rules\" or \"Presets\", are used to tell Phone.com how to handle incoming phone calls.  They can be used to connect your Phone.com phone number to an [extension](doc:account-extensions), a [menu](doc:account-menus), a [calling queue](doc:account-queues), or many other things.\n\nThe fundamental element of a route is an action.  We support many different actions such as `forward`, `menu`, and `voicemail`.  See below for the full details.  In general, actions are processed one at a time in the order you specify, until the call is answered or disconnected.  Answering or disconnecting stops any additional actions from being performed.  Note that several actions such as `voicemail`, `menu`, and `fax` completely take over processing the call and do not result in processing any subsequent actions.\n\nActions are grouped into rule sets.  Rule sets can be filtered based on the time of day or the caller's phone number.  When processing an incoming call, Phone.com's routing engine will evaluate each rule set in the order that was specified when the route was created or updated. The first matching rule set will be used, and all other rule sets will be ignored.  Each route must have at least one unfiltered rule set.  Note that if your route contains multiple unfiltered rule sets, only the first one will be used.\n\n## Supported Services\n* [List Routes](doc:list-account-routes) \n* [Get Route](doc:get-account-route) \n* [Create Route](doc:create-route) \n* [Replace Route](doc:replace-account-route) \n* [Delete Route](doc:delete-account-route) \n\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Named vs Anonymous Routes\",\n  \"body\": \"These Route-related services will only work with named routes, a.k.a. Call Routing Presets.  However, your account might have some existing anonymous routes that were generated through the [Control Panel](https://control.phone.com/login).  In order to use them with this API, we recommend assigning names to them using the Control Panel, or recreating those routes from scratch and assigning names.\\n\\nWhen anonymous routes are referenced by other objects in this API (for example, within [Menus](doc:account-menus) and [Extensions](doc:account-extensions)), the full route configuration will be given but the `id` and `name` properties will be omitted.\"\n}\n[/block]\n## Summary Object\nThe Route Summary Object is used to briefly represent a route. It can be seen in several places throughout this API. Here are the properties:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`id`\",\n    \"0-1\": \"Integer ID. Read-only.\",\n    \"1-0\": \"`name`\",\n    \"1-1\": \"Name\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nHere is an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"id\\\": 83511,\\n    \\\"name\\\": \\\"Toll-Free to Bob's Extension\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n## Full Object\nThe root level of the Full Route Object includes all of the properties in the [Route Summary Object](#section-summary-object), along with two more:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"\",\n    \"1-0\": \"`rules`\",\n    \"1-1\": \"Array of [Rule Set Objects](#section-rule-set-objects). Required. See below for details. When processing incoming calls, the first matching rule set will be used, and all others will be ignored.\",\n    \"1-2\": \"\",\n    \"0-0\": \"`extension`\",\n    \"0-1\": \"[Extension](doc:account-extensions) to which this route belongs.  Output is an [Extension Summary Object](doc:account-extensions#section-summary-object). Input must be an [Extension Lookup Object](doc:account-extensions#section-lookup-object). Optional. Cannot be changed after a route is created.\",\n    \"0-2\": \"\",\n    \"h-3\": \"\",\n    \"0-3\": \"\",\n    \"1-3\": \"\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nIt's the Rule Set Objects where things begin to get a little more complex.  The following sections spell it out:\n\n## Rule Set Objects\nProperties for each rule set are described below:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Required\",\n    \"0-0\": \"`filter`\",\n    \"0-1\": \"[Filter Object](#section-filter-objects). Optional. See below for details.\",\n    \"0-2\": \"No\",\n    \"1-0\": \"`actions`\",\n    \"1-1\": \"Array of [Action Objects](#section-action-objects). Required. See below for details.\",\n    \"1-2\": \"Yes\",\n    \"h-3\": \"Description\",\n    \"0-3\": \"\",\n    \"1-3\": \"\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n## Filter Objects\nA filter object can specify one of several types of filters. They are described below.\n\n### Schedule Filter\nThe following object applies a given [schedule](doc:to-account-schedules) to a rule set. Incoming calls will only be directed to the rule set if they happen within the window(s) of time specified by the schedule.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`type`\",\n    \"0-1\": \"Required. Must equal `schedule`.\",\n    \"1-0\": \"`schedule`\",\n    \"1-1\": \"[Schedule](doc:account-schedules) that this filter refers to. Output is a [Schedule Summary Object](doc:account-schedules#section-summary-object). Input must be a [Schedule Lookup Object](doc:account-schedules#section-lookup-object). Required.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n### Address Book Contact Filter\nThe following object applies a given [address book contact](doc:account-extension-contacts) to a rule set. The rule set will only be used if the caller matches the contact specified.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`type`\",\n    \"0-1\": \"Required. Must equal `contact`.\",\n    \"1-0\": \"`contact`\",\n    \"1-1\": \"[Address Book Contact](doc:account-extension-contacts) that this filter refers to. Output is a [Contact Summary Object](doc:account-extension-contacts#section-summary-object). Input must be a [Contact Lookup Object](doc:account-extension-contacts#section-lookup-object). Required.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n### Address Book Group Filter\nThe following object applies a given [address book group](doc:account-extension-contact-groups) to a rule set. The rule set will only be used if the caller is a member of the specified contact group.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`type`\",\n    \"0-1\": \"Required. Must equal `contact_group`.\",\n    \"1-0\": \"`group`\",\n    \"1-1\": \"[Address Book Group](doc:account-extension-contact-groups) that this filter refers to. Output is a [Contact Group Summary Object](doc:account-extension-contact-groups#section-summary-object). Input must be a [Contact Group Lookup Object](doc:account-extension-contact-groups#section-lookup-object). Required.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n## Action Objects\nRoutes have rule sets, and rule sets have one or more actions.  The supported actions are described below:\n\n### Dial-by-name Directory\nThis action is for directing calls to your account's Dial By Name directory.  Callers will be asked to input the first three letters of the name of the person they wish to reach.  This action completely takes over processing the call, so that no additional actions in this route will be performed.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`action`\",\n    \"0-1\": \"Required. Must equal `directory`.\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n### Disconnect\nThis action is for disconnecting the call. This prevents any additional actions from being processed.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`action`\",\n    \"0-1\": \"Required. Must equal `disconnect`\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n### Fax\nThis action is for receiving an incoming fax message. This action automatically concludes by disconnecting the call, which will prevent any additional actions from being processed.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`action`\",\n    \"0-1\": \"Required. Must equal `fax`.\",\n    \"1-0\": \"`extension`\",\n    \"1-1\": \"[Extension](doc:account-extensions) that this action refers to. Output is an [Extension Summary Object](doc:account-extensions#section-summary-object). Input must be an [Extension Lookup Object](doc:account-extensions#section-lookup-object). Required.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n### Forward\nThis action is for forwarding calls to any number of [extensions](doc:account-extensions) or phone numbers.\n\nThe forwarding is handled in parallel, meaning that all phone numbers and/or extensions will ring simultaneously.  When the call is answered by any single phone number or extension, ringing will stop for all of them.\n\nSubsequent actions in this rule set will be performed if the call is not answered before the timeout period is reached, or if it is forwarded to an extension that has its own route *and* that route does not result in any actions that disconnect the call or take over call handling.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`action`\",\n    \"0-1\": \"Required. Must equal `forward`.\",\n    \"1-0\": \"`items`\",\n    \"1-1\": \"Array of [Forward Item Objects](#section-forward-item-objects). See below for details. Required.\",\n    \"2-0\": \"`timeout`\",\n    \"2-1\": \"Seconds that our routing engine should wait until moving on. Optional. Must be an integer between 5 and 90. Default is 5 seconds.\",\n    \"3-0\": \"`hold_music`\",\n    \"3-1\": \"[Hold Music](doc:account-media) to be played while callers are waiting. Output is a [Media Summary Object](doc:account-media#section-summary-object). Input must be a [Media Lookup Object](doc:account-media#lookup-object). Optional. Must refer to a media recording that has `is_hold_music` set to `TRUE`.  Default is to play a standard ring tone.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n#### Forward Item Objects\nHere are the properties that compose the forwarding items referred to in the Forward action.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`type`\",\n    \"0-1\": \"Required. Must equal `phone_number` or `extension`.\",\n    \"1-0\": \"`extension`\",\n    \"1-1\": \"Required if `type = \\\"extension\\\"`. [Extension](doc:account-extensions) that callers should be directed to. Output is an [Extension Summary Object](doc:account-extensions#section-summary-object). Input must be an [Extension Lookup Object](doc:account-extensions#section-lookup-object).\",\n    \"2-0\": \"`number`\",\n    \"2-1\": \"Required if `type = \\\"phone_number\\\"`. Phone number that callers should be directed to. Must be a string in E.164 format.\",\n    \"3-0\": \"`screening`\",\n    \"3-1\": \"Boolean. Optional. Default is `FALSE`. Use this to activate call screening.  If `TRUE`, the timeout on the parent action should be at least 30 seconds.\",\n    \"4-0\": \"`caller_id`\",\n    \"4-1\": \"Optional. Must equal `calling_number` or `called_number`. Defines which phone number should be used for Caller ID. Default is `calling_number`.\",\n    \"5-0\": \"`voice_tag`\",\n    \"5-1\": \"Optional string. If `screening = TRUE`, this value will be passed into our Text-To-Speech engine and used to inform the caller of who they have reached.\",\n    \"6-0\": \"`distinctive_ring`\",\n    \"6-1\": \"Optional. Must equal one of: `DEFAULT`, `STYLE_2`, `STYLE_3`, `STYLE_4`, `STYLE_5`, `STYLE_6`, `STYLE_7`, `STYLE_8`, or `STYLE_9`.  Identifies the style of ring tone you will hear when an incoming call is waiting.\"\n  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]\n### Greeting\nThis action is for playing a [message](doc:account-media) to the caller.  When the message finishes playing, the next action in this rule set will be performed.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`action`\",\n    \"0-1\": \"Required. Must equal `greeting`.\",\n    \"1-0\": \"`greeting`\",\n    \"1-1\": \"[Greeting](doc:account-media) that this action refers to.  Output is a [Media Summary Object](doc:account-media#section-summary-object). Input must be a [Media Lookup Object](doc:account-media#section-lookup-object). Required. Must refer to a media recording that has `is_hold_music` set to `FALSE`.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n### Hold\nThis action is for placing the caller on hold for an arbitrary number of seconds.  Afterward, the next action in this rule set will be performed.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`action`\",\n    \"0-1\": \"Required. Must equal `hold`.\",\n    \"1-0\": \"`duration`\",\n    \"1-1\": \"Required. Seconds that the caller should be placed on hold before being moved onto the next action. Must be an integer between 1 and 60 seconds.\",\n    \"2-0\": \"`hold_music`\",\n    \"2-1\": \"[Hold Music](doc:account-media) to be played while callers are waiting. Output is a [Media Summary Object](doc:account-media#section-summary-object). Input must be a [Media Lookup Object](doc:account-media#section-lookup-object). Optional. Must refer to a media recording that has `is_hold_music` set to `TRUE`.  Default is to play a standard ring tone.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n### Menu\nThis action is for sending the caller to a [menu](doc:account-menus).  This action completely takes over processing the call, so that no additional actions in this route will be performed.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`action`\",\n    \"0-1\": \"Required. Must equal `menu`.\",\n    \"1-0\": \"`menu`\",\n    \"1-1\": \"[Menu](doc:account-menus) that this action refers to. Required. Output is a [Menu Summary Object](doc:account-menus#section-summary-object). Input must be a [Menu Lookup Object](doc:account-menus#section-lookup-object).\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n### Queue\nThis action is for sending the caller to a [queue](doc:account-queues), such as for a call center.  If the call is not answered within the queue's timeout period, the next action in the rule set will be performed.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`action`\",\n    \"0-1\": \"Required. Must equal `queue`.\",\n    \"1-0\": \"`queue`\",\n    \"1-1\": \"[Queue](doc:account-queues) that this action refers to. Required. Output is a [Queue Summary Object](doc:account-queues#section-summary-object). Input must be a [Queue Lookup Object](doc:account-queues#section-lookup-object).\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n### Trunk\n(For [SIP Trunking](https://en.wikipedia.org/wiki/SIP_trunking) customers only.) This action is for sending the caller to a [trunk](doc:account-trunks).  This action completely takes over processing the call, so that no additional actions in this route will be performed.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`action`\",\n    \"0-1\": \"Required. Must equal `trunk`.\",\n    \"1-0\": \"`trunk`\",\n    \"1-1\": \"[Trunk](doc:account-trunks) that this action refers to. Required. Output is a [Trunk Summary Object](doc:account-trunks#section-summary-object). Input must be a [Trunk Lookup Object](doc:account-trunks#section-lookup-object).\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n### Voicemail\nThis action is for sending the caller to the voicemail of a given [extension](doc:account-extensions). It automatically concludes by disconnecting the call, which will prevent any additional actions from being processed.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`action`\",\n    \"0-1\": \"Required. Must equal `voicemail`.\",\n    \"1-0\": \"`extension`\",\n    \"1-1\": \"[Extension](doc:account-extensions) that this action refers to. Output is an [Extension Summary Object](doc:account-extensions#section-summary-object). Input must be an [Extension Lookup Object](doc:account-extensions#section-lookup-object). Required.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n## Examples\nRoutes can get pretty complicated since there are so many options. We'll start with some simpler examples:\n\n### Example #1: Forwarding to a menu\nThe following route directs calls to a menu called \"Main Menu\".\n\nThis route has one rule set.  This rule set has one action, which is to direct incoming calls to a menu named \"Main Menu\".  Note that the `menu` property is a brief representation of the menu being used. See our [Menus](doc:account-menus) section for more details.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"id\\\": 98357,\\n    \\\"name\\\": \\\"Go to main menu\\\",\\n    \\\"rules\\\": [\\n        {\\n            \\\"actions\\\": [\\n                {\\n                    \\\"action\\\": \\\"menu\\\",\\n                    \\\"menu\\\": {\\n                        \\\"id\\\": 37052,\\n                        \\\"name\\\": \\\"Main Menu\\\"\\n                    }\\n                }\\n            ]\\n        }\\n    ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n### Example #2: Rule Set Filters\nWhat if calls need to be handled differently during a certain holiday weekend?  Instead of the normal menu, this route could be configured to use a different rule set during that weekend, as shown below.\n\nNote that this route has two rule sets.  The first one references a schedule named \"Memorial Day Weekend\".  Calls that are received during the timeframe specified in this [schedule](doc:account-schedules) will be played a message saying that the store is closed for Memorial Day, then be directed to leave a voicemail message for the store's main extension.  Calls received during any other time period will be directed to the Main Menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"id\\\": 98357,\\n    \\\"name\\\": \\\"Go to main menu\\\",\\n    \\\"rules\\\": [\\n        {\\n            \\\"filter\\\": {\\n                \\\"type\\\": \\\"schedule\\\",\\n                \\\"schedule\\\": {\\n                    \\\"id\\\": 4513513,\\n                    \\\"name\\\": \\\"Memorial Day Weekend\\\"\\n                }\\n            },\\n            \\\"actions\\\": [\\n                {\\n                    \\\"action\\\": \\\"greeting\\\",\\n                    \\\"greeting\\\": {\\n                        \\\"id\\\": 823251,\\n                        \\\"name\\\": \\\"Closed for Memorial Day\\\"\\n                    }\\n                },\\n                {\\n                    \\\"action\\\": \\\"voicemail\\\",\\n                    \\\"extension\\\": {\\n                        \\\"id\\\": 561315,\\n                        \\\"name\\\": \\\"Main extension\\\"\\n                    }\\n                }\\n            ]\\n        },\\n        {\\n            \\\"actions\\\": [\\n                {\\n                    \\\"action\\\": \\\"menu\\\",\\n                    \\\"menu\\\": {\\n                        \\\"id\\\": 37052,\\n                        \\\"name\\\": \\\"Main Menu\\\"\\n                    }\\n                }\\n            ]\\n        }    \\n    ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n### Example #3: Route Belonging to an Extension\nA route can belong to an [extension](doc:account-extensions).  This is so an extension can have its own rules regardless of how a call got directed to it. The following route forwards all incoming calls for extension 504 to a phone number:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"id\\\": 987241,\\n    \\\"name\\\": \\\"Bob's voicemail\\\",\\n    \\\"extension\\\": {\\n        \\\"id\\\": 82351,\\n        \\\"extension\\\": 504,\\n        \\\"name\\\": \\\"Bob's Desk\\\"\\n    },\\n    \\\"rules\\\": [\\n        {\\n            \\\"actions\\\": [\\n                {\\n                    \\\"action\\\": \\\"forward\\\",\\n                    \\\"items\\\": [\\n                        {\\n                            \\\"type\\\": \\\"phone_number\\\",\\n                            \\\"number\\\": \\\"+13334445555\\\",\\n                            \\\"screening\\\": false,\\n                            \\\"caller_id\\\": \\\"calling_number\\\",\\n                            \\\"voice_tag\\\": \\\"Bob Martin\\\",\\n                            \\\"distinctive_ring\\\": \\\"DEFAULT\\\"\\n                        }\\n                    ]\\n                }\\n            ]\\n        }\\n    ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n### Example #4: All Actions\nBelow is an example showing all of the available actions and filters. Note: In real life, this route would not make sense. It is only intended to show the possible options.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"id\\\": 130457,\\n    \\\"name\\\": \\\"Test Everything!\\\",\\n    \\\"extension\\\": {\\n        \\\"id\\\": 12414234,\\n        \\\"extension\\\": 642,\\n        \\\"name\\\": \\\"Amber's Office\\\"\\n    },\\n    \\\"rules\\\": [\\n        {\\n            \\\"actions\\\": [\\n                {\\n                    \\\"action\\\": \\\"greeting\\\",\\n                    \\\"greeting\\\": {\\n                        \\\"id\\\": 4634852,\\n                        \\\"name\\\": \\\"Chickens clucking\\\"\\n                    }\\n                },\\n                {\\n                    \\\"action\\\": \\\"queue\\\",\\n                    \\\"queue\\\": {\\n                        \\\"id\\\": 734581,\\n                        \\\"name\\\": \\\"3rd Floor Call Center\\\"\\n                    }\\n                },\\n                {\\n                    \\\"action\\\": \\\"menu\\\",\\n                    \\\"menu\\\": {\\n                        \\\"id\\\": 3254235,\\n                        \\\"name\\\": \\\"Language selection\\\"\\n                    }\\n                },\\n                {\\n                    \\\"action\\\": \\\"forward\\\",\\n                    \\\"timeout\\\": 5,\\n                    \\\"hold_music\\\": {\\n                        \\\"id\\\": 73735,\\n                        \\\"name\\\": \\\"Our custom hold music mix\\\"\\n                    },\\n                    \\\"items\\\": [\\n                        {\\n                            \\\"type\\\": \\\"phone_number\\\",\\n                            \\\"number\\\": \\\"+18008423394\\\",\\n                            \\\"screening\\\": false,\\n                            \\\"caller_id\\\": \\\"calling_number\\\",\\n                            \\\"voice_tag\\\": \\\"Phone.com\\\",\\n                            \\\"distinctive_ring\\\": \\\"STYLE_5\\\"\\n                        },\\n                        {\\n                            \\\"type\\\": \\\"extension\\\",\\n                            \\\"extension\\\": {\\n                                \\\"id\\\": 375341,\\n                                \\\"extension\\\": 506,\\n                                \\\"name\\\": \\\"Mary's Desk\\\"\\n                            },\\n                            \\\"screening\\\": true,\\n                            \\\"caller_id\\\": \\\"calling_number\\\",\\n                            \\\"voice_tag\\\": \\\"Mary Kim\\\",\\n                            \\\"distinctive_ring\\\": \\\"DEFAULT\\\"\\n                        }\\n                    ]\\n                },\\n                {\\n                    \\\"action\\\": \\\"directory\\\"\\n                },\\n                {\\n                    \\\"action\\\": \\\"voicemail\\\",\\n                    \\\"extension\\\": {\\n                        \\\"id\\\": 74532,\\n                        \\\"extension\\\": 505,\\n                        \\\"name\\\": \\\"Fred\\\"\\n                    }\\n                },\\n                {\\n                    \\\"action\\\": \\\"disconnect\\\"\\n                },\\n                {\\n                    \\\"action\\\": \\\"fax\\\",\\n                    \\\"extension\\\": {\\n                        \\\"id\\\": 74532,\\n                        \\\"extension\\\": 505,\\n                        \\\"name\\\": \\\"Fred\\\"\\n                    }\\n                },\\n                {\\n                    \\\"action\\\": \\\"hold\\\",\\n                    \\\"hold_music\\\": {\\n                        \\\"id\\\": 1,\\n                        \\\"name\\\": \\\"Violin sonata\\\"\\n                    },\\n                    \\\"duration\\\": 30\\n                },\\n                {\\n                    \\\"action\\\": \\\"trunk\\\",\\n                    \\\"trunk\\\": {\\n                        \\\"id\\\": 88223,\\n                        \\\"name\\\": \\\"Feeder Gateway\\\"\\n                    }\\n                },\\n                {\\n                    \\\"action\\\": \\\"application\\\",\\n                    \\\"application\\\": {\\n                        \\\"id\\\": 354015,\\n                        \\\"name\\\": \\\"Web Backend\\\"\\n                    }\\n                }\\n            ]\\n        },\\n        {\\n            \\\"filter\\\": {\\n                \\\"type\\\": \\\"schedule\\\",\\n                \\\"schedule\\\": {\\n                    \\\"id\\\": 307513,\\n                    \\\"name\\\": \\\"Thanksgiving Weekend\\\"\\n                }\\n            },\\n            \\\"actions\\\": [\\n                {\\n                    \\\"action\\\": \\\"application\\\",\\n                    \\\"application\\\": {\\n                        \\\"id\\\": 354015,\\n                        \\\"name\\\": \\\"Web Backend\\\"\\n                    }\\n                }\\n            ]\\n        },\\n        {\\n            \\\"filter\\\": {\\n                \\\"type\\\": \\\"contact\\\",\\n                \\\"contact\\\": {\\n                    \\\"id\\\": 7735,\\n                    \\\"name\\\": \\\"Mr. Burns\\\"\\n                }\\n            },\\n            \\\"actions\\\": [\\n                {\\n                    \\\"action\\\": \\\"disconnect\\\"\\n                }\\n            ]\\n        },\\n        {\\n            \\\"filter\\\": {\\n                \\\"type\\\": \\\"contact_group\\\",\\n                \\\"group\\\": {\\n                    \\\"id\\\": 345345,\\n                    \\\"name\\\": \\\"Bridge Club Friends\\\"\\n                }\\n            },\\n            \\\"actions\\\": [\\n                {\\n                    \\\"action\\\": \\\"menu\\\",\\n                    \\\"menu\\\": {\\n                        \\\"id\\\": 76513,\\n                        \\\"name\\\": \\\"Extended Holiday Hours\\\"\\n                    }\\n                }\\n            ]\\n        }\\n    ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n## Lookup Object\nThe Route Lookup Object is used to link to a route from another object. This is used, for example, when defining items for [menus](doc:account-menus).  Only *one* of the following properties need to be included. If multiple are specified, then *all* properties must match one of your menus.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`id`\",\n    \"0-1\": \"ID\",\n    \"1-0\": \"`name`\",\n    \"1-1\": \"Name\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nHere are some examples:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"route: {\\n    \\\"id\\\": 85151\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"route: {\\n    \\\"name\\\": \\\"Toll-Free to Bob's Extension\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nInstead of inputting an object, you can also use a scalar value.  A route will be found if the input matches any one of the above fields.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"route: 85151\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"account-routes","type":"basic","title":"Routes"}
Routes, a.k.a. "Call Handling Rules" or "Presets", are used to tell Phone.com how to handle incoming phone calls. They can be used to connect your Phone.com phone number to an [extension](doc:account-extensions), a [menu](doc:account-menus), a [calling queue](doc:account-queues), or many other things. The fundamental element of a route is an action. We support many different actions such as `forward`, `menu`, and `voicemail`. See below for the full details. In general, actions are processed one at a time in the order you specify, until the call is answered or disconnected. Answering or disconnecting stops any additional actions from being performed. Note that several actions such as `voicemail`, `menu`, and `fax` completely take over processing the call and do not result in processing any subsequent actions. Actions are grouped into rule sets. Rule sets can be filtered based on the time of day or the caller's phone number. When processing an incoming call, Phone.com's routing engine will evaluate each rule set in the order that was specified when the route was created or updated. The first matching rule set will be used, and all other rule sets will be ignored. Each route must have at least one unfiltered rule set. Note that if your route contains multiple unfiltered rule sets, only the first one will be used. ## Supported Services * [List Routes](doc:list-account-routes) * [Get Route](doc:get-account-route) * [Create Route](doc:create-route) * [Replace Route](doc:replace-account-route) * [Delete Route](doc:delete-account-route) [block:callout] { "type": "warning", "title": "Named vs Anonymous Routes", "body": "These Route-related services will only work with named routes, a.k.a. Call Routing Presets. However, your account might have some existing anonymous routes that were generated through the [Control Panel](https://control.phone.com/login). In order to use them with this API, we recommend assigning names to them using the Control Panel, or recreating those routes from scratch and assigning names.\n\nWhen anonymous routes are referenced by other objects in this API (for example, within [Menus](doc:account-menus) and [Extensions](doc:account-extensions)), the full route configuration will be given but the `id` and `name` properties will be omitted." } [/block] ## Summary Object The Route Summary Object is used to briefly represent a route. It can be seen in several places throughout this API. Here are the properties: [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`id`", "0-1": "Integer ID. Read-only.", "1-0": "`name`", "1-1": "Name" }, "cols": 2, "rows": 2 } [/block] Here is an example: [block:code] { "codes": [ { "code": "{\n \"id\": 83511,\n \"name\": \"Toll-Free to Bob's Extension\"\n}", "language": "json" } ] } [/block] ## Full Object The root level of the Full Route Object includes all of the properties in the [Route Summary Object](#section-summary-object), along with two more: [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "h-2": "", "1-0": "`rules`", "1-1": "Array of [Rule Set Objects](#section-rule-set-objects). Required. See below for details. When processing incoming calls, the first matching rule set will be used, and all others will be ignored.", "1-2": "", "0-0": "`extension`", "0-1": "[Extension](doc:account-extensions) to which this route belongs. Output is an [Extension Summary Object](doc:account-extensions#section-summary-object). Input must be an [Extension Lookup Object](doc:account-extensions#section-lookup-object). Optional. Cannot be changed after a route is created.", "0-2": "", "h-3": "", "0-3": "", "1-3": "" }, "cols": 2, "rows": 2 } [/block] It's the Rule Set Objects where things begin to get a little more complex. The following sections spell it out: ## Rule Set Objects Properties for each rule set are described below: [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "h-2": "Required", "0-0": "`filter`", "0-1": "[Filter Object](#section-filter-objects). Optional. See below for details.", "0-2": "No", "1-0": "`actions`", "1-1": "Array of [Action Objects](#section-action-objects). Required. See below for details.", "1-2": "Yes", "h-3": "Description", "0-3": "", "1-3": "" }, "cols": 2, "rows": 2 } [/block] ## Filter Objects A filter object can specify one of several types of filters. They are described below. ### Schedule Filter The following object applies a given [schedule](doc:to-account-schedules) to a rule set. Incoming calls will only be directed to the rule set if they happen within the window(s) of time specified by the schedule. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`type`", "0-1": "Required. Must equal `schedule`.", "1-0": "`schedule`", "1-1": "[Schedule](doc:account-schedules) that this filter refers to. Output is a [Schedule Summary Object](doc:account-schedules#section-summary-object). Input must be a [Schedule Lookup Object](doc:account-schedules#section-lookup-object). Required." }, "cols": 2, "rows": 2 } [/block] ### Address Book Contact Filter The following object applies a given [address book contact](doc:account-extension-contacts) to a rule set. The rule set will only be used if the caller matches the contact specified. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`type`", "0-1": "Required. Must equal `contact`.", "1-0": "`contact`", "1-1": "[Address Book Contact](doc:account-extension-contacts) that this filter refers to. Output is a [Contact Summary Object](doc:account-extension-contacts#section-summary-object). Input must be a [Contact Lookup Object](doc:account-extension-contacts#section-lookup-object). Required." }, "cols": 2, "rows": 2 } [/block] ### Address Book Group Filter The following object applies a given [address book group](doc:account-extension-contact-groups) to a rule set. The rule set will only be used if the caller is a member of the specified contact group. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`type`", "0-1": "Required. Must equal `contact_group`.", "1-0": "`group`", "1-1": "[Address Book Group](doc:account-extension-contact-groups) that this filter refers to. Output is a [Contact Group Summary Object](doc:account-extension-contact-groups#section-summary-object). Input must be a [Contact Group Lookup Object](doc:account-extension-contact-groups#section-lookup-object). Required." }, "cols": 2, "rows": 2 } [/block] ## Action Objects Routes have rule sets, and rule sets have one or more actions. The supported actions are described below: ### Dial-by-name Directory This action is for directing calls to your account's Dial By Name directory. Callers will be asked to input the first three letters of the name of the person they wish to reach. This action completely takes over processing the call, so that no additional actions in this route will be performed. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`action`", "0-1": "Required. Must equal `directory`." }, "cols": 2, "rows": 1 } [/block] ### Disconnect This action is for disconnecting the call. This prevents any additional actions from being processed. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`action`", "0-1": "Required. Must equal `disconnect`" }, "cols": 2, "rows": 1 } [/block] ### Fax This action is for receiving an incoming fax message. This action automatically concludes by disconnecting the call, which will prevent any additional actions from being processed. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`action`", "0-1": "Required. Must equal `fax`.", "1-0": "`extension`", "1-1": "[Extension](doc:account-extensions) that this action refers to. Output is an [Extension Summary Object](doc:account-extensions#section-summary-object). Input must be an [Extension Lookup Object](doc:account-extensions#section-lookup-object). Required." }, "cols": 2, "rows": 2 } [/block] ### Forward This action is for forwarding calls to any number of [extensions](doc:account-extensions) or phone numbers. The forwarding is handled in parallel, meaning that all phone numbers and/or extensions will ring simultaneously. When the call is answered by any single phone number or extension, ringing will stop for all of them. Subsequent actions in this rule set will be performed if the call is not answered before the timeout period is reached, or if it is forwarded to an extension that has its own route *and* that route does not result in any actions that disconnect the call or take over call handling. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`action`", "0-1": "Required. Must equal `forward`.", "1-0": "`items`", "1-1": "Array of [Forward Item Objects](#section-forward-item-objects). See below for details. Required.", "2-0": "`timeout`", "2-1": "Seconds that our routing engine should wait until moving on. Optional. Must be an integer between 5 and 90. Default is 5 seconds.", "3-0": "`hold_music`", "3-1": "[Hold Music](doc:account-media) to be played while callers are waiting. Output is a [Media Summary Object](doc:account-media#section-summary-object). Input must be a [Media Lookup Object](doc:account-media#lookup-object). Optional. Must refer to a media recording that has `is_hold_music` set to `TRUE`. Default is to play a standard ring tone." }, "cols": 2, "rows": 4 } [/block] #### Forward Item Objects Here are the properties that compose the forwarding items referred to in the Forward action. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`type`", "0-1": "Required. Must equal `phone_number` or `extension`.", "1-0": "`extension`", "1-1": "Required if `type = \"extension\"`. [Extension](doc:account-extensions) that callers should be directed to. Output is an [Extension Summary Object](doc:account-extensions#section-summary-object). Input must be an [Extension Lookup Object](doc:account-extensions#section-lookup-object).", "2-0": "`number`", "2-1": "Required if `type = \"phone_number\"`. Phone number that callers should be directed to. Must be a string in E.164 format.", "3-0": "`screening`", "3-1": "Boolean. Optional. Default is `FALSE`. Use this to activate call screening. If `TRUE`, the timeout on the parent action should be at least 30 seconds.", "4-0": "`caller_id`", "4-1": "Optional. Must equal `calling_number` or `called_number`. Defines which phone number should be used for Caller ID. Default is `calling_number`.", "5-0": "`voice_tag`", "5-1": "Optional string. If `screening = TRUE`, this value will be passed into our Text-To-Speech engine and used to inform the caller of who they have reached.", "6-0": "`distinctive_ring`", "6-1": "Optional. Must equal one of: `DEFAULT`, `STYLE_2`, `STYLE_3`, `STYLE_4`, `STYLE_5`, `STYLE_6`, `STYLE_7`, `STYLE_8`, or `STYLE_9`. Identifies the style of ring tone you will hear when an incoming call is waiting." }, "cols": 2, "rows": 7 } [/block] ### Greeting This action is for playing a [message](doc:account-media) to the caller. When the message finishes playing, the next action in this rule set will be performed. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`action`", "0-1": "Required. Must equal `greeting`.", "1-0": "`greeting`", "1-1": "[Greeting](doc:account-media) that this action refers to. Output is a [Media Summary Object](doc:account-media#section-summary-object). Input must be a [Media Lookup Object](doc:account-media#section-lookup-object). Required. Must refer to a media recording that has `is_hold_music` set to `FALSE`." }, "cols": 2, "rows": 2 } [/block] ### Hold This action is for placing the caller on hold for an arbitrary number of seconds. Afterward, the next action in this rule set will be performed. [block:parameters] { "data": { "0-0": "`action`", "0-1": "Required. Must equal `hold`.", "1-0": "`duration`", "1-1": "Required. Seconds that the caller should be placed on hold before being moved onto the next action. Must be an integer between 1 and 60 seconds.", "2-0": "`hold_music`", "2-1": "[Hold Music](doc:account-media) to be played while callers are waiting. Output is a [Media Summary Object](doc:account-media#section-summary-object). Input must be a [Media Lookup Object](doc:account-media#section-lookup-object). Optional. Must refer to a media recording that has `is_hold_music` set to `TRUE`. Default is to play a standard ring tone." }, "cols": 2, "rows": 3 } [/block] ### Menu This action is for sending the caller to a [menu](doc:account-menus). This action completely takes over processing the call, so that no additional actions in this route will be performed. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`action`", "0-1": "Required. Must equal `menu`.", "1-0": "`menu`", "1-1": "[Menu](doc:account-menus) that this action refers to. Required. Output is a [Menu Summary Object](doc:account-menus#section-summary-object). Input must be a [Menu Lookup Object](doc:account-menus#section-lookup-object)." }, "cols": 2, "rows": 2 } [/block] ### Queue This action is for sending the caller to a [queue](doc:account-queues), such as for a call center. If the call is not answered within the queue's timeout period, the next action in the rule set will be performed. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`action`", "0-1": "Required. Must equal `queue`.", "1-0": "`queue`", "1-1": "[Queue](doc:account-queues) that this action refers to. Required. Output is a [Queue Summary Object](doc:account-queues#section-summary-object). Input must be a [Queue Lookup Object](doc:account-queues#section-lookup-object)." }, "cols": 2, "rows": 2 } [/block] ### Trunk (For [SIP Trunking](https://en.wikipedia.org/wiki/SIP_trunking) customers only.) This action is for sending the caller to a [trunk](doc:account-trunks). This action completely takes over processing the call, so that no additional actions in this route will be performed. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`action`", "0-1": "Required. Must equal `trunk`.", "1-0": "`trunk`", "1-1": "[Trunk](doc:account-trunks) that this action refers to. Required. Output is a [Trunk Summary Object](doc:account-trunks#section-summary-object). Input must be a [Trunk Lookup Object](doc:account-trunks#section-lookup-object)." }, "cols": 2, "rows": 2 } [/block] ### Voicemail This action is for sending the caller to the voicemail of a given [extension](doc:account-extensions). It automatically concludes by disconnecting the call, which will prevent any additional actions from being processed. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`action`", "0-1": "Required. Must equal `voicemail`.", "1-0": "`extension`", "1-1": "[Extension](doc:account-extensions) that this action refers to. Output is an [Extension Summary Object](doc:account-extensions#section-summary-object). Input must be an [Extension Lookup Object](doc:account-extensions#section-lookup-object). Required." }, "cols": 2, "rows": 2 } [/block] ## Examples Routes can get pretty complicated since there are so many options. We'll start with some simpler examples: ### Example #1: Forwarding to a menu The following route directs calls to a menu called "Main Menu". This route has one rule set. This rule set has one action, which is to direct incoming calls to a menu named "Main Menu". Note that the `menu` property is a brief representation of the menu being used. See our [Menus](doc:account-menus) section for more details. [block:code] { "codes": [ { "code": "{\n \"id\": 98357,\n \"name\": \"Go to main menu\",\n \"rules\": [\n {\n \"actions\": [\n {\n \"action\": \"menu\",\n \"menu\": {\n \"id\": 37052,\n \"name\": \"Main Menu\"\n }\n }\n ]\n }\n ]\n}", "language": "json" } ] } [/block] ### Example #2: Rule Set Filters What if calls need to be handled differently during a certain holiday weekend? Instead of the normal menu, this route could be configured to use a different rule set during that weekend, as shown below. Note that this route has two rule sets. The first one references a schedule named "Memorial Day Weekend". Calls that are received during the timeframe specified in this [schedule](doc:account-schedules) will be played a message saying that the store is closed for Memorial Day, then be directed to leave a voicemail message for the store's main extension. Calls received during any other time period will be directed to the Main Menu. [block:code] { "codes": [ { "code": "{\n \"id\": 98357,\n \"name\": \"Go to main menu\",\n \"rules\": [\n {\n \"filter\": {\n \"type\": \"schedule\",\n \"schedule\": {\n \"id\": 4513513,\n \"name\": \"Memorial Day Weekend\"\n }\n },\n \"actions\": [\n {\n \"action\": \"greeting\",\n \"greeting\": {\n \"id\": 823251,\n \"name\": \"Closed for Memorial Day\"\n }\n },\n {\n \"action\": \"voicemail\",\n \"extension\": {\n \"id\": 561315,\n \"name\": \"Main extension\"\n }\n }\n ]\n },\n {\n \"actions\": [\n {\n \"action\": \"menu\",\n \"menu\": {\n \"id\": 37052,\n \"name\": \"Main Menu\"\n }\n }\n ]\n } \n ]\n}", "language": "json" } ] } [/block] ### Example #3: Route Belonging to an Extension A route can belong to an [extension](doc:account-extensions). This is so an extension can have its own rules regardless of how a call got directed to it. The following route forwards all incoming calls for extension 504 to a phone number: [block:code] { "codes": [ { "code": "{\n \"id\": 987241,\n \"name\": \"Bob's voicemail\",\n \"extension\": {\n \"id\": 82351,\n \"extension\": 504,\n \"name\": \"Bob's Desk\"\n },\n \"rules\": [\n {\n \"actions\": [\n {\n \"action\": \"forward\",\n \"items\": [\n {\n \"type\": \"phone_number\",\n \"number\": \"+13334445555\",\n \"screening\": false,\n \"caller_id\": \"calling_number\",\n \"voice_tag\": \"Bob Martin\",\n \"distinctive_ring\": \"DEFAULT\"\n }\n ]\n }\n ]\n }\n ]\n}", "language": "json" } ] } [/block] ### Example #4: All Actions Below is an example showing all of the available actions and filters. Note: In real life, this route would not make sense. It is only intended to show the possible options. [block:code] { "codes": [ { "code": "{\n \"id\": 130457,\n \"name\": \"Test Everything!\",\n \"extension\": {\n \"id\": 12414234,\n \"extension\": 642,\n \"name\": \"Amber's Office\"\n },\n \"rules\": [\n {\n \"actions\": [\n {\n \"action\": \"greeting\",\n \"greeting\": {\n \"id\": 4634852,\n \"name\": \"Chickens clucking\"\n }\n },\n {\n \"action\": \"queue\",\n \"queue\": {\n \"id\": 734581,\n \"name\": \"3rd Floor Call Center\"\n }\n },\n {\n \"action\": \"menu\",\n \"menu\": {\n \"id\": 3254235,\n \"name\": \"Language selection\"\n }\n },\n {\n \"action\": \"forward\",\n \"timeout\": 5,\n \"hold_music\": {\n \"id\": 73735,\n \"name\": \"Our custom hold music mix\"\n },\n \"items\": [\n {\n \"type\": \"phone_number\",\n \"number\": \"+18008423394\",\n \"screening\": false,\n \"caller_id\": \"calling_number\",\n \"voice_tag\": \"Phone.com\",\n \"distinctive_ring\": \"STYLE_5\"\n },\n {\n \"type\": \"extension\",\n \"extension\": {\n \"id\": 375341,\n \"extension\": 506,\n \"name\": \"Mary's Desk\"\n },\n \"screening\": true,\n \"caller_id\": \"calling_number\",\n \"voice_tag\": \"Mary Kim\",\n \"distinctive_ring\": \"DEFAULT\"\n }\n ]\n },\n {\n \"action\": \"directory\"\n },\n {\n \"action\": \"voicemail\",\n \"extension\": {\n \"id\": 74532,\n \"extension\": 505,\n \"name\": \"Fred\"\n }\n },\n {\n \"action\": \"disconnect\"\n },\n {\n \"action\": \"fax\",\n \"extension\": {\n \"id\": 74532,\n \"extension\": 505,\n \"name\": \"Fred\"\n }\n },\n {\n \"action\": \"hold\",\n \"hold_music\": {\n \"id\": 1,\n \"name\": \"Violin sonata\"\n },\n \"duration\": 30\n },\n {\n \"action\": \"trunk\",\n \"trunk\": {\n \"id\": 88223,\n \"name\": \"Feeder Gateway\"\n }\n },\n {\n \"action\": \"application\",\n \"application\": {\n \"id\": 354015,\n \"name\": \"Web Backend\"\n }\n }\n ]\n },\n {\n \"filter\": {\n \"type\": \"schedule\",\n \"schedule\": {\n \"id\": 307513,\n \"name\": \"Thanksgiving Weekend\"\n }\n },\n \"actions\": [\n {\n \"action\": \"application\",\n \"application\": {\n \"id\": 354015,\n \"name\": \"Web Backend\"\n }\n }\n ]\n },\n {\n \"filter\": {\n \"type\": \"contact\",\n \"contact\": {\n \"id\": 7735,\n \"name\": \"Mr. Burns\"\n }\n },\n \"actions\": [\n {\n \"action\": \"disconnect\"\n }\n ]\n },\n {\n \"filter\": {\n \"type\": \"contact_group\",\n \"group\": {\n \"id\": 345345,\n \"name\": \"Bridge Club Friends\"\n }\n },\n \"actions\": [\n {\n \"action\": \"menu\",\n \"menu\": {\n \"id\": 76513,\n \"name\": \"Extended Holiday Hours\"\n }\n }\n ]\n }\n ]\n}", "language": "json" } ] } [/block] ## Lookup Object The Route Lookup Object is used to link to a route from another object. This is used, for example, when defining items for [menus](doc:account-menus). Only *one* of the following properties need to be included. If multiple are specified, then *all* properties must match one of your menus. [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "`id`", "0-1": "ID", "1-0": "`name`", "1-1": "Name" }, "cols": 2, "rows": 2 } [/block] Here are some examples: [block:code] { "codes": [ { "code": "route: {\n \"id\": 85151\n}", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "route: {\n \"name\": \"Toll-Free to Bob's Extension\"\n}", "language": "json" } ] } [/block] Instead of inputting an object, you can also use a scalar value. A route will be found if the input matches any one of the above fields. [block:code] { "codes": [ { "code": "route: 85151", "language": "json" } ] } [/block]