Outbound rules

Manage your outbound rules.

List outbound rules

get

Retrieve a collection of outbound rules.

Authorizations
Query parameters
filterstringOptional

Use the filter query parameter to retrieve just a subset of a collection.

searchstringOptional

Use the search query parameter to restrict the results of a request to match a search criterion.

orderbystringOptional

Use the orderby query parameter to specify the sort order of the items returned from server.
The default order is ascending order.

skipinteger · int32Optional

Use the skip query parameter to set the number of items to skip at the start of a collection.

Default: 0
topinteger · int32 · min: 1 · max: 100Optional

Use the top query parameter to specify the page size of the result set.

Default: 100
Responses
200
OK
application/json
get
GET /api/outbound_rules HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 100,
  "items": [
    {
      "id": "NzAwNTUxOTA5NzczMTQ4MTYw",
      "name": "text",
      "number_prefix": "text",
      "number_length": "text",
      "number_mask": "text",
      "enabled": true,
      "priority": 1000,
      "office_hours": {
        "mode": "CUSTOM",
        "monday": {
          "enabled": true,
          "ranges": [
            {
              "from": "09:00",
              "to": "17:00"
            }
          ]
        },
        "tuesday": {
          "enabled": true,
          "ranges": [
            {
              "from": "09:00",
              "to": "17:00"
            }
          ]
        },
        "wednesday": {
          "enabled": true,
          "ranges": [
            {
              "from": "09:00",
              "to": "17:00"
            }
          ]
        },
        "thursday": {
          "enabled": true,
          "ranges": [
            {
              "from": "09:00",
              "to": "17:00"
            }
          ]
        },
        "friday": {
          "enabled": true,
          "ranges": [
            {
              "from": "09:00",
              "to": "17:00"
            }
          ]
        },
        "saturday": {
          "enabled": true,
          "ranges": [
            {
              "from": "09:00",
              "to": "17:00"
            }
          ]
        },
        "sunday": {
          "enabled": true,
          "ranges": [
            {
              "from": "09:00",
              "to": "17:00"
            }
          ]
        }
      },
      "holidays": [
        {
          "id": "NzAwNTUxOTA5NzczMTQ4MTYw",
          "name": "text",
          "every_year": true,
          "consecutive": true,
          "year_start": 1,
          "year_end": 1,
          "month_start": 1,
          "month_end": 1,
          "day_start": 1,
          "day_end": 1,
          "hour_start": 1,
          "hour_end": 1,
          "minute_start": 1,
          "minute_end": 1
        }
      ],
      "routing_strategy": "PRIORITIZED"
    }
  ]
}

Create a outbound rule

post

Add a new outbound rule.

Authorizations
Body
namestring · min: 1 · max: 64Required

The name of outbound rule.

number_prefixstring · max: 64Optional

Prefix of callee ID. Calls started with this prefix will be applied this outbound rule.

number_lengthstring · max: 64Optional

The length of number prefix.
A semicolon-separated list of integer.
For example by specifying "1;2", calls with a caller ID of 1 or 2 digits will be applied this rule.

number_maskstringOptional

Extension who starts the call. A semicolon-separated list of extensions allowed. For example by specifying "101-110;199", extensions from 101 to 110 and 199 will be applied this rule.

enabledbooleanOptional

Whether to enable outbound rule.

Default: true
priorityinteger · int32Optional

The priority of outbound rule.

Default: 1000
office_hoursall ofOptional
routing_strategystring · enumOptional

Routing strategy:
Can be either:

  • PRIORITIZED: Selected according to the priority order of the route list.
  • RANDOMLY: Randomly select one of the route list.
Default: PRIORITIZEDPossible values:
Responses
201
Created outbound rule
application/json
post
POST /api/outbound_rules HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 827

{
  "name": "text",
  "number_prefix": "text",
  "number_length": "text",
  "number_mask": "text",
  "enabled": true,
  "priority": 1000,
  "office_hours": {
    "mode": "CUSTOM",
    "monday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "tuesday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "wednesday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "thursday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "friday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "saturday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "sunday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    }
  },
  "holidays": [
    "NzAwNTUxOTA5NzczMTQ4MTYw"
  ],
  "routing_strategy": "PRIORITIZED",
  "routes": [
    {
      "enabled": true,
      "provider_id": "NzAwNTUxOTA5NzczMTQ4MTYw",
      "strip_digits": 0,
      "prepend": "text",
      "outbound_caller_id": "text"
    }
  ]
}
{
  "id": "NzAwNTUxOTA5NzczMTQ4MTYw"
}

Retrieve a outbound rule

get
Authorizations
Path parameters
idall ofRequired

The unique ID of outbound rule.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Responses
200
OK
application/json
get
GET /api/outbound_rules/{id} HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "NzAwNTUxOTA5NzczMTQ4MTYw",
  "name": "text",
  "number_prefix": "text",
  "number_length": "text",
  "number_mask": "text",
  "enabled": true,
  "priority": 1000,
  "office_hours": {
    "mode": "CUSTOM",
    "monday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "tuesday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "wednesday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "thursday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "friday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "saturday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "sunday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    }
  },
  "holidays": [
    {
      "id": "NzAwNTUxOTA5NzczMTQ4MTYw",
      "name": "text",
      "every_year": true,
      "consecutive": true,
      "year_start": 1,
      "year_end": 1,
      "month_start": 1,
      "month_end": 1,
      "day_start": 1,
      "day_end": 1,
      "hour_start": 1,
      "hour_end": 1,
      "minute_start": 1,
      "minute_end": 1
    }
  ],
  "routing_strategy": "PRIORITIZED",
  "routes": [
    {
      "enabled": true,
      "provider_id": "NzAwNTUxOTA5NzczMTQ4MTYw",
      "strip_digits": 0,
      "prepend": "text",
      "outbound_caller_id": "text"
    }
  ]
}

Update a outbound rule

post

Update properties of outbound rule by it's unique ID.

Authorizations
Path parameters
idall ofRequired

The unique ID of outbound rule.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Body
idall ofOptional

The unique ID of outbound rule.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
namestring · min: 1 · max: 64Optional

The name of outbound rule.

number_prefixstring · max: 64Optional

Prefix of callee ID. Calls started with this prefix will be applied this outbound rule.

number_lengthstring · max: 64Optional

The length of number prefix.
A semicolon-separated list of integer.
For example by specifying "1;2", calls with a caller ID of 1 or 2 digits will be applied this rule.

number_maskstringOptional

Extension who starts the call. A semicolon-separated list of extensions allowed. For example by specifying "101-110;199", extensions from 101 to 110 and 199 will be applied this rule.

enabledbooleanOptional

Whether to enable outbound rule.

Default: true
priorityinteger · int32Optional

The priority of outbound rule.

Default: 1000
office_hoursall ofOptional
routing_strategystring · enumOptional

Routing strategy:
Can be either:

  • PRIORITIZED: Selected according to the priority order of the route list.
  • RANDOMLY: Randomly select one of the route list.
Default: PRIORITIZEDPossible values:
Responses
200
OK
post
POST /api/outbound_rules/{id} HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 859

{
  "id": "NzAwNTUxOTA5NzczMTQ4MTYw",
  "name": "text",
  "number_prefix": "text",
  "number_length": "text",
  "number_mask": "text",
  "enabled": true,
  "priority": 1000,
  "office_hours": {
    "mode": "CUSTOM",
    "monday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "tuesday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "wednesday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "thursday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "friday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "saturday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    },
    "sunday": {
      "enabled": true,
      "ranges": [
        {
          "from": "09:00",
          "to": "17:00"
        }
      ]
    }
  },
  "holidays": [
    "NzAwNTUxOTA5NzczMTQ4MTYw"
  ],
  "routing_strategy": "PRIORITIZED",
  "routes": [
    {
      "enabled": true,
      "provider_id": "NzAwNTUxOTA5NzczMTQ4MTYw",
      "strip_digits": 0,
      "prepend": "text",
      "outbound_caller_id": "text"
    }
  ]
}

No content

Delete a outbound rule

post
Authorizations
Path parameters
idall ofRequired

The unique ID of outbound rule.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Responses
204
No Content
post
POST /api/outbound_rules/{id}/destroy HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Export outbound rules

get

Export a collection of outbound rules to file.

Authorizations
Responses
200
OK
application/octet-stream
Responsestring · binary
get
GET /api/outbound_rules/export HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
binary

List applied groups of outbound rule

get

Retrieve a collection of user groups applied to outbound rule.

Authorizations
Path parameters
idall ofRequired

The unique ID of outbound rule.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Responses
200
OK
application/json
get
GET /api/outbound_rules/{id}/applied_groups HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "id": "NzAwNTUxOTA5NzczMTQ4MTYw",
      "name": "text",
      "description": "text"
    }
  ]
}

Check if a group has outbound rule applied

get

Check if a group has outbound rule applied.

Authorizations
Path parameters
idall ofRequired

The unique ID of outbound rule.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
group_idall ofRequired

The unique ID of user group.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Responses
200
OK
application/json
get
GET /api/outbound_rules/{id}/applied_groups/{group_id} HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "NzAwNTUxOTA5NzczMTQ4MTYw",
  "name": "text",
  "description": "text"
}

Apply group to outbound rule

post

Apply a group to outbound rule.

Authorizations
Path parameters
idall ofRequired

The unique ID of outbound rule.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
group_idall ofRequired

The unique ID of user group.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Responses
200
OK
post
POST /api/outbound_rules/{id}/applied_groups/{group_id} HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Cancel group applied outbound rule

post

Cancel group applied outbound rule.

Authorizations
Path parameters
idall ofRequired

The unique ID of outbound rule.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
group_idall ofRequired

The unique ID of user group.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Responses
204
No Content
post
POST /api/outbound_rules/{id}/applied_groups/{group_id}/destroy HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content