---
title: "Render and spam-check without sending"
method: POST
path: "/emails/preview"
tags: ["Emails"]
---

# Render and spam-check without sending

`POST /emails/preview`

## Request

- Base URL: `https://api.poststack.dev`
- URL: `https://api.poststack.dev/emails/preview`
- Auth: one of:
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://poststack.dev/oauth/authorize`
    - Token URL: `https://poststack.dev/oauth/token`
- TypeScript: <https://skmtc.dev/poststack/apis/poststack-api/docs/emails/preview/post.ts> (a function with typed inputs; its response is checked against the schema)

Renders the template (or the given html/text), measures it, runs the spam check and deliverability analysis. Stores nothing.

## Request body

- EmailPreviewInput
  - `from` string, required
  - `to` string[], required
  - `subject` string
  - `html` string
  - `text` string
  - `template_id` string
  - `variables` object

## Response `200`

Preview.

- object
  - `rendered_subject` string
  - `rendered_html` string, nullable
  - `rendered_text` string, nullable
  - `size` object
    - `html_bytes` integer
    - `text_bytes` integer
  - `spam` object
    - `score` number
    - `action` string
    - `symbols` SpamSymbol[]
      - `name` string, required
      - `score` number, required
      - `description` string
    - `skipped` boolean
  - `warnings` object[]

## Other responses

- `400`: Validation failed, or no subject / no body after rendering.
- `401`: Missing, malformed or unknown credentials (`WWW-Authenticate: Bearer …` is set).
- `403`: The credential lacks the `email:send` scope (body `{ error: "insufficient_scope", required, missing }`), or the team is suspended.
- `404`: template_id does not exist.
- `429`: Rate limited (30/min). `Retry-After` gives the seconds to wait; `X-RateLimit-*` headers are sent on every response.

## Changes

- **2026-09-30** `4dc1e20989c8`: 15 warning
  - added the new `daily_limit_exceeded` enum value to the `anyOf[#/components/schemas/Error]/code` response property for the response status `403`
  - added the new `daily_limit_exceeded` enum value to the `code` response property for the response status `400`
  - added the new `daily_limit_exceeded` enum value to the `code` response property for the response status `401`
  - added the new `daily_limit_exceeded` enum value to the `code` response property for the response status `404`
  - …11 more
- **2026-09-29** `ef5b22b98333`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/poststack/apis/poststack-api/changes/emails/preview/post.md)

---

[API](https://skmtc.dev/poststack/apis/poststack-api.md) - [All operations](https://skmtc.dev/poststack/apis/poststack-api/llms.txt) - [OpenAPI document](https://skmtc.dev/poststack/apis/poststack-api/revisions/0d3971e3a670?raw)
