Update priorities
curl --request PATCH \
--url https://sla.thena.ai/v1/sla/priorities \
--header 'Content-Type: application/json' \
--data '
{
"teamId": "team-123456",
"entityType": "ticket",
"priorityUpdates": [
{
"id": "policy-123",
"priority": 1
},
{
"id": "policy-456",
"priority": 2
}
]
}
'import requests
url = "https://sla.thena.ai/v1/sla/priorities"
payload = {
"teamId": "team-123456",
"entityType": "ticket",
"priorityUpdates": [
{
"id": "policy-123",
"priority": 1
},
{
"id": "policy-456",
"priority": 2
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
teamId: 'team-123456',
entityType: 'ticket',
priorityUpdates: [{id: 'policy-123', priority: 1}, {id: 'policy-456', priority: 2}]
})
};
fetch('https://sla.thena.ai/v1/sla/priorities', 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://sla.thena.ai/v1/sla/priorities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'teamId' => 'team-123456',
'entityType' => 'ticket',
'priorityUpdates' => [
[
'id' => 'policy-123',
'priority' => 1
],
[
'id' => 'policy-456',
'priority' => 2
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://sla.thena.ai/v1/sla/priorities"
payload := strings.NewReader("{\n \"teamId\": \"team-123456\",\n \"entityType\": \"ticket\",\n \"priorityUpdates\": [\n {\n \"id\": \"policy-123\",\n \"priority\": 1\n },\n {\n \"id\": \"policy-456\",\n \"priority\": 2\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://sla.thena.ai/v1/sla/priorities")
.header("Content-Type", "application/json")
.body("{\n \"teamId\": \"team-123456\",\n \"entityType\": \"ticket\",\n \"priorityUpdates\": [\n {\n \"id\": \"policy-123\",\n \"priority\": 1\n },\n {\n \"id\": \"policy-456\",\n \"priority\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sla.thena.ai/v1/sla/priorities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"teamId\": \"team-123456\",\n \"entityType\": \"ticket\",\n \"priorityUpdates\": [\n {\n \"id\": \"policy-123\",\n \"priority\": 1\n },\n {\n \"id\": \"policy-456\",\n \"priority\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"name": "High Priority Ticket SLA",
"description": "SLA policy for handling high priority tickets",
"entityType": "ticket",
"filter": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"policyMetrics": [
{
"metric": "FIRST_RESPONSE_TIME",
"default": true,
"durationInMinutes": "120",
"specific": [
{
"entity": "ticket",
"field": "priority",
"operator": "equals",
"values": [
{
"label": "High Priority"
}
],
"durationInMinutes": "60"
}
]
}
],
"pauseConditions": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"teamId": "<string>",
"organizationId": "<string>",
"version": 123,
"priority": 123,
"isActive": true,
"uid": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]SLA Policies
Update priorities
PATCH
/
v1
/
sla
/
priorities
Update priorities
curl --request PATCH \
--url https://sla.thena.ai/v1/sla/priorities \
--header 'Content-Type: application/json' \
--data '
{
"teamId": "team-123456",
"entityType": "ticket",
"priorityUpdates": [
{
"id": "policy-123",
"priority": 1
},
{
"id": "policy-456",
"priority": 2
}
]
}
'import requests
url = "https://sla.thena.ai/v1/sla/priorities"
payload = {
"teamId": "team-123456",
"entityType": "ticket",
"priorityUpdates": [
{
"id": "policy-123",
"priority": 1
},
{
"id": "policy-456",
"priority": 2
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
teamId: 'team-123456',
entityType: 'ticket',
priorityUpdates: [{id: 'policy-123', priority: 1}, {id: 'policy-456', priority: 2}]
})
};
fetch('https://sla.thena.ai/v1/sla/priorities', 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://sla.thena.ai/v1/sla/priorities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'teamId' => 'team-123456',
'entityType' => 'ticket',
'priorityUpdates' => [
[
'id' => 'policy-123',
'priority' => 1
],
[
'id' => 'policy-456',
'priority' => 2
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://sla.thena.ai/v1/sla/priorities"
payload := strings.NewReader("{\n \"teamId\": \"team-123456\",\n \"entityType\": \"ticket\",\n \"priorityUpdates\": [\n {\n \"id\": \"policy-123\",\n \"priority\": 1\n },\n {\n \"id\": \"policy-456\",\n \"priority\": 2\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://sla.thena.ai/v1/sla/priorities")
.header("Content-Type", "application/json")
.body("{\n \"teamId\": \"team-123456\",\n \"entityType\": \"ticket\",\n \"priorityUpdates\": [\n {\n \"id\": \"policy-123\",\n \"priority\": 1\n },\n {\n \"id\": \"policy-456\",\n \"priority\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sla.thena.ai/v1/sla/priorities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"teamId\": \"team-123456\",\n \"entityType\": \"ticket\",\n \"priorityUpdates\": [\n {\n \"id\": \"policy-123\",\n \"priority\": 1\n },\n {\n \"id\": \"policy-456\",\n \"priority\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"name": "High Priority Ticket SLA",
"description": "SLA policy for handling high priority tickets",
"entityType": "ticket",
"filter": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"policyMetrics": [
{
"metric": "FIRST_RESPONSE_TIME",
"default": true,
"durationInMinutes": "120",
"specific": [
{
"entity": "ticket",
"field": "priority",
"operator": "equals",
"values": [
{
"label": "High Priority"
}
],
"durationInMinutes": "60"
}
]
}
],
"pauseConditions": {
"all": [
{
"entity": "ticket",
"field": "status",
"operator": "equals",
"values": [
{
"label": "Open"
}
]
}
],
"any": [
{
"entity": "ticket",
"field": "priority",
"operator": "in",
"values": [
{
"label": "High Priority"
},
{
"label": "Medium Priority"
}
]
}
]
},
"teamId": "<string>",
"organizationId": "<string>",
"version": 123,
"priority": 123,
"isActive": true,
"uid": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]Body
application/json
The unique identifier of the team
Example:
"team-123456"
The type of the entity
Example:
"ticket"
The priority updates for policies
Show child attributes
Show child attributes
Example:
[ { "id": "policy-123", "priority": 1 }, { "id": "policy-456", "priority": 2 } ]
Response
Operation successful
The name of the policy
Example:
"High Priority Ticket SLA"
The description of the policy
Example:
"SLA policy for handling high priority tickets"
The type of the entity
Example:
"ticket"
The filter of the policy
Show child attributes
Show child attributes
The metrics of the policy
Show child attributes
Show child attributes
The pause conditions of the policy
Show child attributes
Show child attributes
The unique identifier of the team
The unique identifier of the organization
The version number of the policy
The priority of the policy
Whether the policy is active
The unique identifier string of the policy
The creation timestamp of the policy
The last update timestamp of the policy
⌘I