{"_id":"57624356653c2d2200fec7dd","__v":1,"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"},"githubsync":"","parentDoc":null,"editedParams":true,"project":"55c8cff571d7580d0063a5e5","editedParams2":true,"user":"55c8cf9471d7580d0063a5e4","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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-18T14:21:13.223Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[{"code":"<?php\n\n$client = new \\GuzzleHttp\\Client([\n    'base_uri' => 'https://api.phone.com/v4/',\n    'headers' => ['Authorization' => \"Bearer $token\"]\n]);\n\n$response = $client->post('accounts/349034/routes', ['json' => [\n    'name' => 'API V2 Test',\n    'rules' => [[\n        'actions' => [\n            ['action' => 'queue',\n             'queue' => [\n                 'id' => 20568\n            ]],\n\n            ['action' => 'menu',\n             'menu' => [\n                 'id' => 78173\n            ]],\n\n            ['action' => 'greeting',\n             'greeting' => [\n                 'id' => 548544\n            ]],\n\n            ['action' => 'forward',\n             'items' => [[\n                 'type' => 'extension',\n                 'extension' => [\n                     'id' => 668596],\n                 'screening' => false,\n                 'caller_id' => 'calling_number',\n                 'voice_tag' => 'Marty',\n                 'distinctive_ring' => 'STYLE_2',\n             ], [\n                 'type' => 'phone_number',\n                 'number' => '+19099995555',\n                 'screening' => true,\n                 'caller_id' => 'called_number',\n                 'voice_tag' => 'Carrie',\n                 'distinctive_ring' => 'STYLE_3',\n             ]],\n            'timeout' => 20,\n            'hold_music' => [\n                'name' => 'Good Bye'\n            ]],\n\t\t  \n            ['action' => 'directory'],\n\t\t\t\t  \n            ['action' => 'voicemail',\n               'extension' => [\n                   'id' => 745234\n            ]],\n\n            ['action' => 'disconnect'],\n\t\t\t\t\t  \n            ['action' => 'hold',\n             'duration' => 12,\n             'hold_music' => [\n                 'id' => 2\n            ]],\n\n            ['action' => 'trunk',\n                 'trunk' => [\n                     'id' => 475\n            ]],\n\n            ['action' => 'abcn_queue'],\n\t\t\t \n            ['action' => 'fax',\n             'extension' => [\n                 'id' => 745234\n            ]],\n\n      \t ]]]\n    ]]);\n","language":"php"}]},"method":"post","results":{"codes":[{"status":201,"language":"json","code":"{\n    \":::at:::meta\": {\n        \"@controls\": {\n            \"profile\": {\n                \"href\": \"https://apidocs.phone.com/docs/create-account-route\"\n            }\n        }\n    },\n    \"id\": 4510529,\n    \"name\": \"API V2 Test\",\n    \"extension\": null,\n    \"rules\": [\n        {\n            \"actions\": [\n                {\n                    \"action\": \"queue\",\n                    \"queue\": {\n                        \"id\": 20568,\n                        \"name\": \"API Test\",\n                        \"@controls\": {\n                            \"self\": {\n                                \"href\": \"https://api.phone.com/accounts/349034/queues/20568\"\n                            }\n                        }\n                    }\n                },\n                {\n                    \"action\": \"menu\",\n                    \"menu\": {\n                        \"id\": 78173,\n                        \"name\": \"Pedro3\",\n                        \"@controls\": {\n                            \"self\": {\n                                \"href\": \"https://api.phone.com/accounts/349034/menus/78173\"\n                            }\n                        }\n                    }\n                },\n                {\n                    \"action\": \"greeting\",\n                    \"greeting\": {\n                        \"id\": 548544,\n                        \"name\": \"After \\\"1\\\"\",\n                        \"@controls\": {\n                            \"self\": {\n                                \"href\": \"https://api.phone.com/accounts/349034/media/548544\"\n                            }\n                        }\n                    }\n                },\n                {\n                    \"action\": \"forward\",\n                    \"items\": [\n                        {\n                            \"type\": \"extension\",\n                            \"extension\": {\n                                \"id\": 668596,\n                                \"extension\": 800,\n                                \"name\": \"Communicator\",\n                                \"@controls\": {\n                                    \"self\": {\n                                        \"href\": \"https://api.phone.com/accounts/349034/extensions/668596\"\n                                    }\n                                }\n                            },\n                            \"screening\": false,\n                            \"caller_id\": \"calling_number\",\n                            \"voice_tag\": \"Marty\",\n                            \"distinctive_ring\": \"STYLE_2\"\n                        },\n                        {\n                            \"type\": \"phone_number\",\n                            \"number\": \"+19099995555\",\n                            \"screening\": true,\n                            \"caller_id\": \"called_number\",\n                            \"voice_tag\": \"Carrie\",\n                            \"distinctive_ring\": \"STYLE_3\"\n                        }\n                    ]\n                },\n                {\n                    \"action\": \"directory\"\n                },\n                {\n                    \"action\": \"voicemail\",\n                    \"extension\": {\n                        \"id\": 745234,\n                        \"name\": \"501\",\n                        \"extension\": 501,\n                        \"@controls\": {\n                            \"self\": {\n                                \"href\": \"https://api.phone.com/accounts/349034/extensions/745234\"\n                            }\n                        }\n                    }\n                },\n                {\n                    \"action\": \"disconnect\"\n                },\n                {\n                    \"action\": \"hold\",\n                    \"hold_music\": {\n                        \"id\": 2,\n                        \"name\": \"Groovy\",\n                        \"@controls\": {\n                            \"self\": {\n                                \"href\": \"https://api.phone.com/accounts/349034/media/2\"\n                            }\n                        }\n                    },\n                    \"duration\": 12\n                },\n                {\n                    \"action\": \"trunk\",\n                    \"trunk\": {\n                        \"id\": 475,\n                        \"name\": \"Tropo SIP\",\n                        \"@controls\": {\n                            \"self\": {\n                                \"href\": \"https://api.phone.com/accounts/349034/trunks/475\"\n                            }\n                        }\n                    }\n                },\n                {\n                    \"action\": \"abcn_queue\"\n                },\n                {\n                    \"action\": \"fax\",\n                    \"extension\": {\n                        \"id\": 745234,\n                        \"name\": \"501\",\n                        \"extension\": 501,\n                        \"@controls\": {\n                            \"self\": {\n                                \"href\": \"https://api.phone.com/accounts/349034/extensions/745234\"\n                            }\n                        }\n                    }\n                }\n            ]\n        }\n    ],\n    \"@controls\": {\n        \"parent\": {\n            \"href\": \"https://api.phone.com/accounts/349034/routes/4510529\"\n        },\n        \"self\": {\n            \"href\": \"https://api.phone.com/accounts/349034/routes/4510529\"\n        }\n    },\n    \"@namespaces\": {\n        \"phx\": {\n            \"name\": \"https://apidocs.phone.com/docs/\"\n        }\n    }\n}","name":""}]},"auth":"required","params":[{"_id":"56fac74b6c4e0e1900b1d820","ref":"","in":"path","required":false,"desc":"Account ID","default":"","type":"int","name":"account_id"},{"_id":"56fac74b6c4e0e1900b1d81e","ref":"","in":"body","required":false,"desc":"Name","default":"","type":"string","name":"name"},{"_id":"56faca7ee982ce220059bad3","ref":"","in":"body","required":false,"desc":"Rule Sets","default":"","type":"array_object","name":"rules"},{"_id":"56faca7ee982ce220059bad2","ref":"","in":"body","required":false,"desc":"Extension Reference","default":"","type":"object","name":"extension"}],"url":"/accounts/:account_id/routes"},"isReference":true,"order":3,"body":"","excerpt":"Add a new route to the account.  See [Intro to Routes](doc:account-routes) for more info on the properties.","slug":"create-route","type":"endpoint","title":"Create Route"}

postCreate Route

Add a new route to the account. See [Intro to Routes](doc:account-routes) for more info on the properties.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

account_id:
integer
Account ID

Body Params

name:
string
Name
rules:
array of objects
Rule Sets
extension:
object
Extension Reference

Examples


Result Format


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}