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>"
}
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>"
}Agent Triggers
Save trigger definition
Create and save a new trigger definition for Jira, Jira Automation, Slack, Linear, Cron, generic Webhook, or HackerOne 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>"
}
}{
"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
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
Request body for creating a new trigger, with different fields required based on the source type
Unique identifier for the trigger
Display name for the trigger
Secret for webhook authentication
Webhook URL for Jira to call
Allowed value:
"jira"Optional description of what this trigger does
Run the agent directly or create an alert before running it
Available options:
direct, alert_source Deprecated compatibility alias for eventMode
Was this page helpful?
⌘I