---
title: "Moderate Preview Endpoint"
method: POST
path: "/api/app-auto-gtm/segments/{segment_id}/moderate-preview"
tags: ["AppAutoGtm"]
---

# Moderate Preview Endpoint

`POST /api/app-auto-gtm/segments/{segment_id}/moderate-preview`

Moderate a rendered preview's subject + body separately from
generation.

Splits moderation off the /preview-emails response so the email body
renders fast and the moderation indicator runs on its own request —
the frontend can show a delayed "Checking content…" indicator and the
user sees the email immediately instead of waiting for moderation
after generation. The verdict surfaces in a banner on the preview
card (and a top-level alert near the Save button) when blocked.

Auth: org-scoped via the segment so a malicious caller can't moderate
arbitrary text against another tenant's quota.

## Path parameters

- `segment_id` integer, required

## Cookies

- `ex_access` string, nullable
- `ex_org` string, nullable

## Request body

- ModeratePreviewRequest — Body for POST /segments/{id}/moderate-preview. Frontend ships the rendered preview content (the ``subject`` / ``body_text`` it just got back from /preview-emails) so the backend can moderate it without re-generating. Decoupling moderation from generation lets the email body render fast on the editor while the moderation indicator runs separately and can show its own delayed 'Checking content…' affordance.
  - `subject` string, required
  - `body_text` string, required

## Response `200`

Successful Response

- ModeratePreviewResponse — Send-side moderation verdict for the supplied subject + body. Mirrors what `api.outreach.moderation.moderate_email` returns. ``llm:`` prefix is stripped so the wire format matches the deterministic-stage tokens — the frontend's ``moderationCopy`` table keys on the bare form. Empty ``moderation_category`` means it passed.
  - `moderation_status` 'ok' | 'blocked'
  - `moderation_category` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/explee/apis/explee-api.md) · [All operations](https://skmtc.dev/explee/apis/explee-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/explee/explee-api/revisions/f169bc6e9447/schema)
