Preview Automation Step
Changed onRuns 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.
Request
- Base URLhttps://api.whop.com/api/v1
- AuthHTTP bearer
Path parameters
Automation step ID, prefixed atos_.
Headers
Pins the request to a dated API version.
A unique key that makes this request safe to retry. See Idempotent requests.
Request body
The member to preview the step for, prefixed mber_.
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
The step's action type: email or message.
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.
What the step does for this member: sent its message, skipped it and moved on to the next step, or exited the automation.
The inbox preview line after the subject. null when the email has none.
Why the step skipped or exited, as the step's code said. null when it sends or gave no reason.
The email's subject. null unless an email step sends.
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'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:readwas removed from the endpoint's security schemebearerAuth - info
the security scope
ad_campaign:stats:readwas removed from the endpoint's security schemebearerAuth - info
the security scope
ad_publisher:readwas removed from the endpoint's security schemebearerAuth
1 more change in this revision
- info