CreateAutomationEventTask - Create an automation event task
|
Applicable editions |
Central edition, Region edition |
Service endpoints and authorization
- Obtain a service endpoint: Replace {domain} in the API request syntax.
- Obtain a personal access token。
- Obtain organizationId: Required only for the Central edition. Go to the Organization Management console's Basic information page to obtain the organization ID.
|
Product |
Resource |
Required permission |
|
Organization Management |
Automation event tasks |
Read and write |
Request syntax
Central edition
POST https://{domain}/oapi/v1/platform/organizations/{organizationId}/automation/event-tasks
Region edition
POST https://{domain}/oapi/v1/platform/automation/event-tasks
Request headers
|
Parameter |
Type |
Required |
Description |
Example |
|
x-yunxiao-token |
string |
Yes |
The personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
Parameter | Type | Location | Required | Description | Example |
organizationId | string | path | Yes | The organization ID. | |
| - | object | body | No | ||
| channels | array[string] | body | No | Notification channels after AI execution. If none are specified, only AI is executed and no notification is sent. | |
| displayName | string | body | Yes | The task title. This is also the default email subject and DingTalk title. | Reminder: My assigned work item is complete |
| enabled | boolean | body | No | Whether to enable the task. Defaults to true when created and remains unchanged by default when updated. | |
| eventTypes | array[string] | body | Yes | The subscribed event type. Exactly one event type is required. Valid values are defined by the event type catalog operation. | ["yunxiao.projex.workitem.e.v1.transitioned"] |
| filter | object | body | No | A structured filter condition in one of three forms: a single predicate {field,op,value\|values}; a single group {all:[predicate,...]}; or a two-level condition group {any:[member,...]}, where each member is a predicate or {all:[predicate,...]}. A match occurs if any member matches; all predicates in an all group must match. The number of any members and the number of predicates in a single group must each not exceed 16. The total number of predicates in the expression must not exceed 32. not, nested any, and nested groups in all are not supported. field only supports data.<field path>; the allowlist of fields and operators is defined by allowedOps in the event field catalog. | |
| mailSubject | string | body | No | The email subject. Plain text only; template bindings are not supported. Defaults to the task title. | |
| model | object | body | No | The AI model. Auto is used by default at creation, and the original model is retained during updates. Set {"provider":"auto","modelId":"auto"} to switch back to Auto. The specified model must be selected from capabilities.models. Custom endpoints or keys and parameters such as temperature are not supported. If the original model is offline, an update must explicitly pass an available model or Auto. | |
| modelId | string | body | No | The model ID (without the date suffix). Set to auto when Auto is used. | qwen3.8-max |
| provider | string | body | No | The model provider. Set to auto when Auto is used. | qwen |
| prompt | string | body | Yes | The instruction sent to AI after an event matches (maximum 32768 UTF-8 bytes). Can reference templatable fields in the field catalog using the \${data.*} template binding. | The work item \${data.rich_resource.name} has transitioned to a new status. Generate a processing reminder |
| recipients | array[string] | body | No | The recipient list. Defaults to the caller when created. | |
| scope | object | body | No | The effective scope. Only non-empty string arrays for projectIds/resourceIds are accepted. If omitted, no limit applies. |
Request example
Central edition
curl -X 'POST' \
'https://{domain}/oapi/v1/platform/organizations/{organizationId}/automation/event-tasks' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"channels": [
],
"displayName": "分配给我的工作项已完成提醒",
"enabled": false,
"eventTypes": ["yunxiao.projex.workitem.e.v1.transitioned"],
"filter": {
},
"mailSubject": "",
"model": {
"modelId": "qwen3.8-max",
"provider": "qwen"
},
"prompt": "工作项 ${data.rich_resource.name} 已流转到新状态,请生成一份处理提醒",
"recipients": [
],
"scope": {
}
}'
Region edition
curl -X 'POST' \
'https://{domain}/oapi/v1/platform/automation/event-tasks' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"channels": [
],
"displayName": "分配给我的工作项已完成提醒",
"enabled": false,
"eventTypes": ["yunxiao.projex.workitem.e.v1.transitioned"],
"filter": {
},
"mailSubject": "",
"model": {
"modelId": "qwen3.8-max",
"provider": "qwen"
},
"prompt": "工作项 ${data.rich_resource.name} 已流转到新状态,请生成一份处理提醒",
"recipients": [
],
"scope": {
}
}'
Response parameters
Parameter | Type | Description | Example |
| - | object | ||
| actions | array | ||
| - | object | ||
| id | string | The action node ID, used to map execution records to action types. | |
| type | string | The action type, such as starops.execute_ai / mail.send_report / dingtalk.send_report. | |
| channels | array[string] | ||
| condition | string | The CEL compiled from the structured filter, or an expression entered directly in the advanced view. Read-only. | |
| createdAt | string | ||
| displayName | string | ||
| enabled | boolean | ||
| eventTypes | array[string] | ||
| filter | object | A structured filter condition in one of three forms: a single predicate {field,op,value\|values}; a single group {all:[predicate,...]}; or a two-level condition group {any:[member,...]}, where each member is a predicate or {all:[predicate,...]}. A match occurs if any member matches; all predicates in an all group must match. The number of any members and the number of predicates in a single group must each not exceed 16. The total number of predicates in the expression must not exceed 32. not, nested any, and nested groups in all are not supported. field only supports data.<field path>; the allowlist of fields and operators is defined by allowedOps in the event field catalog. | |
| mailSubject | string | ||
| manageable | boolean | false indicates that the rule includes advanced configuration that cannot be expressed losslessly in the form. It can be viewed, enabled or disabled, deleted, and have its records viewed, but cannot be updated in the form. | |
| mode | string | The AI execution mode: command without channels and report with channels. | |
| model | object | The AI model used by the task. Returns Auto (provider=auto, modelId=auto) when no model is configured. | |
| modelId | string | The model ID (without the date suffix). Set to auto when Auto is used. | qwen3.8-max |
| provider | string | The model provider. Set to auto when Auto is used. | qwen |
| name | string | A stable task name generated by the server. | event-1a2b3c4d |
| prompt | string | ||
| recipients | array[string] | ||
| scope | object | ||
| unmanageableReason | string | The reason code why the rule cannot be managed by the form, such as nested_filter_group (the filter condition exceeds the two-level condition-group form: not, nested any, nested groups in all, or complexity limit exceeded), raw_cel_condition, or multi_event_types. | |
| updatedAt | string | ||
| version | integer |
Response example
{
"actions": [
{
"id": "",
"type": ""
}
],
"channels": [
],
"condition": "",
"createdAt": "",
"displayName": "",
"enabled": false,
"eventTypes": [
],
"filter": {
},
"mailSubject": "",
"manageable": false,
"mode": "",
"model": {
"modelId": "qwen3.8-max",
"provider": "qwen"
},
"name": "event-1a2b3c4d",
"prompt": "",
"recipients": [
],
"scope": {
},
"unmanageableReason": "",
"updatedAt": "",
"version": 0
}
Error codes
Visit the Error Code Center to view API error codes.