# Evaluate a deal against the published rules

Run the workspace's published rule set against this deal and record the answer: a verdict (pass, fail or review), one result per rule with the reason and the figure behind it, and the whole namespace as it was. A verdict of review also opens one row in the manual-review queue. 404 when no published set applies to this deal.

Access class: `def:read`.

## Endpoint

`POST /v1/definitions/{key}/rows/{rowId}/underwriting/evaluate`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| rowId | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {},
  "params": {
    ":key": "string",
    ":rowId": ""
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "at": "string",
    "dealRowId": "",
    "evaluatedByAccountId": "",
    "facts": "string",
    "id": 1,
    "maxScore": 1,
    "results": [
      {
        "condition": "string",
        "observed": "string",
        "outcome": "string",
        "reason": "string",
        "result": "string",
        "ruleKey": "string",
        "ruleName": "string",
        "sortOrder": "string",
        "weight": "string"
      }
    ],
    "review": {
      "assigneeAccountId": "",
      "assigneeRole": "string",
      "createdAt": "string",
      "decidedAt": "string",
      "decidedByAccountId": "",
      "decision": "string",
      "id": 1,
      "instructions": "string",
      "note": "string",
      "runId": 1,
      "stepRowId": 1,
      "subjectId": 1,
      "subjectKind": "string",
      "title": "string",
      "updatedAt": "string",
      "workflowId": 1,
      "workflowKey": "string",
      "workflowName": "string"
    },
    "score": 1,
    "setId": 1,
    "setKey": "string",
    "setName": "string",
    "setVersion": 1,
    "triggerKind": "string",
    "verdict": "string",
    "versionId": 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"
}
```
