# Change an underwriting rule set

Change a rule set's name, description, or which stage and product it applies to; or retire it with status "archived". It never republishes - what is running keeps running until the publish route is called. There is no delete: an evaluation names a version of this set and its reasoning must stay readable.

Access class: `workspace:admin`.

## Endpoint

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

## Parameters

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

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "appliesToProduct": "string",
    "appliesToStage": "string",
    "description": "string",
    "name": "string",
    "status": "string"
  },
  "params": {
    ":setId": ""
  },
  "query": {}
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "appliesToProduct": "string",
    "appliesToStage": "string",
    "createdAt": "string",
    "createdByAccountId": "",
    "description": "string",
    "hasUnpublishedChanges": true,
    "id": 1,
    "key": "string",
    "name": "string",
    "publishedAt": "string",
    "publishedByAccountId": "",
    "publishedVersion": 1,
    "rules": [
      {
        "active": "string",
        "condition": "string",
        "createdAt": "string",
        "id": "",
        "key": "string",
        "name": "string",
        "outcome": "string",
        "reasonTemplate": "string",
        "setId": "",
        "sortOrder": "string",
        "sourceText": "string",
        "updatedAt": "string",
        "weight": "string"
      }
    ],
    "seeded": true,
    "status": "string",
    "updatedAt": "string"
  }
}
```

### 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"
}
```
