cURL
curl -X PATCH 'https://api.gumloop.com/api/v1/agents/abc123DEFghiJKL/triggers/trg_7f1a2b' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"cron_expression": "0 9 * * 1", "enabled": false}'from gumloop import Gumloop
client = Gumloop(access_token="YOUR_ACCESS_TOKEN")
client.agents.update_trigger("abc123DEFghiJKL", "trg_7f1a2b", cron_expression="0 9 * * 1", enabled=False)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
name: '<string>',
cron_expression: '<string>',
run_at: '2023-11-07T05:31:56Z',
timezone: '<string>',
pass_raw_data: true,
enabled: true,
max_failures: 123
})
};
fetch('https://api.gumloop.com/api/v1/agents/{agent_id}/triggers/{trigger_id}', 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.gumloop.com/api/v1/agents/{agent_id}/triggers/{trigger_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'name' => '<string>',
'cron_expression' => '<string>',
'run_at' => '2023-11-07T05:31:56Z',
'timezone' => '<string>',
'pass_raw_data' => true,
'enabled' => true,
'max_failures' => 123
]),
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.gumloop.com/api/v1/agents/{agent_id}/triggers/{trigger_id}"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"name\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"pass_raw_data\": true,\n \"enabled\": true,\n \"max_failures\": 123\n}")
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))
}HttpResponse<String> response = Unirest.patch("https://api.gumloop.com/api/v1/agents/{agent_id}/triggers/{trigger_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"name\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"pass_raw_data\": true,\n \"enabled\": true,\n \"max_failures\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gumloop.com/api/v1/agents/{agent_id}/triggers/{trigger_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"name\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"pass_raw_data\": true,\n \"enabled\": true,\n \"max_failures\": 123\n}"
response = http.request(request)
puts response.read_body{
"trigger": {
"id": "trg_7f1a2b",
"agent_id": "abc123DEFghiJKL",
"type": "schedule",
"name": "<string>",
"prompt": "<string>",
"cron_expression": "0 9 * * 1-5",
"run_at": "2023-11-07T05:31:56Z",
"timezone": "America/Los_Angeles",
"pass_raw_data": true,
"enabled": true,
"status": "<string>",
"max_failures": 123,
"webhook_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z"
}
}Update an agent trigger
Only the fields you send change. Any trigger can be renamed, reworded, paused and resumed (name, prompt, enabled, max_failures). Schedule fields apply to schedule triggers and pass_raw_data to webhook triggers; sending them on another type answers 400 trigger_type_not_editable. A schedule keeps its kind: send cron_expression on a recurring trigger and run_at on a one-time one.
Team API keys are not accepted.
PATCH
/
agents
/
{agent_id}
/
triggers
/
{trigger_id}
cURL
curl -X PATCH 'https://api.gumloop.com/api/v1/agents/abc123DEFghiJKL/triggers/trg_7f1a2b' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"cron_expression": "0 9 * * 1", "enabled": false}'from gumloop import Gumloop
client = Gumloop(access_token="YOUR_ACCESS_TOKEN")
client.agents.update_trigger("abc123DEFghiJKL", "trg_7f1a2b", cron_expression="0 9 * * 1", enabled=False)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
name: '<string>',
cron_expression: '<string>',
run_at: '2023-11-07T05:31:56Z',
timezone: '<string>',
pass_raw_data: true,
enabled: true,
max_failures: 123
})
};
fetch('https://api.gumloop.com/api/v1/agents/{agent_id}/triggers/{trigger_id}', 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.gumloop.com/api/v1/agents/{agent_id}/triggers/{trigger_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'name' => '<string>',
'cron_expression' => '<string>',
'run_at' => '2023-11-07T05:31:56Z',
'timezone' => '<string>',
'pass_raw_data' => true,
'enabled' => true,
'max_failures' => 123
]),
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.gumloop.com/api/v1/agents/{agent_id}/triggers/{trigger_id}"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"name\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"pass_raw_data\": true,\n \"enabled\": true,\n \"max_failures\": 123\n}")
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))
}HttpResponse<String> response = Unirest.patch("https://api.gumloop.com/api/v1/agents/{agent_id}/triggers/{trigger_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"name\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"pass_raw_data\": true,\n \"enabled\": true,\n \"max_failures\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gumloop.com/api/v1/agents/{agent_id}/triggers/{trigger_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"name\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"pass_raw_data\": true,\n \"enabled\": true,\n \"max_failures\": 123\n}"
response = http.request(request)
puts response.read_body{
"trigger": {
"id": "trg_7f1a2b",
"agent_id": "abc123DEFghiJKL",
"type": "schedule",
"name": "<string>",
"prompt": "<string>",
"cron_expression": "0 9 * * 1-5",
"run_at": "2023-11-07T05:31:56Z",
"timezone": "America/Los_Angeles",
"pass_raw_data": true,
"enabled": true,
"status": "<string>",
"max_failures": 123,
"webhook_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Body
application/json
Response
The updated trigger.
Show child attributes
Show child attributes
Was this page helpful?