跳转到主要内容
POST
/
scheduled-task
/
sync
curl --request POST \
  --url https://zeus-api.agentspro.cn/scheduled-task/sync \
  --header 'X-Internal-Secret: your-secret' \
  --header 'Content-Type: application/json' \
  --data '{
    "action": "add",
    "task_id": "task_123",
    "task": {
      "id": "task_123",
      "user_id": "user_456",
      "title": "每日邮件摘要",
      "prompt": "检查收件箱并生成今日邮件摘要",
      "repeat_type": "daily",
      "scheduled_time": "09:00",
      "timezone": "Asia/Shanghai"
    }
  }'
{
  "success": true,
  "action": "add",
  "task_id": "task_123"
}
这是内部 API,由 Web 端通过 X-Internal-Secret header 调用,不对外暴露。
Web 端创建/更新/删除定时任务后,通过此接口将任务同步到 AI Backend 的 APScheduler 调度器。
X-Internal-Secret
string
必填
内部 API 密钥(环境变量 INTERNAL_API_SECRET
action
string
必填
操作类型:add | remove | update
task_id
string
必填
任务 ID
task
object
任务数据(addupdate 时必填)
success
boolean
操作是否成功
action
string
执行的操作
task_id
string
任务 ID
curl --request POST \
  --url https://zeus-api.agentspro.cn/scheduled-task/sync \
  --header 'X-Internal-Secret: your-secret' \
  --header 'Content-Type: application/json' \
  --data '{
    "action": "add",
    "task_id": "task_123",
    "task": {
      "id": "task_123",
      "user_id": "user_456",
      "title": "每日邮件摘要",
      "prompt": "检查收件箱并生成今日邮件摘要",
      "repeat_type": "daily",
      "scheduled_time": "09:00",
      "timezone": "Asia/Shanghai"
    }
  }'
{
  "success": true,
  "action": "add",
  "task_id": "task_123"
}