> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a rule; activated:false retires it

> The rule

### Path parameters

**id** `string (uuid)` *required*

The rule id.

### Request body

`UpdateRule`

**rule\_name** `string`

Minimum length: `1`. Maximum length: `200`.

**rule\_type** `string`

One of: escalation, qualification, response, routing. Minimum length: `1`. Maximum length: `100`.

**description** `string`

Maximum length: `5000`.

**activated** `boolean`

Set false to retire the rule.

**conditions** `object`

\{any|all: \[\{field, operator, value}]}. Fields: company\_size, confidence, intent, knowledge\_sources, latest\_message, missing\_required\_fields, timeline. Operators: contains\_any, eq, exists, gte, in, lt, not\_empty.

**conditions**

**any** `any[]`

**all** `any[]`

**actions** `any[]`

\[\{type, ...}]. Types: collect\_fields, fallback, handoff, include\_sources, require\_context, require\_source\_for\_claims, require\_verification, response\_pattern, tag. Maximum items: `100`.

### Response

`Rule`

**object** `string`

Fixed value: `'rule'`.

**id** `string`

**name** `string,null`

**type** `string,null`

**description** `string,null`

**activated** `boolean`

**conditions** `any`

**actions** `any`

**agent\_id** `string,null`

### Status codes

| Code | Meaning |
| - | - |
| `200` | The rule |
| `400` | Invalid request. `issues` names the offending field(s). |
| `401` | Missing, invalid, or expired API key. |
| `403` | The key lacks a required scope. |
| `404` | Not found, or not in the organization that owns the key. |
| `429` | Rate limit exceeded. |

### Access

| | |
| - | - |
| Required scope | `agents:write` |
| Rate limit | 30 requests per minute |

### Using this contract

Read the [source OpenAPI document](https://docs.stateset.com/spec/responsecx.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request PATCH \
  --url 'https://response.stateset.com/api/v1/rules/{id}' \
  --header "Authorization: Bearer $RESPONSECX_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "rule_name": "string",
  "rule_type": "string",
  "description": "Two-person tent, green — replacement for damaged pole set.",
  "activated": true,
  "conditions": {
    "any": [],
    "all": []
  },
  "actions": []
}'
```

```json 200 theme={null}
{
  "object": "rule",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "Two-Person Tent",
  "type": "standard",
  "description": "Two-person tent, green — replacement for damaged pole set.",
  "activated": true,
  "conditions": null,
  "actions": null,
  "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.