Yay.com loading

Loading

  • My Shopping Cart (0) £0.00

  • Register

Phone Numbers & Call Routing

API Access

Build custom apps using our JSON API

FREE
Get your free API Key

Call Flows

Call Flows define the route to be followed when a call is incoming to a number assigned with the call flow

Get your free API Key

Filter:

  • All
  • GET
  • POST
  • PUT
  • DELETE
  • Chargeable *

* You will be charged every time this command is run.

  • GET/voip/flow

    Gets all the active call flows on an account

    Back to top

    Request Details

    Response Details

    Request Details

    This command has no URL/Query String parameters

    Response Details

    200 Response

    {
        "result" : [
            {
                "name" : "Call Pete",
                "extension" : 501,
                "flow" : {
                    "161ec941-1c6a-4d42-b011-1c050487324d" : {
                        "module" : "start",
                        "next" : "9085aa47-0ff0-4fd0-9c80-6077e1f475c2"
                    },
                    "9085aa47-0ff0-4fd0-9c80-6077e1f475c2" : {
                        "module" : "pressextension",
                        "next" : {
                            "1" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                            "2" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                            "invalid" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                            "timeout" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6"
                        }
                    },
                    "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6" : {
                        "module" : "extension",
                        "extensions" : [
                            {
                                "type" : "sipuser",
                                "uuid" : "92b0aca6-12aa-480c-a7b7-a31df403418c"
                            }
                        ]
                    }
                },
                "show_call_route_name" : true,
                "show_original_caller_id" : true,
                "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
                "created_on" : "2017-11-20",
                "updated_on" : "2017-11-20"
            }
        ],
        "status_code" : 200,
        "status_message" : "OK"
    }
  • GET/voip/flow/{uuid}

    Gets the details for a specific call flow

    Back to top

    Request Details

    Response Details

    Request Details

    URL and Query String Parameters

    • Name

    • Type

    • Required

      • uuid

      • String

      • True

      The UUID of the Call Flow to be queried

    Response Details

    200 Response

    {
        "result" : {
            "name" : "Call Pete",
            "extension" : 501,
            "flow" : {
                "161ec941-1c6a-4d42-b011-1c050487324d" : {
                    "module" : "start",
                    "next" : "9085aa47-0ff0-4fd0-9c80-6077e1f475c2"
                },
                "9085aa47-0ff0-4fd0-9c80-6077e1f475c2" : {
                    "module" : "pressextension",
                    "next" : {
                        "1" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                        "2" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                        "invalid" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                        "timeout" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6"
                    }
                },
                "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6" : {
                    "module" : "extension",
                    "extensions" : [
                        {
                            "type" : "sipuser",
                            "uuid" : "92b0aca6-12aa-480c-a7b7-a31df403418c"
                        }
                    ]
                }
            },
            "show_call_route_name" : true,
            "show_original_caller_id" : true,
            "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
            "created_on" : "2017-11-20",
            "updated_on" : "2017-11-20"
        },
        "status_code" : 200,
        "status_message" : "OK"
    }

    404 Response

    {
        "result" : {},
        "status_code" : 404,
        "status_message" : "Not Found"
    }
  • POST/voip/flow

    Creates a new call flow

    Back to top

    Request Details

    Response Details

    Request Details

    This command has no URL/Query String parameters

    POST body

    • Name

    • Type

    • Required

      • extension

      • Integer

      • True

      The extension assigned to this Call Flow

      • flow

      • Map of Call Flow Module

      • True

      The Call Flow Module map

      • name

      • String

      • True

      The name of this Call Flow

      • show_call_route_name

      • boolean

      • True

      Whether or not the Call Flow name will be included in the forwarded Caller ID

      • show_original_caller_id

      • boolean

      • True

      Whether the forwarded Caller ID will be the original Caller ID, or the called number

    Call Flow Module

    A Call Flow Module describes a step in the Call Flow. The type of module is indicated by the value of the 'module' key. All Call Flows must have a 'start' module which indicates the entry point into the Call Flow.

    Start

    The start module is the entry point and is required for every call flow.

    {
        "module" : "start",
        "next" : "The key of the next module to route to"
    }

    Recording

    The recording module enables call recording from this point forward in the call flow.

    {
        "module" : "recording",
        "next" : "The key of the next module to route to"
    }

    Music On Hold

    The music on hold module sets the hold music from this point forward in the call flow.

    {
        "module" : "musiconhold",
        "class" : "The uuid of the playlist to use as hold music",
        "next" : "The key of the next module to route to"
    }

    Caller ID Match

    The caller id match module allows you to modify the routing based on the incoming Caller ID.

    {
        "module" : "calleridmatch",
        "patterns" : "A list of regular expression patterns to match against, e.g. ['^44800', '9000$', '1483', 'anonymous', 'unavailable']",
        "match" : "The key of the next module to route to if a match is found",
        "nomatch" : "The key of the next module to route to if no match is found"
    }

    Play

    The play module plays a sound to the caller

    {
        "module" : "play",
        "sound" : "The uuid of the sound to play",
        "next" : "The key of the next module to route to"
    }

    Extension

    The extension module calls a SIP User, Hunt Group, or forwards to an external number.

    {
        "module" : "extension",
        "duration" : "Optional: The ring duration in seconds. Default 30",
        "noanswer" : "The key of the next module to route to if the call isn't answered",
        "ringtone" : "Optional: The uuid of the sound or playlist used as a ringtone",
        "announcement" : "Optional: The uuid of the sound used as a call whisper",
        "extensions" : [
            {
                "type" : "sipuser",
                "uuid" : "The uuid of the sip user to call"
            },
            {
                "type" : "huntgroup",
                "uuid" : "The uuid of the hunt group to call"
            },
            {
                "type" : "forward",
                "number" : "The number to forward to in e164 format"
            }
        ]
    }

    Press Extension (IVR)

    The press extension module will route to different modules based on the number pressed by the caller.

    {
        "module" : "pressextension",
        "duration" : "Optional: The time to wait for a press in seconds. Default 10",
        "sound" : "Optional: The uuid of the sound that will play to the caller",
        "next" : {
            "1" : "The key of the next module to route to if '1' is pressed",
            "2" : "The key of the next module to route to if '2' is pressed",
            "..." : "",
            "invalid" : "The key of the next module to route to if the pressed number is invalid",
            "timeout" : "The key of the next module to route to if nothing is pressed before the timeout duration"
        }
    }

    DialByExtension

    The dial by extension module will call a SIP User by their extension.

    {
        "module" : "dialbyextension",
        "wait_duration" : "Optional: The time to wait for a press in seconds. Default 10",
        "dial_duration" : "Optional: The ring duration in seconds. Default 30",
        "noanswer" : "The key of the next module to route to, or 'sipuser_voicemail' to go to the dialled extension's personal mailbox",
        "ringtone" : "The uuid of sound or or playlist used for hold music",
        "sound" : "Optional: The uuid of the sound that will play to the caller",
        "next" : {
            "invalid" : "The key of the next module to route to if the pressed number is invalid",
            "timeout" : "The key of the next module to route to if nothing is pressed before the timeout duration"
        }
    }

    Busy

    The busy module plays a busy tone and hangs up the call. This is a terminating module.

    {
        "module" : "busy",
        "duration" : "Optional: The duration of the busy tone in seconds. Default 3"
    }

    Voicemail

    The voicemail module directs to call to a Mailbox for the caller to leave a message. This is a terminating module.

    {
        "module" : "voicemail",
        "mailboxes" : "An array of Mailbox UUIDs to leave a message on"
    }

    Conference

    The conference module sends callers to a conference bridge. This is a terminating module.

    {
        "module" : "conference",
        "pin" : "Optional: The 4 digit pin required to enter the conference",
        "music" : "Optional: The uuid of the playlist used when there is only one person in the conference",
        "announcement" : "Optional: The uuid of the sound played when joining the conference"
    }

    Trunk

    The trunk module forwards the call to a trunk on the account. This is a terminating module.

    {
        "module" : "Trunk",
        "uuid" : "The uuid of the Trunk the call is sent to"
    }

    Fax

    The fax module allows the call flow to receive faxes. This should be the only module after 'start' if you wish to receive faxes.

    {
        "module" : "fax"
    }

    JSON all-fields example:

    {
        "name" : "Call Pete",
        "extension" : 501,
        "flow" : {
            "161ec941-1c6a-4d42-b011-1c050487324d" : {
                "module" : "start",
                "next" : "9085aa47-0ff0-4fd0-9c80-6077e1f475c2"
            },
            "9085aa47-0ff0-4fd0-9c80-6077e1f475c2" : {
                "module" : "pressextension",
                "next" : {
                    "1" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                    "2" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                    "invalid" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                    "timeout" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6"
                }
            },
            "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6" : {
                "module" : "extension",
                "extensions" : [
                    {
                        "type" : "sipuser",
                        "uuid" : "92b0aca6-12aa-480c-a7b7-a31df403418c"
                    }
                ]
            }
        },
        "show_call_route_name" : true,
        "show_original_caller_id" : true
    }

    Response Details

    201 Response

    {
        "result" : {
            "name" : "Call Pete",
            "extension" : 501,
            "flow" : {
                "161ec941-1c6a-4d42-b011-1c050487324d" : {
                    "module" : "start",
                    "next" : "9085aa47-0ff0-4fd0-9c80-6077e1f475c2"
                },
                "9085aa47-0ff0-4fd0-9c80-6077e1f475c2" : {
                    "module" : "pressextension",
                    "next" : {
                        "1" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                        "2" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                        "invalid" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                        "timeout" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6"
                    }
                },
                "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6" : {
                    "module" : "extension",
                    "extensions" : [
                        {
                            "type" : "sipuser",
                            "uuid" : "92b0aca6-12aa-480c-a7b7-a31df403418c"
                        }
                    ]
                }
            },
            "show_call_route_name" : true,
            "show_original_caller_id" : true,
            "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
            "created_on" : "2017-11-20"
        },
        "status_code" : 201,
        "status_message" : "Created"
    }

    400 Response

    {
        "result" : {},
        "status_code" : 400,
        "status_message" : "Bad Request"
    }
  • PUT/voip/flow/{uuid}

    Updates the specified call flow

    Back to top

    Request Details

    Response Details

    Request Details

    URL and Query String Parameters

    • Name

    • Type

    • Required

      • uuid

      • String

      • True

      The UUID of the Call Flow to be updated

    PUT body

    • Name

    • Type

    • Required

      • extension

      • Integer

      • True

      The extension assigned to this Call Flow

      • flow

      • Map of Call Flow Module

      • True

      The Call Flow Module map

      • name

      • String

      • True

      The name of this Call Flow

      • show_call_route_name

      • boolean

      • True

      Whether or not the Call Flow name will be included in the forwarded Caller ID

      • show_original_caller_id

      • boolean

      • True

      Whether the forwarded Caller ID will be the original Caller ID, or the called number

    Call Flow Module

    A Call Flow Module describes a step in the Call Flow. The type of module is indicated by the value of the 'module' key. All Call Flows must have a 'start' module which indicates the entry point into the Call Flow.

    Start

    The start module is the entry point and is required for every call flow.

    {
        "module" : "start",
        "next" : "The key of the next module to route to"
    }

    Recording

    The recording module enables call recording from this point forward in the call flow.

    {
        "module" : "recording",
        "next" : "The key of the next module to route to"
    }

    Music On Hold

    The music on hold module sets the hold music from this point forward in the call flow.

    {
        "module" : "musiconhold",
        "class" : "The uuid of the playlist to use as hold music",
        "next" : "The key of the next module to route to"
    }

    Caller ID Match

    The caller id match module allows you to modify the routing based on the incoming Caller ID.

    {
        "module" : "calleridmatch",
        "patterns" : "A list of regular expression patterns to match against, e.g. ['^44800', '9000$', '1483', 'anonymous', 'unavailable']",
        "match" : "The key of the next module to route to if a match is found",
        "nomatch" : "The key of the next module to route to if no match is found"
    }

    Play

    The play module plays a sound to the caller

    {
        "module" : "play",
        "sound" : "The uuid of the sound to play",
        "next" : "The key of the next module to route to"
    }

    Extension

    The extension module calls a SIP User, Hunt Group, or forwards to an external number.

    {
        "module" : "extension",
        "duration" : "Optional: The ring duration in seconds. Default 30",
        "noanswer" : "The key of the next module to route to if the call isn't answered",
        "ringtone" : "Optional: The uuid of the sound or playlist used as a ringtone",
        "announcement" : "Optional: The uuid of the sound used as a call whisper",
        "extensions" : [
            {
                "type" : "sipuser",
                "uuid" : "The uuid of the sip user to call"
            },
            {
                "type" : "huntgroup",
                "uuid" : "The uuid of the hunt group to call"
            },
            {
                "type" : "forward",
                "number" : "The number to forward to in e164 format"
            }
        ]
    }

    Press Extension (IVR)

    The press extension module will route to different modules based on the number pressed by the caller.

    {
        "module" : "pressextension",
        "duration" : "Optional: The time to wait for a press in seconds. Default 10",
        "sound" : "Optional: The uuid of the sound that will play to the caller",
        "next" : {
            "1" : "The key of the next module to route to if '1' is pressed",
            "2" : "The key of the next module to route to if '2' is pressed",
            "..." : "",
            "invalid" : "The key of the next module to route to if the pressed number is invalid",
            "timeout" : "The key of the next module to route to if nothing is pressed before the timeout duration"
        }
    }

    DialByExtension

    The dial by extension module will call a SIP User by their extension.

    {
        "module" : "dialbyextension",
        "wait_duration" : "Optional: The time to wait for a press in seconds. Default 10",
        "dial_duration" : "Optional: The ring duration in seconds. Default 30",
        "noanswer" : "The key of the next module to route to, or 'sipuser_voicemail' to go to the dialled extension's personal mailbox",
        "ringtone" : "The uuid of sound or or playlist used for hold music",
        "sound" : "Optional: The uuid of the sound that will play to the caller",
        "next" : {
            "invalid" : "The key of the next module to route to if the pressed number is invalid",
            "timeout" : "The key of the next module to route to if nothing is pressed before the timeout duration"
        }
    }

    Busy

    The busy module plays a busy tone and hangs up the call. This is a terminating module.

    {
        "module" : "busy",
        "duration" : "Optional: The duration of the busy tone in seconds. Default 3"
    }

    Voicemail

    The voicemail module directs to call to a Mailbox for the caller to leave a message. This is a terminating module.

    {
        "module" : "voicemail",
        "mailboxes" : "An array of Mailbox UUIDs to leave a message on"
    }

    Conference

    The conference module sends callers to a conference bridge. This is a terminating module.

    {
        "module" : "conference",
        "pin" : "Optional: The 4 digit pin required to enter the conference",
        "music" : "Optional: The uuid of the playlist used when there is only one person in the conference",
        "announcement" : "Optional: The uuid of the sound played when joining the conference"
    }

    Trunk

    The trunk module forwards the call to a trunk on the account. This is a terminating module.

    {
        "module" : "Trunk",
        "uuid" : "The uuid of the Trunk the call is sent to"
    }

    Fax

    The fax module allows the call flow to receive faxes. This should be the only module after 'start' if you wish to receive faxes.

    {
        "module" : "fax"
    }

    JSON all-fields example:

    {
        "name" : "Call Pete",
        "extension" : 501,
        "flow" : {
            "161ec941-1c6a-4d42-b011-1c050487324d" : {
                "module" : "start",
                "next" : "9085aa47-0ff0-4fd0-9c80-6077e1f475c2"
            },
            "9085aa47-0ff0-4fd0-9c80-6077e1f475c2" : {
                "module" : "pressextension",
                "next" : {
                    "1" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                    "2" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                    "invalid" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                    "timeout" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6"
                }
            },
            "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6" : {
                "module" : "extension",
                "extensions" : [
                    {
                        "type" : "sipuser",
                        "uuid" : "92b0aca6-12aa-480c-a7b7-a31df403418c"
                    }
                ]
            }
        },
        "show_call_route_name" : true,
        "show_original_caller_id" : true
    }

    Response Details

    200 Response

    {
        "result" : {
            "name" : "Call Pete",
            "extension" : 501,
            "flow" : {
                "161ec941-1c6a-4d42-b011-1c050487324d" : {
                    "module" : "start",
                    "next" : "9085aa47-0ff0-4fd0-9c80-6077e1f475c2"
                },
                "9085aa47-0ff0-4fd0-9c80-6077e1f475c2" : {
                    "module" : "pressextension",
                    "next" : {
                        "1" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                        "2" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                        "invalid" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6",
                        "timeout" : "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6"
                    }
                },
                "fdc20592-2757-4a9a-a1d3-3c4e7b6a39d6" : {
                    "module" : "extension",
                    "extensions" : [
                        {
                            "type" : "sipuser",
                            "uuid" : "92b0aca6-12aa-480c-a7b7-a31df403418c"
                        }
                    ]
                }
            },
            "show_call_route_name" : true,
            "show_original_caller_id" : true,
            "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
            "created_on" : "2017-11-20",
            "updated_on" : "2017-11-20"
        },
        "status_code" : 200,
        "status_message" : "OK"
    }

    400 Response

    {
        "result" : {},
        "status_code" : 400,
        "status_message" : "Bad Request"
    }

    404 Response

    {
        "result" : {},
        "status_code" : 404,
        "status_message" : "Not Found"
    }
  • DELETE/voip/flow/{uuid}

    Deletes the specified call flow

    Back to top

    Request Details

    Response Details

    Request Details

    URL and Query String Parameters

    • Name

    • Type

    • Required

      • uuid

      • String

      • True

      The UUID of the Call Flow to be deleted

    Response Details

    204 Response

    {
        "result" : {},
        "status_code" : 204,
        "status_message" : "No Content"
    }

    404 Response

    {
        "result" : {},
        "status_code" : 404,
        "status_message" : "Not Found"
    }
View Desktop Site