cURL
curl -X PUT "https://app.cotool.ai/api/agents/:agentId/trigger/:triggerId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","description":"string","source":"slack","allowedUserIds":["string"],"allowedUsergroupIds":["string"],"allowedChannelIds":["string"],"replyScope":"anyone","createAlert":true}'import requests
url = "https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}"
payload = {
"name": "<string>",
"source": "<string>",
"description": "<string>",
"allowedUserIds": ["<string>"],
"allowedUsergroupIds": ["<string>"],
"allowedChannelIds": ["<string>"],
"createAlert": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
source: '<string>',
description: '<string>',
allowedUserIds: ['<string>'],
allowedUsergroupIds: ['<string>'],
allowedChannelIds: ['<string>'],
createAlert: true
})
};
fetch('https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.put("https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"description\": \"<string>\",\n \"allowedUserIds\": [\n \"<string>\"\n ],\n \"allowedUsergroupIds\": [\n \"<string>\"\n ],\n \"allowedChannelIds\": [\n \"<string>\"\n ],\n \"createAlert\": true\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"description\": \"<string>\",\n \"allowedUserIds\": [\n \"<string>\"\n ],\n \"allowedUsergroupIds\": [\n \"<string>\"\n ],\n \"allowedChannelIds\": [\n \"<string>\"\n ],\n \"createAlert\": true\n}")
req, _ := http.NewRequest("PUT", 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",
"name": "<string>",
"enabled": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"config": {},
"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
Update trigger definition
Modify metadata or configuration of an existing trigger.
PUT
/
api
/
agents
/
{agentId}
/
trigger
/
{triggerId}
cURL
curl -X PUT "https://app.cotool.ai/api/agents/:agentId/trigger/:triggerId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","description":"string","source":"slack","allowedUserIds":["string"],"allowedUsergroupIds":["string"],"allowedChannelIds":["string"],"replyScope":"anyone","createAlert":true}'import requests
url = "https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}"
payload = {
"name": "<string>",
"source": "<string>",
"description": "<string>",
"allowedUserIds": ["<string>"],
"allowedUsergroupIds": ["<string>"],
"allowedChannelIds": ["<string>"],
"createAlert": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
source: '<string>',
description: '<string>',
allowedUserIds: ['<string>'],
allowedUsergroupIds: ['<string>'],
allowedChannelIds: ['<string>'],
createAlert: true
})
};
fetch('https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.put("https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"description\": \"<string>\",\n \"allowedUserIds\": [\n \"<string>\"\n ],\n \"allowedUsergroupIds\": [\n \"<string>\"\n ],\n \"allowedChannelIds\": [\n \"<string>\"\n ],\n \"createAlert\": true\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents/{agentId}/trigger/{triggerId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"description\": \"<string>\",\n \"allowedUserIds\": [\n \"<string>\"\n ],\n \"allowedUsergroupIds\": [\n \"<string>\"\n ],\n \"allowedChannelIds\": [\n \"<string>\"\n ],\n \"createAlert\": true\n}")
req, _ := http.NewRequest("PUT", 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",
"name": "<string>",
"enabled": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"config": {},
"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
Unique identifier of the trigger
Body
application/json
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
Allowed value:
"slack"Who may reply in a Slack thread to continue this agent: anyone (any Slack user) or cotool_users (only mapped Cotool users with execute permission)
Available options:
anyone, cotool_users Was this page helpful?
⌘I