# Change an underwriting rule

Change one draft rule - its condition, outcome, reason, weight, order, or whether it is active. The published version is untouched, which is what makes editing a live set safe.

Access class: `workspace:admin`.

## Endpoint

`PATCH /v1/workspace/underwriting/rule-sets/{setId}/rules/{ruleId}`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| setId | path | string | Yes |
| ruleId | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "active": true,
    "condition": "string",
    "name": "string",
    "outcome": "string",
    "reasonTemplate": "string",
    "sortOrder": 1,
    "sourceText": "string",
    "weight": 1
  },
  "params": {
    ":ruleId": "",
    ":setId": ""
  },
  "query": {}
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "active": true,
    "condition": "string",
    "createdAt": "string",
    "id": 1,
    "key": "string",
    "name": "string",
    "outcome": "string",
    "reasonTemplate": "string",
    "setId": 1,
    "sortOrder": 1,
    "sourceText": "string",
    "updatedAt": "string",
    "weight": 1
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
