# See what a template would say

Fills one template in and answers the rendered subject and body, plus the placeholder names that found no value — so a person sees the real letter instead of a hopeful one. Body: `definitionKey` and `rowId` (the record whose facts fill the holes — a lead, a deal), and `values` for anything typed by hand. All three are optional: a preview with no record answers the template with every placeholder reported missing, which is what a composer shows before a record is picked. Nothing is stored and nothing is sent.

Access class: `workspace`.

## Endpoint

`POST /v1/message-templates/{id}/preview`

## Parameters

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

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "definitionKey": "string",
    "rowId": "",
    "values": {}
  },
  "params": {
    ":id": "string"
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "body": "string",
    "missing": [
      "string"
    ],
    "resolved": [
      "string"
    ],
    "subject": "string",
    "values": {}
  }
}
```

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