Create Slack Channel Trigger
curl --request POST \
--url https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"trigger_type": "slack_channel_message",
"channel_id": "<string>",
"channel_name": "<string>",
"match_rule": {
"kind": "all"
},
"slack_team_id": "<string>",
"is_private": true,
"integration_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers"
payload = {
"trigger_type": "slack_channel_message",
"channel_id": "<string>",
"channel_name": "<string>",
"match_rule": { "kind": "all" },
"slack_team_id": "<string>",
"is_private": True,
"integration_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
trigger_type: 'slack_channel_message',
channel_id: '<string>',
channel_name: '<string>',
match_rule: {kind: 'all'},
slack_team_id: '<string>',
is_private: true,
integration_instance_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'trigger_type' => 'slack_channel_message',
'channel_id' => '<string>',
'channel_name' => '<string>',
'match_rule' => [
'kind' => 'all'
],
'slack_team_id' => '<string>',
'is_private' => true,
'integration_instance_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers"
payload := strings.NewReader("{\n \"trigger_type\": \"slack_channel_message\",\n \"channel_id\": \"<string>\",\n \"channel_name\": \"<string>\",\n \"match_rule\": {\n \"kind\": \"all\"\n },\n \"slack_team_id\": \"<string>\",\n \"is_private\": true,\n \"integration_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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))
}HttpResponse<String> response = Unirest.post("https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"trigger_type\": \"slack_channel_message\",\n \"channel_id\": \"<string>\",\n \"channel_name\": \"<string>\",\n \"match_rule\": {\n \"kind\": \"all\"\n },\n \"slack_team_id\": \"<string>\",\n \"is_private\": true,\n \"integration_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"trigger_type\": \"slack_channel_message\",\n \"channel_id\": \"<string>\",\n \"channel_name\": \"<string>\",\n \"match_rule\": {\n \"kind\": \"all\"\n },\n \"slack_team_id\": \"<string>\",\n \"is_private\": true,\n \"integration_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"slack_trigger": {
"id": "<string>",
"agent_id": "<string>",
"user_id": "<string>",
"integration_slug": "<string>",
"trigger_type": "<string>",
"filter_config": {},
"integration_instance_id": "<string>",
"enabled": true,
"auto_disabled_at": "<string>",
"auto_disabled_reason": "<string>",
"consecutive_missing_connection_failures": 4503599627370495,
"first_missing_connection_failure_at": "<string>",
"last_missing_connection_failure_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"shared_with_automation": true,
"pending_change": {
"automation_revision_id": "<string>",
"enabled": true,
"filter_config": {}
}
}
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}Triggers
Create Slack Channel Trigger
Create a Slack channel trigger on an agent (Agent in the Duvo UI): the agent starts a Run whenever a matching message is posted in the channel. An agent can carry one trigger per channel, so call this once per channel. The Slack workspace must be installed for the team AND bound to the agent’s live build first (see the Slack bound-workspaces endpoint) — otherwise this returns 400.
POST
/
v2
/
agents
/
{agent_id}
/
slack-triggers
Create Slack Channel Trigger
curl --request POST \
--url https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"trigger_type": "slack_channel_message",
"channel_id": "<string>",
"channel_name": "<string>",
"match_rule": {
"kind": "all"
},
"slack_team_id": "<string>",
"is_private": true,
"integration_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers"
payload = {
"trigger_type": "slack_channel_message",
"channel_id": "<string>",
"channel_name": "<string>",
"match_rule": { "kind": "all" },
"slack_team_id": "<string>",
"is_private": True,
"integration_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
trigger_type: 'slack_channel_message',
channel_id: '<string>',
channel_name: '<string>',
match_rule: {kind: 'all'},
slack_team_id: '<string>',
is_private: true,
integration_instance_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'trigger_type' => 'slack_channel_message',
'channel_id' => '<string>',
'channel_name' => '<string>',
'match_rule' => [
'kind' => 'all'
],
'slack_team_id' => '<string>',
'is_private' => true,
'integration_instance_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers"
payload := strings.NewReader("{\n \"trigger_type\": \"slack_channel_message\",\n \"channel_id\": \"<string>\",\n \"channel_name\": \"<string>\",\n \"match_rule\": {\n \"kind\": \"all\"\n },\n \"slack_team_id\": \"<string>\",\n \"is_private\": true,\n \"integration_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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))
}HttpResponse<String> response = Unirest.post("https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"trigger_type\": \"slack_channel_message\",\n \"channel_id\": \"<string>\",\n \"channel_name\": \"<string>\",\n \"match_rule\": {\n \"kind\": \"all\"\n },\n \"slack_team_id\": \"<string>\",\n \"is_private\": true,\n \"integration_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.duvo.ai/v2/agents/{agent_id}/slack-triggers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"trigger_type\": \"slack_channel_message\",\n \"channel_id\": \"<string>\",\n \"channel_name\": \"<string>\",\n \"match_rule\": {\n \"kind\": \"all\"\n },\n \"slack_team_id\": \"<string>\",\n \"is_private\": true,\n \"integration_instance_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"slack_trigger": {
"id": "<string>",
"agent_id": "<string>",
"user_id": "<string>",
"integration_slug": "<string>",
"trigger_type": "<string>",
"filter_config": {},
"integration_instance_id": "<string>",
"enabled": true,
"auto_disabled_at": "<string>",
"auto_disabled_reason": "<string>",
"consecutive_missing_connection_failures": 4503599627370495,
"first_missing_connection_failure_at": "<string>",
"last_missing_connection_failure_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"shared_with_automation": true,
"pending_change": {
"automation_revision_id": "<string>",
"enabled": true,
"filter_config": {}
}
}
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"answer_persisted": true,
"validationErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}Authorizations
Body
application/json
Was this page helpful?