Preview mail template draft. POST /api/openapi/v1/mail-templates/{template_id}/preview, scope admin.v1.mail-settings.read.
- Scope: admin.v1.mail-settings.read
- Permission: Read enterprise mail (mail-settings)
- Permission type: Read
- Endpoint: POST/api/openapi/v1/mail-templates/{template_id}/preview
Authentication and request headers
Call with an application API key. This endpoint checks only the scope above; read, manage and execute permissions do not imply one another.
| Name | Location | Type | Required | Description | Example |
|---|---|---|---|---|---|
| Authorization | header | string | Yes | Application API key, passed as a Bearer token. | Bearer qwk_*** |
| X-Request-Id | header | string | No | Optional request tracing identifier; generated by the server if omitted. | req-20260831-001 |
Request parameters
| Name | Location | Type | Required | Description | Example |
|---|---|---|---|---|---|
| template_id | path | string | Required | Template ID | "<string>" |
| html | body | string | Required | HTML body | "<string>" |
| subject | body | string | Required | Email subject | "<string>" |
| text | body | string | Required | Plain text body | "<string>" |
Request example
cURL
Responses
200 OK
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| html | string | Yes | HTML body | "<string>" |
| subject | string | Yes | Email subject | "<string>" |
| text | string | Yes | Plain text body | "<string>" |
default Flat business error
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| code | string | No | Stable business error code | "<string>" |
| detail | string | Yes | Human-readable error description | "<string>" |
| details | OpenapiErrorDetails | No | Test result details | {"field":"<string>","reason":"<string>","suggestion":"<string>"} |
| details.field | string | No | Request field that failed validation | "<string>" |
| details.reason | string | No | Stable validation failure reason | "<string>" |
| details.suggestion | string | No | Suggested normalized value | "<string>" |
| error | string | Yes | Stable HTTP error type | "<string>" |