Add an Inbound Route

Adds an inbound route.

Request URL

POST {base_url}/uc-cconfig/api/v1/inbound-routes

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String The access token used for authentication.

Format: Bearer {access_token}.

x-tenant-code Yes String The tenant name.
Note: You can obtain tenant name using the Query Tenants interface.
Body parameters
Parameter Required Type Description
name Yes String The name of the inbound route. The value ranges from 1 to 63 characters.
didMatch Yes Object<DID_Match_Config> The DID match configuration of the inbound route.
callerMatch No Object<Caller_Match_Config> The caller number match configuration of the inbound route.
trunkIds Yes Array<String> The list of IDs of the trunks to bind. At least one trunk ID is required. You can obtain the IDs using the Get Available Trunks for Inbound Routes interface.
destination No Object<Destination_Config> The destination of the inbound route.
description No String The description of the inbound route. The maximum length is 255 characters.
timeBasedRoutingEnabled No Boolean

Whether to enable time-based routing.

Valid value:

  • true: Enable time-based routing.
  • false: Disable time-based routing.

If not specified, false is used.

timeBasedRoutingProfileId No String The ID of the business hours profile that time-based routing references. This parameter is required when timeBasedRoutingEnabled is true.
timeBasedRoutingConfig No Object<Time_Based_Routing_Config> The time-based routing configuration.
DID_Match_Config
Parameter Required Type Description
mode No String

The DID match mode.

Valid value:

  • DID_PATTERN: Match by DID pattern rules.
  • PATTERN_TO_EXT: Match the DID pattern to users.
  • RANGE: Match the DID range to a user range.
  • EXACT: Map DID numbers to specific users.

If not specified, DID_PATTERN is used.

patterns No Array<String> The list of DID number patterns. This parameter is valid only when mode is DID_PATTERN.
patternWithExt No String The DID pattern with the {{.Ext}} placeholder. This parameter is valid only when mode is PATTERN_TO_EXT.
mappings No Array<DID_Match_Mapping> The exact mappings of DID numbers to users. This parameter is valid only when mode is EXACT.
didIdStart No String The start ID of the DID record range. This parameter is valid only when mode is RANGE.
didIdEnd No String The end ID of the DID record range. This parameter is valid only when mode is RANGE.
DID_Match_Mapping
Parameter Required Type Description
didId Yes String The ID of the selected DID record. The DID number is resolved from the ID.
userId Yes String The ID of the target user.
Caller_Match_Config
Parameter Required Type Description
patterns No Array<String> The list of caller number patterns.
Destination_Config
Parameter Required Type Description
type No String

The type of the route destination.

Valid value:

  • HANGUP: Hang up the call.
  • USER: Route the call to a specified user.
  • MATCH_SELECTED_USERS: Extract the extension number from the DID and route the call to the allowed users.
  • MATCH_USER_RANGE: Map the DID range to an extension range.
  • DID_TO_SPECIFIC_USER: Map the DID number to a specific user.
  • IVR: Route the call to an IVR.
  • EXTERNAL_NUMBER: Route the call to an external number.
  • RING_GROUP: Route the call to a ring group.
  • QUEUE: Route the call to a queue.
  • USER_VOICEMAIL: Route the call to the voicemail of a user. value is required.
  • GROUP_VOICEMAIL: Route the call to the voicemail of a ring group. value is required.
  • PLAY_PROMPT: Play a prompt and then hang up. value is the prompt file name, and prefix is the playback count.

If not specified, HANGUP is used.

value No String The value of the destination, which is interpreted according to type.
prefix No String The outbound prefix. This parameter is valid only when type is EXTERNAL_NUMBER. The maximum length is 7 characters.
allowedUserIds No Array<String> The list of IDs of the allowed users. This parameter is valid only when type is MATCH_SELECTED_USERS.
extensionStart No String The start of the extension range. This parameter is valid only when type is MATCH_USER_RANGE.
extensionEnd No String The end of the extension range. This parameter is valid only when type is MATCH_USER_RANGE.
repeatCount No Integer

The number of times the prompt is played. This parameter is valid only when type is PLAY_PROMPT.

Valid value:

  • 0: Not set.
  • 1 - 5: The number of times.
Time_Based_Routing_Config
Parameter Required Type Description
holidayHandling No String

The handling method for holidays.

Valid value:

  • route: Route the call to the holiday destination.
  • play_prompt: Play a prompt.
  • ignore: Ignore the holiday.

If not specified, route is used.

businessHoursDestination No Object<Destination_Config> The destination during business hours.
outsideDestination No Object<Destination_Config> The destination outside business hours.
holidayDestination No Object<Destination_Config> The destination on holidays.

Response parameters

Parameter Type Description
requestId String The unique ID of the request, which can be used to quickly locate the request.
code String The HTTP status code of the request.
  • 200: Request succeeded.
  • Non-200 value: Request failed.
message String The status message of the request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

result Object<Add_Result> The result of the request.
Add_Result
Parameter Type Description
id String The ID of the inbound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UVLIKgxYuhDt1YSR6qX9Qy4r9cEkMidG5Ae1rDceDk1rsnxddMOaoFzTu0WS0FJTRf8w5SnKVLueIh6LkRaIgdFRO4L3-DmseAj-ZaYgEATExvVAB3M_5q8oemiIqQepbtq66yW06g
x-tenant-code: jint
Content-Type: application/json
{
  "name": "ir-doc-test-1",
  "didMatch": {
    "mode": "DID_PATTERN",
    "patterns": [
      "6000"
    ]
  },
  "trunkIds": [
    "367177966216302592"
  ],
  "destination": {
    "type": "IVR",
    "value": "342969063155736576"
  },
  "description": "Created for doc testing."
}

Response example

HTTP/1.1 200 OK
{
  "requestId": "b303eeddc402c7821abec6d837fb3bb7",
  "code": "200",
  "message": "SUCCESS",
  "detailMessage": "",
  "result": {
    "id": "374469838063886336",
    "name": "ir-doc-test-1",
    "listOrder": 3,
    "description": "",
    "didMatch": {
      "mode": "DID_PATTERN",
      "patterns": [
        "6000"
      ],
      "patternWithExt": "",
      "mappingsCount": 0,
      "mappings": [],
      "didIdStart": "",
      "didIdEnd": "",
      "defaultDisplayFormatStart": "",
      "defaultDisplayFormatEnd": "",
      "didNameStart": "",
      "didNameEnd": "",
      "countryCodeStart": "",
      "countryCodeEnd": "",
      "didE164Start": "",
      "didE164End": ""
    },
    "callerMatch": null,
    "trunkIds": [
      "367177966216302592"
    ],
    "destination": {
      "type": "IVR",
      "value": "342969063155736576",
      "allowedUserIds": [],
      "extensionStart": "",
      "extensionEnd": ""
    },
    "createdAt": "0",
    "updatedAt": "0",
    "timeBasedRoutingEnabled": false,
    "timeBasedRoutingProfileId": ""
  }
}