Automation Steps

Preview Automation Step

Changed on

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.

post/automation_steps/{id}/preview

Request

  • Base URL
    https://api.whop.com/api/v1
  • Auth
    HTTP bearer

Path parameters

id, string required

Automation step ID, prefixed atos_.

Headers

Api-Version-Date, string
Example:2026-11-30

Pins the request to a dated API version.

Idempotency-Key, string
Example:d9105228-4a08-46b1-8b91-42fed586d383

A unique key that makes this request safe to retry. See Idempotent requests.

Request body

object required
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.

Example request

{
  "member_id": "mber_xxxxxxxxxxxxxx",
  "trigger_resource_id": "pay_xxxxxxxxxxxxxx"
}

Response

What the step would send

AutomationStepPreview required
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.

Example response

{
  "action_type": "email",
  "html": "<html><body><p>Hi there</p><table role=\"presentation\" data-whop-footer width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:32px 0 0;border-top:1px solid #e6e6e6;\">\n<tr><td style=\"padding:20px 16px;text-align:center;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;font-size:12px;line-height:18px;color:#6f6f6f;\">\n<p style=\"margin:0 0 8px;\">You&#39;re receiving this because you bought from Shine Time Auto Detailing. <a href=\"{{whop_unsubscribe_url}}\" style=\"color:#6f6f6f;text-decoration:underline;\">Unsubscribe from Shine Time Auto Detailing marketing communications</a>.</p>\n<p style=\"margin:0 0 8px;\">Problem with your order? <a href=\"https://whop.com/@me/settings/resolution-center/\" style=\"color:#6f6f6f;text-decoration:underline;\">Open a case in the Resolution Center</a>.</p>\n<p style=\"margin:0;font-weight:600;color:#9a9a9a;\">Sent with Whop</p>\n<!--whop:open-pixel-->\n</td></tr>\n</table>\n\n</body></html>",
  "outcome": "sent",
  "subject": "How is your ceramic coating?",
  "text": "Hi there\n\n--\nYou're receiving this because you bought from Shine Time Auto Detailing. Unsubscribe from Shine Time Auto Detailing marketing communications: {{whop_unsubscribe_url}}\nProblem with your order? Open a case in the Resolution Center: https://whop.com/@me/settings/resolution-center/\nSent with Whop"
}

Changes

    • info

      the security scope ad_campaign:read was removed from the endpoint's security scheme bearerAuth

    • info

      the security scope ad_campaign:stats:read was removed from the endpoint's security scheme bearerAuth

    • info

      the security scope ad_publisher:read was removed from the endpoint's security scheme bearerAuth

    1 more change in this revision