Update callback rules¶
Update a saved callback rule.
PATCH $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/callback-rules/{callback_rule_id}
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and target workspace ID that can access the target workspace.
Request body¶
curl -X PATCH "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/callback-rules/$CALLBACK_RULE_ID" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "Issue 回调",
"version": 1
}'
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Callback rule name. |
|
string |
No |
Callback rule description. |
|
boolean |
No |
Whether to enable the rule. |
|
integer |
No |
Match priority. |
|
object |
No |
Match criteria, which can include resource_kinds, event_types, event_actions, and field_equals. |
|
string |
No |
Callback target type. When provided, only agent_automation_task is supported. |
|
object |
No |
Callback target configuration. automation_task_id must be included when updating to an automation task target. |
|
boolean |
No |
Whether to stop matching after hitting this rule. |
|
integer |
Yes |
The rule version to update. |
Omitting a field or passing null will retain the original value. match: {} clears the matching conditions. A non-null target_config will replace the configuration as a whole and must also retain the required target fields. Just committing version will also generate a new version and rebind the current calling identity and effective roles.
Successful response¶
{
"code": 0,
"data": {
"id": "rule_01",
"workspace_id": "workspace_example",
"provider": "wecom",
"credential_ref": "cred_01",
"name": "告警回调",
"enabled": true,
"priority": 0,
"match": {
"event_types": [
"message"
]
},
"target_type": "agent_automation_task",
"stop_after_match": false,
"version": 1,
"created_at": "2026-10-14T00:00:00Z",
"updated_at": "2026-10-14T00:00:00Z",
"target_config": {
"automation_task_id": "task_01",
"user_api_key_configured": true
}
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
object |
response data. |
|
string |
Callback rule ID. |
|
string |
The workspace ID to which it belongs. |
|
string |
Provider ID. |
|
string |
A reference to a saved credential, not a clear-text key. |
|
string |
Name. |
|
string |
Description. Can be omitted if not set. |
|
boolean |
Whether to enable. |
|
integer |
Match priority. |
|
object |
Match condition. |
|
array of string |
Matching resource types. Any item in the array can be hit. Can be omitted if not set. |
|
array of string |
Matching event types. Any item in the array can be hit. Can be omitted if not set. |
|
array of string |
Matching event action. Any item in the array can be hit. Can be omitted if not set. |
|
object |
A key-value pair of field paths and matching values. Can be omitted if not set. |
|
string |
Callback target type, currently agent_automation_task. |
|
object |
Callback target configuration and public extension fields. Can be omitted if not set. |
|
string |
The automation task ID that receives the callback. |
|
boolean |
Whether the credentials for the target call have been saved. Can be omitted if not set. |
|
boolean |
Whether to stop matching after a hit. |
|
integer |
Updated version of the rules. Use this value for the next update. |
|
string |
Creator ID. Can be omitted if not set. |
|
string |
Last updated by identifier. Can be omitted if not set. |
|
string |
Creation time, in RFC 3339 format. |
|
string |
Last updated in RFC 3339 format. |
Error response¶
{
"code": 3,
"message": "callback rule not found"
}
Field |
Type |
Description |
|---|---|---|
|
integer |
error code. |
|
string |
Error message for the caller. |