Skip to main content
Version: /v2

Update Routing Rule - API

Partial update of a routing rule. All fields are optional, but at least one editable field must be present in the body (otherwise returns 400 No editable fields provided).

Updating phoneNumbers detaches removed numbers and attaches added numbers; inbound conflicts are checked the same way as create.

Non-editable: type (creation-time only).

Header field gating — the existing rule's type controls which header field is allowed:

  • headers → outbound rules only.
  • headersToAttributes → inbound rules only.

Responses:

  • 200 success — returns the updated routing rule.
  • 400 validation failure (missing editable fields, invalid includeHeaders, phone numbers not found, inbound conflict, wrong header field for rule type).
  • 404 routing rule not found.
  • 500 internal server error.

HTTP method and endpoint

PATCH

|

https://api.videosdk.live/v2/sip/routing-rule/: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

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
New name for the routing rule.
OPTIONAL
Replacement set of e164 numbers attached to this rule. Removed numbers are detached; added numbers are attached (and inbound conflicts are checked).
OPTIONAL
Agent ID to dispatch calls to.
Metadata forwarded to the agent.
OPTIONAL
Room dispatch config — { type, prefix, id, pin }.
Which SIP headers are surfaced. One of ALL, SIP_X_HEADERS, NONE.
Inbound rules only. Map of incoming SIP header → participant attribute. Returns 400 on outbound rules.
OPTIONAL
Outbound rules only. Custom SIP headers attached to outgoing INVITEs. Returns 400 on inbound rules.
Allowlist of caller numbers. Empty array means no restriction.
Allowlist of caller IPs. Empty array means no restriction.
OPTIONAL
Replacement tag array.
OPTIONAL
Whether calls should be recorded.
OPTIONAL
Whether DTMF events are captured.
Whether noise cancellation is enabled.
If true, the caller's number is hidden when dispatching.
Response Parameters
Unique identifier of the routing rule.
Updated name.
Rule direction — inbound or outbound (unchanged; creation-time only).
Phone numbers attached to this rule after the update.
Room dispatch object — { type, prefix, id, pin }.
ID of the dispatched agent, or null.
Metadata forwarded to the agent.
Resolved API key.
Which SIP headers are surfaced — ALL, SIP_X_HEADERS, NONE.
Inbound rules only — SIP header → attribute map.
Outbound rules only — custom SIP headers attached to outgoing INVITEs.
Allowlist of caller numbers.
Allowlist of caller IP addresses.
Tags applied to the rule.
Whether calls are recorded.
Whether DTMF events are captured.
Whether noise cancellation is enabled.
Whether the caller's number is hidden when dispatching.
Creation timestamp (ISO 8601).
Last-update timestamp (ISO 8601).
PATCH
|
https://api.videosdk.live/v2/sip/routing-rule/:ruleId
import fetch from 'node-fetch';
const options = {
method: "PATCH",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Renamed rule",
"phoneNumbers": [
"+14155551234",
"+14155555678"
],
"agentId": "$YOUR_AGENT_ID",
"agentMetadata": {
"team": "support",
"tier": "gold"
},
"room": {
"type": "dynamic",
"prefix": "blank"
},
"includeHeaders": "ALL",
"headersToAttributes": {},
"headers": {
"X-Customer-Id": "cust_42"
},
"allowedNumbers": [],
"allowedIpAddresses": [],
"tags": [
"support"
],
"recording": true,
"dtmf": false,
"noiseCancellation": true,
"hidePhoneNumber": true
}),
};
const url= `https://api.videosdk.live/v2/sip/routing-rule/:ruleId`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"id": "rr_abc123",
"name": "Renamed rule",
"type": "inbound",
"numbers": [
"+14155551234",
"+14155555678"
],
"room": {
"type": "dynamic",
"prefix": "blank",
"id": null,
"pin": null
},
"agentId": "agent_xyz",
"agentMetadata": {
"team": "support",
"tier": "gold"
},
"hidePhoneNumber": true,
"tags": [
"support"
],
"apiKey": "ak_resolved",
"recording": true,
"dtmf": false,
"noiseCancellation": true,
"allowedNumbers": [],
"allowedIpAddresses": [],
"includeHeaders": "ALL",
"headersToAttributes": {},
"createdAt": "2026-05-11T10:00:00.000Z",
"updatedAt": "2026-05-11T10:05:00.000Z"
}

Got a Question? Ask us on discord