Lead Routing
Update a routing rule
Updates a routing rule identified by its ID. Validates activeHours and routingStrategy:
- activeDays: list of 1-7; deduplicated and sorted server-side.
- hoursStart / hoursEnd: each in [0, 23].
- routingStrategy.strategyType must match the business type. LEAD_POND is only allowed for AGENT_LEAD; NEXT_UP and BLAST_ALERT are not allowed for ASSISTANT_LEAD.
- memberWeights must reference valid members in the team.
- touchMinutes must be in (0, 1440]; when > 60, must be an integer multiple of 60.
Caller must have MANAGE_LEAD_DISTRIBUTION or MANAGE_LEAD_DISTRIBUTION_DEPARTMENT permission.
PUT
/
v1.0
/
routing
/
rule
/
{type}
Update a routing rule
curl --request PUT \
--url https://api.lofty.com/v1.0/routing/rule/{type} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"id": 123,
"activeHours": {
"activeDays": [
1,
2,
3,
4,
5
],
"hoursStart": 123,
"hoursEnd": 123
},
"routingStrategy": {
"strategyType": 123,
"groupId": 123,
"groupName": "<string>",
"touchMinutes": 123,
"memberWeights": {
"memberId": 123,
"firstName": "<string>",
"lastName": "<string>",
"weight": 123
}
}
}
'import requests
url = "https://api.lofty.com/v1.0/routing/rule/{type}"
payload = {
"id": 123,
"activeHours": {
"activeDays": [1, 2, 3, 4, 5],
"hoursStart": 123,
"hoursEnd": 123
},
"routingStrategy": {
"strategyType": 123,
"groupId": 123,
"groupName": "<string>",
"touchMinutes": 123,
"memberWeights": {
"memberId": 123,
"firstName": "<string>",
"lastName": "<string>",
"weight": 123
}
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
id: 123,
activeHours: {activeDays: [1, 2, 3, 4, 5], hoursStart: 123, hoursEnd: 123},
routingStrategy: {
strategyType: 123,
groupId: 123,
groupName: '<string>',
touchMinutes: 123,
memberWeights: {memberId: 123, firstName: '<string>', lastName: '<string>', weight: 123}
}
})
};
fetch('https://api.lofty.com/v1.0/routing/rule/{type}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lofty.com/v1.0/routing/rule/{type}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 123,
'activeHours' => [
'activeDays' => [
1,
2,
3,
4,
5
],
'hoursStart' => 123,
'hoursEnd' => 123
],
'routingStrategy' => [
'strategyType' => 123,
'groupId' => 123,
'groupName' => '<string>',
'touchMinutes' => 123,
'memberWeights' => [
'memberId' => 123,
'firstName' => '<string>',
'lastName' => '<string>',
'weight' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lofty.com/v1.0/routing/rule/{type}"
payload := strings.NewReader("{\n \"id\": 123,\n \"activeHours\": {\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"hoursStart\": 123,\n \"hoursEnd\": 123\n },\n \"routingStrategy\": {\n \"strategyType\": 123,\n \"groupId\": 123,\n \"groupName\": \"<string>\",\n \"touchMinutes\": 123,\n \"memberWeights\": {\n \"memberId\": 123,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"weight\": 123\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.lofty.com/v1.0/routing/rule/{type}")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"id\": 123,\n \"activeHours\": {\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"hoursStart\": 123,\n \"hoursEnd\": 123\n },\n \"routingStrategy\": {\n \"strategyType\": 123,\n \"groupId\": 123,\n \"groupName\": \"<string>\",\n \"touchMinutes\": 123,\n \"memberWeights\": {\n \"memberId\": 123,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"weight\": 123\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/routing/rule/{type}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"id\": 123,\n \"activeHours\": {\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"hoursStart\": 123,\n \"hoursEnd\": 123\n },\n \"routingStrategy\": {\n \"strategyType\": 123,\n \"groupId\": 123,\n \"groupName\": \"<string>\",\n \"touchMinutes\": 123,\n \"memberWeights\": {\n \"memberId\": 123,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"weight\": 123\n }\n }\n}"
response = http.request(request)
puts response.read_body"ok""<string>""<string>""<string>"Path Parameters
Routing business type.
Available options:
1, 2, 4 Body
application/json
Response
Rule updated.
The response is of type string.
Example:
"ok"
⌘I
Update a routing rule
curl --request PUT \
--url https://api.lofty.com/v1.0/routing/rule/{type} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"id": 123,
"activeHours": {
"activeDays": [
1,
2,
3,
4,
5
],
"hoursStart": 123,
"hoursEnd": 123
},
"routingStrategy": {
"strategyType": 123,
"groupId": 123,
"groupName": "<string>",
"touchMinutes": 123,
"memberWeights": {
"memberId": 123,
"firstName": "<string>",
"lastName": "<string>",
"weight": 123
}
}
}
'import requests
url = "https://api.lofty.com/v1.0/routing/rule/{type}"
payload = {
"id": 123,
"activeHours": {
"activeDays": [1, 2, 3, 4, 5],
"hoursStart": 123,
"hoursEnd": 123
},
"routingStrategy": {
"strategyType": 123,
"groupId": 123,
"groupName": "<string>",
"touchMinutes": 123,
"memberWeights": {
"memberId": 123,
"firstName": "<string>",
"lastName": "<string>",
"weight": 123
}
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
id: 123,
activeHours: {activeDays: [1, 2, 3, 4, 5], hoursStart: 123, hoursEnd: 123},
routingStrategy: {
strategyType: 123,
groupId: 123,
groupName: '<string>',
touchMinutes: 123,
memberWeights: {memberId: 123, firstName: '<string>', lastName: '<string>', weight: 123}
}
})
};
fetch('https://api.lofty.com/v1.0/routing/rule/{type}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lofty.com/v1.0/routing/rule/{type}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 123,
'activeHours' => [
'activeDays' => [
1,
2,
3,
4,
5
],
'hoursStart' => 123,
'hoursEnd' => 123
],
'routingStrategy' => [
'strategyType' => 123,
'groupId' => 123,
'groupName' => '<string>',
'touchMinutes' => 123,
'memberWeights' => [
'memberId' => 123,
'firstName' => '<string>',
'lastName' => '<string>',
'weight' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lofty.com/v1.0/routing/rule/{type}"
payload := strings.NewReader("{\n \"id\": 123,\n \"activeHours\": {\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"hoursStart\": 123,\n \"hoursEnd\": 123\n },\n \"routingStrategy\": {\n \"strategyType\": 123,\n \"groupId\": 123,\n \"groupName\": \"<string>\",\n \"touchMinutes\": 123,\n \"memberWeights\": {\n \"memberId\": 123,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"weight\": 123\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.lofty.com/v1.0/routing/rule/{type}")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"id\": 123,\n \"activeHours\": {\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"hoursStart\": 123,\n \"hoursEnd\": 123\n },\n \"routingStrategy\": {\n \"strategyType\": 123,\n \"groupId\": 123,\n \"groupName\": \"<string>\",\n \"touchMinutes\": 123,\n \"memberWeights\": {\n \"memberId\": 123,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"weight\": 123\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/routing/rule/{type}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"id\": 123,\n \"activeHours\": {\n \"activeDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"hoursStart\": 123,\n \"hoursEnd\": 123\n },\n \"routingStrategy\": {\n \"strategyType\": 123,\n \"groupId\": 123,\n \"groupName\": \"<string>\",\n \"touchMinutes\": 123,\n \"memberWeights\": {\n \"memberId\": 123,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"weight\": 123\n }\n }\n}"
response = http.request(request)
puts response.read_body"ok""<string>""<string>""<string>"