curl --request PUT \
--url https://backend.trusys.ai/api/external/applications/{applicationId}/monitoring \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"metrics": [
{
"type": "answer-relevance",
"threshold": 0.7
}
],
"plugins": {
"harmful": [
"harmful:hate"
]
},
"securityPurpose": "Customer support chatbot handling account queries",
"securityConfig": {
"purpose": "Customer support chatbot handling account queries",
"hasAccessTo": "Help center knowledge base, customer profile metadata (non-sensitive)",
"userTypes": "Retail customers, customer support agents"
}
}
'import requests
url = "https://backend.trusys.ai/api/external/applications/{applicationId}/monitoring"
payload = {
"metrics": [
{
"type": "answer-relevance",
"threshold": 0.7
}
],
"plugins": { "harmful": ["harmful:hate"] },
"securityPurpose": "Customer support chatbot handling account queries",
"securityConfig": {
"purpose": "Customer support chatbot handling account queries",
"hasAccessTo": "Help center knowledge base, customer profile metadata (non-sensitive)",
"userTypes": "Retail customers, customer support agents"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metrics: [{type: 'answer-relevance', threshold: 0.7}],
plugins: {harmful: ['harmful:hate']},
securityPurpose: 'Customer support chatbot handling account queries',
securityConfig: {
purpose: 'Customer support chatbot handling account queries',
hasAccessTo: 'Help center knowledge base, customer profile metadata (non-sensitive)',
userTypes: 'Retail customers, customer support agents'
}
})
};
fetch('https://backend.trusys.ai/api/external/applications/{applicationId}/monitoring', 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://backend.trusys.ai/api/external/applications/{applicationId}/monitoring",
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([
'metrics' => [
[
'type' => 'answer-relevance',
'threshold' => 0.7
]
],
'plugins' => [
'harmful' => [
'harmful:hate'
]
],
'securityPurpose' => 'Customer support chatbot handling account queries',
'securityConfig' => [
'purpose' => 'Customer support chatbot handling account queries',
'hasAccessTo' => 'Help center knowledge base, customer profile metadata (non-sensitive)',
'userTypes' => 'Retail customers, customer support agents'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://backend.trusys.ai/api/external/applications/{applicationId}/monitoring"
payload := strings.NewReader("{\n \"metrics\": [\n {\n \"type\": \"answer-relevance\",\n \"threshold\": 0.7\n }\n ],\n \"plugins\": {\n \"harmful\": [\n \"harmful:hate\"\n ]\n },\n \"securityPurpose\": \"Customer support chatbot handling account queries\",\n \"securityConfig\": {\n \"purpose\": \"Customer support chatbot handling account queries\",\n \"hasAccessTo\": \"Help center knowledge base, customer profile metadata (non-sensitive)\",\n \"userTypes\": \"Retail customers, customer support agents\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.put("https://backend.trusys.ai/api/external/applications/{applicationId}/monitoring")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"metrics\": [\n {\n \"type\": \"answer-relevance\",\n \"threshold\": 0.7\n }\n ],\n \"plugins\": {\n \"harmful\": [\n \"harmful:hate\"\n ]\n },\n \"securityPurpose\": \"Customer support chatbot handling account queries\",\n \"securityConfig\": {\n \"purpose\": \"Customer support chatbot handling account queries\",\n \"hasAccessTo\": \"Help center knowledge base, customer profile metadata (non-sensitive)\",\n \"userTypes\": \"Retail customers, customer support agents\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.trusys.ai/api/external/applications/{applicationId}/monitoring")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metrics\": [\n {\n \"type\": \"answer-relevance\",\n \"threshold\": 0.7\n }\n ],\n \"plugins\": {\n \"harmful\": [\n \"harmful:hate\"\n ]\n },\n \"securityPurpose\": \"Customer support chatbot handling account queries\",\n \"securityConfig\": {\n \"purpose\": \"Customer support chatbot handling account queries\",\n \"hasAccessTo\": \"Help center knowledge base, customer profile metadata (non-sensitive)\",\n \"userTypes\": \"Retail customers, customer support agents\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"metrics": [
{}
],
"plugins": {},
"securityPurpose": "<string>",
"securityConfig": {
"purpose": "<string>",
"hasAccessTo": "<string>",
"doesNotHaveAccessTo": "<string>",
"userTypes": "<string>",
"securityRequirements": "<string>",
"sensitiveDataTypes": "<string>",
"exampleIdentifiers": "<string>",
"criticalActions": "<string>",
"forbiddenTopics": "<string>",
"competitors": "<string>",
"redteamUser": "<string>"
},
"logLocation": "<string>"
}
}{
"success": false,
"message": "Invalid request body",
"errors": [
{
"path": "name",
"message": "name is required"
}
]
}{
"message": "Error while verifying api key"
}{
"success": false,
"message": "Application not found"
}Configure monitoring
Creates or updates monitoring for an application.
First call — if no monitoring record exists yet, Trusys creates one with default sampling and no metrics or plugins configured.
Subsequent calls — merge updates into the existing configuration; fields you omit are left unchanged.
At least one field must be provided. Configure metrics and/or plugins before calling POST /applications//evaluations — evaluations fail if neither is set.
curl --request PUT \
--url https://backend.trusys.ai/api/external/applications/{applicationId}/monitoring \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"metrics": [
{
"type": "answer-relevance",
"threshold": 0.7
}
],
"plugins": {
"harmful": [
"harmful:hate"
]
},
"securityPurpose": "Customer support chatbot handling account queries",
"securityConfig": {
"purpose": "Customer support chatbot handling account queries",
"hasAccessTo": "Help center knowledge base, customer profile metadata (non-sensitive)",
"userTypes": "Retail customers, customer support agents"
}
}
'import requests
url = "https://backend.trusys.ai/api/external/applications/{applicationId}/monitoring"
payload = {
"metrics": [
{
"type": "answer-relevance",
"threshold": 0.7
}
],
"plugins": { "harmful": ["harmful:hate"] },
"securityPurpose": "Customer support chatbot handling account queries",
"securityConfig": {
"purpose": "Customer support chatbot handling account queries",
"hasAccessTo": "Help center knowledge base, customer profile metadata (non-sensitive)",
"userTypes": "Retail customers, customer support agents"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metrics: [{type: 'answer-relevance', threshold: 0.7}],
plugins: {harmful: ['harmful:hate']},
securityPurpose: 'Customer support chatbot handling account queries',
securityConfig: {
purpose: 'Customer support chatbot handling account queries',
hasAccessTo: 'Help center knowledge base, customer profile metadata (non-sensitive)',
userTypes: 'Retail customers, customer support agents'
}
})
};
fetch('https://backend.trusys.ai/api/external/applications/{applicationId}/monitoring', 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://backend.trusys.ai/api/external/applications/{applicationId}/monitoring",
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([
'metrics' => [
[
'type' => 'answer-relevance',
'threshold' => 0.7
]
],
'plugins' => [
'harmful' => [
'harmful:hate'
]
],
'securityPurpose' => 'Customer support chatbot handling account queries',
'securityConfig' => [
'purpose' => 'Customer support chatbot handling account queries',
'hasAccessTo' => 'Help center knowledge base, customer profile metadata (non-sensitive)',
'userTypes' => 'Retail customers, customer support agents'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://backend.trusys.ai/api/external/applications/{applicationId}/monitoring"
payload := strings.NewReader("{\n \"metrics\": [\n {\n \"type\": \"answer-relevance\",\n \"threshold\": 0.7\n }\n ],\n \"plugins\": {\n \"harmful\": [\n \"harmful:hate\"\n ]\n },\n \"securityPurpose\": \"Customer support chatbot handling account queries\",\n \"securityConfig\": {\n \"purpose\": \"Customer support chatbot handling account queries\",\n \"hasAccessTo\": \"Help center knowledge base, customer profile metadata (non-sensitive)\",\n \"userTypes\": \"Retail customers, customer support agents\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.put("https://backend.trusys.ai/api/external/applications/{applicationId}/monitoring")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"metrics\": [\n {\n \"type\": \"answer-relevance\",\n \"threshold\": 0.7\n }\n ],\n \"plugins\": {\n \"harmful\": [\n \"harmful:hate\"\n ]\n },\n \"securityPurpose\": \"Customer support chatbot handling account queries\",\n \"securityConfig\": {\n \"purpose\": \"Customer support chatbot handling account queries\",\n \"hasAccessTo\": \"Help center knowledge base, customer profile metadata (non-sensitive)\",\n \"userTypes\": \"Retail customers, customer support agents\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.trusys.ai/api/external/applications/{applicationId}/monitoring")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metrics\": [\n {\n \"type\": \"answer-relevance\",\n \"threshold\": 0.7\n }\n ],\n \"plugins\": {\n \"harmful\": [\n \"harmful:hate\"\n ]\n },\n \"securityPurpose\": \"Customer support chatbot handling account queries\",\n \"securityConfig\": {\n \"purpose\": \"Customer support chatbot handling account queries\",\n \"hasAccessTo\": \"Help center knowledge base, customer profile metadata (non-sensitive)\",\n \"userTypes\": \"Retail customers, customer support agents\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"metrics": [
{}
],
"plugins": {},
"securityPurpose": "<string>",
"securityConfig": {
"purpose": "<string>",
"hasAccessTo": "<string>",
"doesNotHaveAccessTo": "<string>",
"userTypes": "<string>",
"securityRequirements": "<string>",
"sensitiveDataTypes": "<string>",
"exampleIdentifiers": "<string>",
"criticalActions": "<string>",
"forbiddenTopics": "<string>",
"competitors": "<string>",
"redteamUser": "<string>"
},
"logLocation": "<string>"
}
}{
"success": false,
"message": "Invalid request body",
"errors": [
{
"path": "name",
"message": "name is required"
}
]
}{
"message": "Error while verifying api key"
}{
"success": false,
"message": "Application not found"
}Authorizations
Your Trusys API key. Create and manage keys in the Trusys UI under Settings → API Keys.
Include the key on every request:
x-api-key: <your-api-key>Path Parameters
Unique identifier (UUID) of the application. Returned by POST /applications.
Body
Monitoring settings. Metric type values come from GET /metrics/eval; plugin IDs from GET /metrics/security.
Monitoring configuration update. At least one field is required.
Quality evaluation metrics to run. Each item is a metric object; include type from the eval catalog and any metric-specific options (for example threshold).
Security plugins grouped by risk category. Values are arrays of plugin IDs (for example harmful:hate).
Show child attributes
Show child attributes
Shorthand for securityConfig.purpose. Prefer securityConfig when setting multiple security context fields. If both are provided, securityPurpose sets purpose after securityConfig is applied.
Application security context used to tailor adversarial security testing. All fields are optional on update; omitted keys are left unchanged. Provide purpose (or top-level securityPurpose) to describe what the AI application does.
Show child attributes
Show child attributes