curl --request POST \
--url https://api.moonshot.cn/v1/triggers/{id}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payload": "Run the daily summary."
}
'import requests
url = "https://api.moonshot.cn/v1/triggers/{id}/run"
payload = { "payload": "Run the daily summary." }
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({payload: 'Run the daily summary.'})
};
fetch('https://api.moonshot.cn/v1/triggers/{id}/run', 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}/run",
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([
'payload' => 'Run the 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}/run"
payload := strings.NewReader("{\n \"payload\": \"Run the daily summary.\"\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.moonshot.cn/v1/triggers/{id}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payload\": \"Run the daily summary.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.cn/v1/triggers/{id}/run")
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 \"payload\": \"Run the daily summary.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "trun_01h455vb4pex5vsknk084sn02q",
"trigger_id": "trig_01h455vb4pex5vsknk084sn02q",
"status": "completed",
"created_at": "2026-08-01T09:00:00.000Z",
"run": {
"status": "completed"
}
}{
"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>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}立即触发一次触发器——包括已暂停的触发器——并同步执行,返回终态的触发器运行记录(completed、failed 或 skipped)。
completed 表示会话已创建且开场事件已被接受。不涵盖智能体的任务结果。已有另一次运行正在进行时返回 400 failed_precondition_error。reuse_session 运行发现平台管理的会话仍在执行上一次运行时,返回 skipped 与 overlap_in_flight。
curl --request POST \
--url https://api.moonshot.cn/v1/triggers/{id}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payload": "Run the daily summary."
}
'import requests
url = "https://api.moonshot.cn/v1/triggers/{id}/run"
payload = { "payload": "Run the daily summary." }
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({payload: 'Run the daily summary.'})
};
fetch('https://api.moonshot.cn/v1/triggers/{id}/run', 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}/run",
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([
'payload' => 'Run the 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}/run"
payload := strings.NewReader("{\n \"payload\": \"Run the daily summary.\"\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.moonshot.cn/v1/triggers/{id}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payload\": \"Run the daily summary.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.cn/v1/triggers/{id}/run")
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 \"payload\": \"Run the daily summary.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "trun_01h455vb4pex5vsknk084sn02q",
"trigger_id": "trig_01h455vb4pex5vsknk084sn02q",
"status": "completed",
"created_at": "2026-08-01T09:00:00.000Z",
"run": {
"status": "completed"
}
}{
"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>"
}
}{
"error": {
"type": "invalid_parameter_error",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}请求头
可选的幂等键。相同的键与请求体会在 24 小时内重放首个响应;以不同的请求体复用,或在首个请求仍在处理时复用,返回 409。
路径参数
触发器 ID。
^trig_[0-9a-hjkmnp-tv-z]{26}$请求体
手动运行触发器的请求体。
可选的自由格式负载,以用户消息形式投递到本次运行的会话。
4096响应
终态的触发器运行记录(completed、failed 或 skipped)。
一次触发器运行的记录:其目标会话、终态状态,以及失败时的失败详情。
触发器运行 ID。
^trun_[0-9a-hjkmnp-tv-z]{26}$本次运行所属的触发器。
^trig_[0-9a-hjkmnp-tv-z]{26}$当前运行状态。
pending, running, completed, failed, skipped 创建时间戳。
调度(cron)运行的上下文。
- 调度
- 手动
Show child attributes
Show child attributes
本次运行创建的会话。分配前不存在。
^sesn_[0-9a-hjkmnp-tv-z]{26}$结构化的失败信息。失败的运行以及因重叠而 skipped 的运行存在。其 type 为 HTTP error.type 集合之外的领域词汇表,仅供展示;封闭集合为 agent_not_found、agent_archived、environment_missing、environment_not_found、environment_archived、vault_not_found、vault_archived、memory_store_not_found、memory_store_archived、model_route_invalid、session_terminated、fire_failed 与 overlap_in_flight。
Show child attributes
Show child attributes
终止时间戳。运行进行期间不存在。
此页面对您有帮助吗?