# Publish an underwriting rule set

Freeze the set's active draft rules as the next version and point the set at it, so evaluations from now on run those words. Refused when the set is archived or has no active rule, and when another live set already claims the same stage and product.

Access class: `workspace:admin`.

## Endpoint

`POST /v1/workspace/underwriting/rule-sets/{setId}/publish`

## Parameters

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

## Request body

Content type: `application/json`.

```json
{
  "body": {},
  "params": {
    ":setId": ""
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "appliesToProduct": "string",
    "appliesToStage": "string",
    "id": 1,
    "name": "string",
    "publishedAt": "string",
    "publishedByAccountId": "",
    "rules": [
      {
        "condition": "string",
        "key": "string",
        "name": "string",
        "outcome": "string",
        "reasonTemplate": "string",
        "sourceText": "string",
        "weight": "string"
      }
    ],
    "setId": 1,
    "version": 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"
}
```
