cURL
curl -X POST "https://app.cotool.ai/api/detection-rules/proposals/:id/test-query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"import requests
url = "https://app.cotool.ai/api/detection-rules/proposals/{id}/test-query"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cotool.ai/api/detection-rules/proposals/{id}/test-query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://app.cotool.ai/api/detection-rules/proposals/{id}/test-query")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/detection-rules/proposals/{id}/test-query"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"rows": 123,
"executionTimeMs": 123,
"results": [
{}
],
"bytesScanned": 123,
"error": "<string>",
"datadogRulePreview": {
"validation": {
"valid": true,
"error": "<string>"
},
"historicalPreview": {
"lookbackHours": 2,
"estimatedSignals": 1,
"windowsEvaluated": 1,
"windowsTriggered": 1,
"severityBreakdown": {},
"topGroups": [
{
"group": {},
"estimatedSignals": 1
}
],
"notes": [
"<string>"
]
}
},
"bestEstimate": {
"count": 1,
"timeRangeHours": 2,
"source": "<string>"
}
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>"
}Detection Rules
Test a detection query
Execute a detection query and return sample results. Uses limited time range and row count.
POST
/
api
/
detection-rules
/
proposals
/
{id}
/
test-query
cURL
curl -X POST "https://app.cotool.ai/api/detection-rules/proposals/:id/test-query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"import requests
url = "https://app.cotool.ai/api/detection-rules/proposals/{id}/test-query"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cotool.ai/api/detection-rules/proposals/{id}/test-query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://app.cotool.ai/api/detection-rules/proposals/{id}/test-query")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/detection-rules/proposals/{id}/test-query"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"rows": 123,
"executionTimeMs": 123,
"results": [
{}
],
"bytesScanned": 123,
"error": "<string>",
"datadogRulePreview": {
"validation": {
"valid": true,
"error": "<string>"
},
"historicalPreview": {
"lookbackHours": 2,
"estimatedSignals": 1,
"windowsEvaluated": 1,
"windowsTriggered": 1,
"severityBreakdown": {},
"topGroups": [
{
"group": {},
"estimatedSignals": 1
}
],
"notes": [
"<string>"
]
}
},
"bestEstimate": {
"count": 1,
"timeRangeHours": 2,
"source": "<string>"
}
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>"
}Authorizations
API Key authentication for programmatic access. Include your API key in the Authorization header as: Bearer your_api_key_here
Path Parameters
Response
Successful response
Total matching rows in the test time window (may exceed returned sample size)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Single best platform-specific estimate used to display hits/hr
Show child attributes
Show child attributes
Was this page helpful?
⌘I