curl --request POST \
--url https://api.zeroruntime.ai/v2/sip/routing-rule \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Support inbound",
"type": "inbound",
"phoneNumbers": [
"+14155550100"
],
"agentId": "ag_7f2c91",
"agentMetadata": {
"queue": "billing"
},
"room": {
"type": "dynamic",
"prefix": "sipNumber"
},
"includeHeaders": "SIP_X_HEADERS",
"headersToAttributes": {
"X-Customer-Id": "customerId"
},
"allowedNumbers": [],
"allowedIpAddresses": [],
"tags": [
"support"
],
"recording": false,
"dtmf": false,
"noiseCancellation": false,
"hidePhoneNumber": false
}
'{
"id": "rr_8k2m1x",
"type": "inbound",
"numbers": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"phoneNumbers": [
"<string>"
],
"apiKey": "<string>",
"agentId": "<string>",
"agentMetadata": {},
"room": {
"type": "dynamic",
"prefix": "blank"
},
"includeHeaders": "NONE",
"headers": {},
"headersToAttributes": {},
"allowedNumbers": [
"<string>"
],
"allowedIpAddresses": [
"<string>"
],
"tags": [
"<string>"
],
"recording": false,
"dtmf": false,
"noiseCancellation": false,
"hidePhoneNumber": false
}{
"message": "<string>"
}Create routing rule
Creates a routing rule and attaches it to the numbers in phoneNumbers. Only name and type are required.
curl --request POST \
--url https://api.zeroruntime.ai/v2/sip/routing-rule \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Support inbound",
"type": "inbound",
"phoneNumbers": [
"+14155550100"
],
"agentId": "ag_7f2c91",
"agentMetadata": {
"queue": "billing"
},
"room": {
"type": "dynamic",
"prefix": "sipNumber"
},
"includeHeaders": "SIP_X_HEADERS",
"headersToAttributes": {
"X-Customer-Id": "customerId"
},
"allowedNumbers": [],
"allowedIpAddresses": [],
"tags": [
"support"
],
"recording": false,
"dtmf": false,
"noiseCancellation": false,
"hidePhoneNumber": false
}
'{
"id": "rr_8k2m1x",
"type": "inbound",
"numbers": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"phoneNumbers": [
"<string>"
],
"apiKey": "<string>",
"agentId": "<string>",
"agentMetadata": {},
"room": {
"type": "dynamic",
"prefix": "blank"
},
"includeHeaders": "NONE",
"headers": {},
"headersToAttributes": {},
"allowedNumbers": [
"<string>"
],
"allowedIpAddresses": [
"<string>"
],
"tags": [
"<string>"
],
"recording": false,
"dtmf": false,
"noiseCancellation": false,
"hidePhoneNumber": false
}{
"message": "<string>"
}Authorizations
Your API token, sent raw (no Bearer prefix).
Body
Fixed for the life of the rule.
inbound, outbound E.164 numbers already on your account. Leave it out to attach numbers later.
Optional. On create, leave it out to use the API key of the token you call with.
Agent to dispatch. Omit to dispatch none.
Flat string map handed to the agent.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
ALL, SIP_X_HEADERS, NONE Outbound only. Extra SIP headers to send.
Show child attributes
Show child attributes
Inbound only. Maps an incoming header onto a call attribute.
Show child attributes
Show child attributes
Empty means no restriction.
Empty means no restriction.
Response
The created rule.
"rr_8k2m1x"
inbound, outbound E.164 numbers already on your account. Leave it out to attach numbers later.
Optional. On create, leave it out to use the API key of the token you call with.
Agent to dispatch. Omit to dispatch none.
Flat string map handed to the agent.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
ALL, SIP_X_HEADERS, NONE Outbound only. Extra SIP headers to send.
Show child attributes
Show child attributes
Inbound only. Maps an incoming header onto a call attribute.
Show child attributes
Show child attributes
Empty means no restriction.
Empty means no restriction.