# Update callback rules

Update a saved callback rule.

```text
PATCH $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/callback-rules/{callback_rule_id}
```

## Before you call this API

Configure the [regional API endpoint and authentication](https://omnifabric.cloudsigma.com/docs/developer/endpoints-and-authentication.html.md), and select the target workspace.

Set the operation-specific values used in the request: `$CALLBACK_RULE_ID`.

## Request example

```bash
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
  }'
```

## Request body

| Parameters | Type | Is it required | Description |
| --- | --- | --- | --- |
| `name` | string | No | Callback rule name. |
| `description` | string | No | Callback rule description. |
| `enabled` | boolean | No | Whether to enable the rule. |
| `priority` | integer | No | Match priority. |
| `match` | object | No | Matching criteria, which can include `resource_kinds`, `event_types`, `event_actions`, and `field_equals`. |
| `target_type` | string | No | Callback target type. |
| `target_config` | object | No | Callback target configuration. |
| `stop_after_match` | boolean | No | Whether to stop matching after hitting this rule. |
| `version` | integer | Yes | The rule version to update. |

## Successful response

Returns `200` and updated rules on success.

```json
{"code":0,"data":{"id":"rule_01"}}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `data.id` | string | Callback rule ID. |

## Error response

```json
{"code":5,"message":"callback rule not found"}
```
