cURL
curl -X PATCH "https://app.cotool.ai/api/agents/:agentId/trigger/:triggerId/event-mode" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"eventMode":"direct"}'import requests
url = "https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}/event-mode"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}/event-mode', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}/event-mode")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}/event-mode"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"success": true,
"eventMode": "direct"
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>"
}Agent Triggers
Update trigger event mode
Set whether a trigger creates an alert before running the agent or runs the agent directly.
PATCH
/
api
/
agents
/
{agentId}
/
trigger
/
{triggerId}
/
event-mode
cURL
curl -X PATCH "https://app.cotool.ai/api/agents/:agentId/trigger/:triggerId/event-mode" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"eventMode":"direct"}'import requests
url = "https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}/event-mode"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}/event-mode', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}/event-mode")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}/event-mode"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"success": true,
"eventMode": "direct"
}{
"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
Unique identifier of the agent
Unique identifier of the trigger
Body
application/json
Request body for updating whether a trigger creates alerts
Run the agent directly or create an alert before running it
Available options:
direct, alert_source Was this page helpful?
⌘I