Skip to main content
Version: /v2

Fetch Routing Rule by ID - API

Fetches the details of a specific routing rule by its ruleId for the authenticated user.

HTTP method and endpoint

GET

|

https://api.videosdk.live/v2/sip/routing-rules/:ruleId
Headers Parameters

values : YOUR_TOKEN_WITHOUT_ANY_PREFIX

This will be a JWT token generate using VideoSDK ApiKey and Secret.

Note that the token will not include any prefix such as "Basic " or "Bearer ". Just pass a token as value.

You can generate a new token by refering this Guide: Generate Auth token

Parameters
REQUIRED
The unique ID of the routing rule to retrieve.
Response Parameters
Unique identifier of the routing rule.
Name of the routing rule.
Routing rule type (INBOUND or OUTBOUND).
Array of phone numbers associated with this rule.
Associated SIP Gateway ID.
Dispatch target configuration (room/agent details).
Whether the caller’s phone number is masked.
Custom metadata object attached to the routing rule.
Array of tags associated with this rule.
GET
|
https://api.videosdk.live/v2/sip/routing-rules/:ruleId
import fetch from 'node-fetch';
const options = {
method: "GET",
headers: {
"Authorization": "$YOUR_TOKEN",
},
};
const url= `https://api.videosdk.live/v2/sip/routing-rules/:ruleId`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"id": "rule_123456789",
"name": "Support Line Rule",
"type": "INBOUND",
"numbers": [
"+14150001111"
],
"gatewayId": "gateway_in_123456789",
"dispatch": {
"room": {
"type": "static",
"prefix": "prefix",
"id": "room_123",
"pin": "4321"
},
"agent": {
"type": "user",
"id": "user_789",
"metadata": {
"department": "sales"
}
}
},
"hidePhoneNumber": false,
"metadata": {
"env": "production"
},
"tags": [
"priority",
"support"
]
}

Got a Question? Ask us on discord