Create a policy rule
curl --request POST \
--url https://api.tuteliq.ai/api/v1/policy/automation/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"enabled": true,
"endpoints": [
"<string>"
],
"conditions": {
"min_risk_score": 0.5,
"categories": [
"<string>"
],
"age_groups": [
"<string>"
]
},
"action": {
"escalate_to": "<string>",
"notify_channel": "<string>",
"message": "<string>",
"override_severity": "<string>"
},
"priority": 1
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
enabled: true,
endpoints: ['<string>'],
conditions: {min_risk_score: 0.5, categories: ['<string>'], age_groups: ['<string>']},
action: {
escalate_to: '<string>',
notify_channel: '<string>',
message: '<string>',
override_severity: '<string>'
},
priority: 1
})
};
fetch('https://api.tuteliq.ai/api/v1/policy/automation/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tuteliq.ai/api/v1/policy/automation/"
payload = {
"name": "<string>",
"enabled": True,
"endpoints": ["<string>"],
"conditions": {
"min_risk_score": 0.5,
"categories": ["<string>"],
"age_groups": ["<string>"]
},
"action": {
"escalate_to": "<string>",
"notify_channel": "<string>",
"message": "<string>",
"override_severity": "<string>"
},
"priority": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"endpoints\": [\n \"<string>\"\n ],\n \"conditions\": {\n \"min_risk_score\": 0.5,\n \"categories\": [\n \"<string>\"\n ],\n \"age_groups\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"escalate_to\": \"<string>\",\n \"notify_channel\": \"<string>\",\n \"message\": \"<string>\",\n \"override_severity\": \"<string>\"\n },\n \"priority\": 1\n}")
val request = Request.Builder()
.url("https://api.tuteliq.ai/api/v1/policy/automation/")
.post(body)
.addHeader("Authorization", "Bearer <token>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()import Foundation
let parameters = [
"name": "<string>",
"enabled": true,
"endpoints": ["<string>"],
"conditions": [
"min_risk_score": 0.5,
"categories": ["<string>"],
"age_groups": ["<string>"]
],
"action": [
"escalate_to": "<string>",
"notify_channel": "<string>",
"message": "<string>",
"override_severity": "<string>"
],
"priority": 1
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.tuteliq.ai/api/v1/policy/automation/")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.tuteliq.ai/api/v1/policy/automation/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"endpoints\": [\n \"<string>\"\n ],\n \"conditions\": {\n \"min_risk_score\": 0.5,\n \"categories\": [\n \"<string>\"\n ],\n \"age_groups\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"escalate_to\": \"<string>\",\n \"notify_channel\": \"<string>\",\n \"message\": \"<string>\",\n \"override_severity\": \"<string>\"\n },\n \"priority\": 1\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"success": true,
"rule": {
"id": "<string>",
"name": "<string>",
"enabled": true,
"endpoints": [
"<string>"
],
"conditions": {
"min_risk_score": 0.5,
"categories": [
"<string>"
],
"age_groups": [
"<string>"
]
},
"action": {
"escalate_to": "<string>",
"notify_channel": "<string>",
"message": "<string>",
"override_severity": "<string>"
},
"priority": 123,
"created_at": "<string>",
"updated_at": "<string>"
}
}Create a policy rule
Create a new declarative policy rule. Rules are evaluated during detection and the highest-priority matching rule determines the policy_action in the response.
POST
/
api
/
v1
/
policy
/
automation
/
Create a policy rule
curl --request POST \
--url https://api.tuteliq.ai/api/v1/policy/automation/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"enabled": true,
"endpoints": [
"<string>"
],
"conditions": {
"min_risk_score": 0.5,
"categories": [
"<string>"
],
"age_groups": [
"<string>"
]
},
"action": {
"escalate_to": "<string>",
"notify_channel": "<string>",
"message": "<string>",
"override_severity": "<string>"
},
"priority": 1
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
enabled: true,
endpoints: ['<string>'],
conditions: {min_risk_score: 0.5, categories: ['<string>'], age_groups: ['<string>']},
action: {
escalate_to: '<string>',
notify_channel: '<string>',
message: '<string>',
override_severity: '<string>'
},
priority: 1
})
};
fetch('https://api.tuteliq.ai/api/v1/policy/automation/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tuteliq.ai/api/v1/policy/automation/"
payload = {
"name": "<string>",
"enabled": True,
"endpoints": ["<string>"],
"conditions": {
"min_risk_score": 0.5,
"categories": ["<string>"],
"age_groups": ["<string>"]
},
"action": {
"escalate_to": "<string>",
"notify_channel": "<string>",
"message": "<string>",
"override_severity": "<string>"
},
"priority": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"endpoints\": [\n \"<string>\"\n ],\n \"conditions\": {\n \"min_risk_score\": 0.5,\n \"categories\": [\n \"<string>\"\n ],\n \"age_groups\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"escalate_to\": \"<string>\",\n \"notify_channel\": \"<string>\",\n \"message\": \"<string>\",\n \"override_severity\": \"<string>\"\n },\n \"priority\": 1\n}")
val request = Request.Builder()
.url("https://api.tuteliq.ai/api/v1/policy/automation/")
.post(body)
.addHeader("Authorization", "Bearer <token>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()import Foundation
let parameters = [
"name": "<string>",
"enabled": true,
"endpoints": ["<string>"],
"conditions": [
"min_risk_score": 0.5,
"categories": ["<string>"],
"age_groups": ["<string>"]
],
"action": [
"escalate_to": "<string>",
"notify_channel": "<string>",
"message": "<string>",
"override_severity": "<string>"
],
"priority": 1
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.tuteliq.ai/api/v1/policy/automation/")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.tuteliq.ai/api/v1/policy/automation/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"endpoints\": [\n \"<string>\"\n ],\n \"conditions\": {\n \"min_risk_score\": 0.5,\n \"categories\": [\n \"<string>\"\n ],\n \"age_groups\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"escalate_to\": \"<string>\",\n \"notify_channel\": \"<string>\",\n \"message\": \"<string>\",\n \"override_severity\": \"<string>\"\n },\n \"priority\": 1\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"success": true,
"rule": {
"id": "<string>",
"name": "<string>",
"enabled": true,
"endpoints": [
"<string>"
],
"conditions": {
"min_risk_score": 0.5,
"categories": [
"<string>"
],
"age_groups": [
"<string>"
]
},
"action": {
"escalate_to": "<string>",
"notify_channel": "<string>",
"message": "<string>",
"override_severity": "<string>"
},
"priority": 123,
"created_at": "<string>",
"updated_at": "<string>"
}
}Authorizations
bearerAuthapiKeyHeader
API key as Bearer token
Body
application/json
⌘I