---
title: "校验触发器"
method: POST
path: "/automations/validate-trigger"
tags: ["自动化"]
---

# 校验触发器

`POST /automations/validate-trigger`

## Request

- Base URL: `/api/v1` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/v1/automations/validate-trigger`
- Auth: API key in header `Authorization`

校验 cron 或一次性触发器，返回未来 3 次触发时间

## Request body

- InternalHandlerValidateTriggerRequest
  - `trigger` GithubComTencentWeKnoraInternalTypesAutomationTrigger, required
    - `at` string: At is when a once trigger fires, RFC3339 or a wall-clock time in Timezone, such as "2006-01-02T15:04:05" or "2006-01-02 15:04".
    - `expr` string: Expr is a cron expression: five fields (minute first) or six (seconds first), or a descriptor such as @daily.
    - `timezone` string: Timezone is an IANA zone, e.g. Asia/Shanghai; empty means UTC.
    - `type` string: Type is cron or once.

## Response `200`

未来触发时间

- object
  - `data` InternalHandlerValidateTriggerResult
    - `next_runs` string[]: The next times the trigger fires, in UTC
  - `success` boolean

## Other responses

- `400`: 触发器不合法

## Changes

- **2026-10-19** `80c72611fac6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/tencentblueking/apis/weknora-api/changes/automations/validate-trigger/post.md)

---

[API](https://skmtc.dev/tencentblueking/apis/weknora-api.md) - [All operations](https://skmtc.dev/tencentblueking/apis/weknora-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tencentblueking/apis/weknora-api/revisions/685d1f9fce30?raw)
