---
title: "Preview a comment"
method: POST
path: "/api/comments/preview"
tags: ["comments"]
---

# Preview a comment

`POST /api/comments/preview`

## Request

- Base URL: `https://dev.to`
- URL: `https://dev.to/api/comments/preview`
- Auth: one of:
  - API key in header `api-key`
  - HTTP bearer

This endpoint allows the client to preview a comment's rendered HTML from Markdown without saving it.

## Request body

- object
  - `body_markdown` string: The comment body in Markdown format

## Response `200`

Rendered Comment Preview

- object
  - `processed_html` string

## Other responses

- `401`: Unauthorized
- `422`: Unprocessable Entity

## Changes

- **2026-10-27** (v1) `12db4ecde9f3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/forem/apis/forem-api-v1/changes/api/comments/preview/post.md)

---

[API](https://skmtc.dev/forem/apis/forem-api-v1.md) - [All operations](https://skmtc.dev/forem/apis/forem-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/forem/apis/forem-api-v1/revisions/36f1cf80cf48?raw)
