Update Routing Rule - API
Updates an existing routing rule by its
ruleId
for the authenticated user. Only the provided fields will be updated; other fields remain unchanged.HTTP method and endpoint
PUT
|
https://api.videosdk.live/v2/sip/routing-rules/:ruleIdHeaders 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
REQUIRED
values : application/json
This is usefull for json body parameters, so that VideoSDK servers can understand that the incoming body parameter will be a JSON string.
Parameters
REQUIRED
The unique ID of the routing rule to update.
Body Parameters
OPTIONAL
Name of the routing rule.
OPTIONAL
Dispatch target configuration (room or agent details).
OPTIONAL
Whether the caller’s phone number should be masked.
OPTIONAL
Custom metadata object attached to the routing rule.
OPTIONAL
Array of tags associated with this rule.
OPTIONAL
Array of phone numbers associated with this rule.
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.
PUT
|
https://api.videosdk.live/v2/sip/routing-rules/:ruleId
NodeJS
import fetch from 'node-fetch';
const options = {
method: "PUT",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
};
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": "Updated Support Rule",
"type": "INBOUND",
"numbers": [
"+14150002222",
"+14150003333"
],
"gatewayId": "gateway_in_123456789",
"dispatch": {
"room": {
"type": "static",
"prefix": "prefix",
"id": "room_123",
"pin": "5678"
}
},
"hidePhoneNumber": false,
"metadata": {
"updated": true
},
"tags": [
"priority",
"sales"
]
}
Got a Question? Ask us on discord