curl --request PATCH \
--url https://api.moonshot.cn/v1/triggers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated daily summary"
}
'import requests
url = "https://api.moonshot.cn/v1/triggers/{id}"
payload = { "name": "Updated daily summary" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Updated daily summary'})
};
fetch('https://api.moonshot.cn/v1/triggers/{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.moonshot.cn/v1/triggers/{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([
'name' => 'Updated daily summary'
]),
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.moonshot.cn/v1/triggers/{id}"
payload := strings.NewReader("{\n \"name\": \"Updated daily summary\"\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.moonshot.cn/v1/triggers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated daily summary\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.cn/v1/triggers/{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 \"name\": \"Updated daily summary\"\n}"
response = http.request(request)
puts response.read_body{
"id": "trig_01h455vb4pex5vsknk084sn02q",
"name": "Updated daily summary",
"status": "active",
"agent_id": "agent_01h455vb4pex5vsknk084sn02q",
"session_mode": "new_session",
"policy": {
"type": "cron",
"expression": "0 9 * * *",
"timezone": "UTC"
},
"scope": "project",
"created_by": "user_example",
"created_at": "2026-08-01T09:00:00.000Z",
"updated_at": "2026-08-01T09:30:00.000Z"
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}仅修改请求体中出现的字段。传入空对象或空数组可清空集合,null 值视为未提供。状态变更通过暂停、恢复与归档操作进行。
将 session_mode 从 reuse_session 切换为其他值会释放平台管理的会话绑定。平台管理的触发器(origin_type 已设置)拒绝更新,返回 400 failed_precondition_error。
curl --request PATCH \
--url https://api.moonshot.cn/v1/triggers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated daily summary"
}
'import requests
url = "https://api.moonshot.cn/v1/triggers/{id}"
payload = { "name": "Updated daily summary" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Updated daily summary'})
};
fetch('https://api.moonshot.cn/v1/triggers/{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.moonshot.cn/v1/triggers/{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([
'name' => 'Updated daily summary'
]),
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.moonshot.cn/v1/triggers/{id}"
payload := strings.NewReader("{\n \"name\": \"Updated daily summary\"\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.moonshot.cn/v1/triggers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated daily summary\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.cn/v1/triggers/{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 \"name\": \"Updated daily summary\"\n}"
response = http.request(request)
puts response.read_body{
"id": "trig_01h455vb4pex5vsknk084sn02q",
"name": "Updated daily summary",
"status": "active",
"agent_id": "agent_01h455vb4pex5vsknk084sn02q",
"session_mode": "new_session",
"policy": {
"type": "cron",
"expression": "0 9 * * *",
"timezone": "UTC"
},
"scope": "project",
"created_by": "user_example",
"created_at": "2026-08-01T09:00:00.000Z",
"updated_at": "2026-08-01T09:30:00.000Z"
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}路径参数
触发器 ID。
^trig_[0-9a-hjkmnp-tv-z]{26}$请求体
更新触发器的部分更新请求体:只有出现的字段会变更。状态流转不通过更新进行。请使用暂停、恢复或归档操作。
人类可读的触发器名称。
1 - 256每次运行启动的智能体。
1 - 128精确的智能体版本("1"、"2"……)。空值表示在触发时刻选择最新版本。
128承载触发器所启动会话的环境。省略时沿用当前环境;空值会被拒绝。
128^env_[0-9a-hjkmnp-tv-z]{26}$替换绑定到触发器所启动会话的资源。
16作为资源绑定到会话的文件。
- 文件
- 凭据库
- 记忆库
Show child attributes
Show child attributes
替换每次运行时投递的开场事件。
16发送用户消息。
- 用户消息
- 用户中断
Show child attributes
Show child attributes
每次触发器运行使用哪个会话。
new_session, reuse_session 替换 TriggerRun 通知的 webhook 配置。提供空对象 {} 时解除当前配置。
Show child attributes
Show child attributes
替换决定触发器何时运行的策略。
Show child attributes
Show child attributes
响应
应用了修改的触发器。
保存的规则,按计划或按需启动智能体。
触发器 ID。
^trig_[0-9a-hjkmnp-tv-z]{26}$人类可读的触发器名称。
当前生命周期状态。
active, paused, archived 每次运行启动的智能体。
^agent_[0-9a-hjkmnp-tv-z]{26}$每次触发器运行使用哪个会话。
new_session, reuse_session 决定触发器何时运行的策略。
Show child attributes
Show child attributes
可见性范围。
official, org, project, user 创建者的用户 ID。
创建时间戳。
最后更新时间戳。
触发器暂停的原因。处于活跃状态时不存在。
Show child attributes
Show child attributes
精确的智能体版本("1"、"2"……)。缺省时在触发时刻选择最新版本。
承载触发器所启动会话的环境。
^env_[0-9a-hjkmnp-tv-z]{26}$绑定到触发器所启动会话的资源。
作为资源绑定到会话的文件。
- 文件
- 凭据库
- 记忆库
Show child attributes
Show child attributes
每次运行时添加到目标会话的开场事件。
发送用户消息。
- 用户消息
- 用户中断
Show child attributes
Show child attributes
创建或最后更新此触发器的不可变配置的类型,目前为 dream_policy_version。平台管理的触发器(此字段已设置)拒绝更新、暂停、恢复与归档——其生命周期跟随所属资源。仍可手动运行。
该不可变配置的 ID,例如梦境策略版本 ID。
触发器上次触发的时间。
即将到来的运行时间的近似值(UTC,最多 5 个)。仅活跃的 cron 触发器存在。
归档时间戳。处于活跃或暂停状态时不存在。
TriggerRun 通知的 webhook 配置。缺省则禁用投递。
Show child attributes
Show child attributes
此页面对您有帮助吗?