cURL
curl -X POST "https://app.cotool.ai/api/agents/:agentId/trigger/save" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"triggerId":"string","name":"string","description":"string","secret":"string","webhookUrl":"string","source":"jira","eventMode":"direct","createAlert":true}'import requests
url = "https://app.cotool.ai/api/agents/{agentId}/trigger/save"
payload = {
"triggerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"secret": "<string>",
"webhookUrl": "<string>",
"source": "jira",
"description": "<string>",
"createAlert": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
triggerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
secret: '<string>',
webhookUrl: '<string>',
source: 'jira',
description: '<string>',
createAlert: true
})
};
fetch('https://app.cotool.ai/api/agents/{agentId}/trigger/save', 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/agents/{agentId}/trigger/save")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"triggerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"secret\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"source\": \"jira\",\n \"description\": \"<string>\",\n \"createAlert\": true\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents/{agentId}/trigger/save"
payload := strings.NewReader("{\n \"triggerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"secret\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"source\": \"jira\",\n \"description\": \"<string>\",\n \"createAlert\": true\n}")
req, _ := http.NewRequest("POST", 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,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "jira",
"name": "<string>",
"enabled": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"config": {},
"eventMode": "direct",
"description": "<string>",
"secret": "<string>",
"cronSchedule": "<string>",
"emailAddress": "<string>",
"lastRunAttemptedAt": "<string>",
"lastRunSucceededAt": "<string>",
"alertCreatedNotificationDestinationIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Agent Triggers
Save trigger definition
Create and save a new trigger definition for Jira, Jira Automation, Slack, Linear, Cron, generic Webhook, HackerOne, Bugcrowd, Zscaler, Darktrace, or SEON sources.
POST
/
api
/
agents
/
{agentId}
/
trigger
/
save
cURL
curl -X POST "https://app.cotool.ai/api/agents/:agentId/trigger/save" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"triggerId":"string","name":"string","description":"string","secret":"string","webhookUrl":"string","source":"jira","eventMode":"direct","createAlert":true}'import requests
url = "https://app.cotool.ai/api/agents/{agentId}/trigger/save"
payload = {
"triggerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"secret": "<string>",
"webhookUrl": "<string>",
"source": "jira",
"description": "<string>",
"createAlert": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
triggerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
secret: '<string>',
webhookUrl: '<string>',
source: 'jira',
description: '<string>',
createAlert: true
})
};
fetch('https://app.cotool.ai/api/agents/{agentId}/trigger/save', 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/agents/{agentId}/trigger/save")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"triggerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"secret\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"source\": \"jira\",\n \"description\": \"<string>\",\n \"createAlert\": true\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents/{agentId}/trigger/save"
payload := strings.NewReader("{\n \"triggerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"secret\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"source\": \"jira\",\n \"description\": \"<string>\",\n \"createAlert\": true\n}")
req, _ := http.NewRequest("POST", 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,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "jira",
"name": "<string>",
"enabled": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"config": {},
"eventMode": "direct",
"description": "<string>",
"secret": "<string>",
"cronSchedule": "<string>",
"emailAddress": "<string>",
"lastRunAttemptedAt": "<string>",
"lastRunSucceededAt": "<string>",
"alertCreatedNotificationDestinationIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Body
application/json
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
Request body for creating a new trigger, with different fields required based on the source type
Was this page helpful?
⌘I