---
title: "Preview Automation Step"
method: POST
path: "/automation_steps/{id}/preview"
tags: ["Automation Steps"]
---

# Preview Automation Step

`POST /automation_steps/{id}/preview`

## Request

- Base URL: `https://api.whop.com/api/v1`
- URL: `https://api.whop.com/api/v1/automation_steps/{id}/preview`
- Auth: HTTP bearer

Runs an `email` or `message` step's code for one member, as if they had reached it, and returns what it would send. Nothing is sent. The step's code reads the account with every account-level `:read` permission that both the admin role and Whop AI hold except `payout:account:read`, so previewing, like setting `source_code`, needs `automation:write` and every one of those permissions. OAuth apps can't be granted all of them, so they can't preview or set step code.

## Path parameters

- `id` string, required

## Headers

- `Api-Version-Date` string
- `Idempotency-Key` string

## Request body

- object
  - `member_id` string, required: The member to preview the step for, prefixed `mber_`.
  - `trigger_resource_id` string, nullable: ID of the record the automation's trigger event was about for this member, such as a `pay_` payment.

## Response `200`

What the step would send

- AutomationStepPreview
  - `action_type` 'email' | 'message', required: The step's action type: `email` or `message`.
  - `html` string, nullable, required: The email's HTML, with Whop's footer. Its unsubscribe link is a placeholder until the email is sent. `null` unless an `email` step sends.
  - `outcome` 'sent' | 'skipped' | 'exited', required: What the step does for this member: `sent` its message, `skipped` it and moved on to the next step, or `exited` the automation.
  - `preheader` string, nullable, required: The inbox preview line after the subject. `null` when the email has none.
  - `reason` string, nullable, required: Why the step skipped or exited, as the step's code said. `null` when it sends or gave no reason.
  - `subject` string, nullable, required: The email's subject. `null` unless an `email` step sends.
  - `text` string, nullable, required: The message as plain text: the message on a `message` step, or the email's plain-text version with Whop's footer. `null` unless the step sends.

## Other responses

- `400`: Invalid Parameters
- `403`: Forbidden
- `404`: Resource not found
- `409`: Conflict

## Changes

- **2026-11-23** `9f93639bd17e`: 4 info
  - the security scope `ad_campaign:read` was removed from the endpoint's security scheme `bearerAuth`
  - the security scope `ad_campaign:stats:read` was removed from the endpoint's security scheme `bearerAuth`
  - the security scope `ad_publisher:read` was removed from the endpoint's security scheme `bearerAuth`
  - the security scope `app_authorization:read` was removed from the endpoint's security scheme `bearerAuth`
- **2026-11-10** `2ddd23bcf5a3`: 1 info
  - the security scope `email:read` was added to the endpoint's security scheme `bearerAuth`
- **2026-11-06** `ea41781067f2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/whop/apis/whop-api/changes/automation_steps/:id/preview/post.md)

---

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