Fetch All Routing Rules - API
Retrieves a paginated list of routing rules for the authenticated user. Supports filtering by
gatewayId
, id
, and searching by rule name.HTTP method and endpoint
GET
|
https://api.videosdk.live/v2/sip/routing-rulesHeaders Parameters
REQUIRED
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
Query Parameters
OPTIONAL
Optional. Filter routing rules by associated gateway ID.
OPTIONAL
Optional. Filter by specific routing rule ID.
OPTIONAL
Optional. Search routing rules by name (case-insensitive).
OPTIONAL
Page number for pagination. Defaults to
1
. OPTIONAL
Number of records per page. Defaults to
10
. GET
|
https://api.videosdk.live/v2/sip/routing-rules
NodeJS
import fetch from 'node-fetch';
const options = {
method: "GET",
headers: {
"Authorization": "$YOUR_TOKEN",
},
};
const url= `https://api.videosdk.live/v2/sip/routing-rules?gatewayId=gateway_in_123456789&id=rule_123456789&search=Support Line Rule&page=1&perPage=10`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"pageInfo": {
"currentPage": 1,
"perPage": 10,
"lastPage": 1,
"total": 2
},
"data": [
{
"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"
]
},
{
"id": "rule_987654321",
"name": "Backup Rule",
"type": "OUTBOUND",
"numbers": [
"+14158889999"
],
"gatewayId": "gateway_out_987654321",
"dispatch": {
"room": {
"type": "meeting",
"prefix": "44",
"id": "room_999",
"pin": "9876"
},
"agent": {
"type": "user",
"id": "user_456",
"metadata": {}
}
},
"hidePhoneNumber": true,
"metadata": {},
"tags": [
"backup"
]
}
]
}
Got a Question? Ask us on discord