> ## Documentation Index
> Fetch the complete documentation index at: https://docs.msgflash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# POST Preview a template

> Render a template with the provided context without sending a message.

## Endpoint

```txt theme={null}
POST /api/v1/templates/{id}/preview
```

## Parameters path

| Nom  | Type | Required | Description    |
| ---- | ---- | -------- | -------------- |
| `id` | UUID | yes      | ID du template |

## Body

| Field        | Type   | Required | Description          |
| ------------ | ------ | -------- | -------------------- |
| `instanceId` | UUID   | no       | `instance.*` context |
| `contactId`  | UUID   | no       | `contact.*` context  |
| `variables`  | object | no       | `custom.*` values    |

## Success response `200`

```json theme={null}
{
  "data": {
    "rendered": "Hello Awa, utilisez PROMO10.",
    "variables": ["contact.firstName", "custom.code"],
    "missingVariables": [],
    "valid": true
  }
}
```
