email or message step runs its source_code to decide whether to send and what to say. Steps form a chain, and each step names the step before it. Only the draft version can change.
Use the Automation steps API to list a version’s steps, and to add, update and remove steps in the draft. You can also preview what an email or message step would send a member. A preview sends nothing.
A step’s code reads the account through the API. It holds every account-level :read permission that both the admin role and Whop AI hold, except payout:account:read. So it can’t read cards. Setting a step’s source_code, or previewing a step, needs every one of those permissions. So a credential can’t write code that reads more than it can.
Endpoints
Attributes
Automation step ID, prefixed
atos_. A step gets a new ID in every version.
Its key stays the same.What the step does:
wait holds the member for config.delay_seconds, email emails them, and message sends them a message from a team member. A draft step can switch between email and message, which clears config.sender_id. A wait can’t become a sending step, or the other way round.Available options: wait, email, messageThe step’s settings for its
action_type: delay_seconds for a wait, and
sender_id and attachment_ids for an email or message. Writing it
replaces the whole object, except that a step keeps its attachment_ids when
the write leaves them out.What must be fixed before the draft can be published, such as code that hasn’t
been written. Empty when there’s nothing.
Identifies the same step across versions. A new step gets a key no step of the
automation has used.
ID of the step this one runs after, prefixed
atos_. null when it runs
first, directly after the member enrolls.Whether this step’s message is
transactional or marketing. null when its code is being classified.Available options: transactional, marketingThe sender
config.sender_id names. null on a wait, and when the step
sends from the default sender.An
email or message step’s code: a TSX module whose default export gets
the member and returns message.send(), message.skip() or message.exit()
from whop:message. An email step sends its subject, its react element
as the body and its text as the plain-text part. A message step sends its
text. The code can import react and @react-email/components. It reads
the account through the whop client from whop:message, which can only
read. That client holds every account-level :read permission that both the
admin role and Whop AI hold, except payout:account:read, as listed for
previewing a step. Setting it, or previewing the step, needs every one of
those permissions. Up to 64,000 characters. null on a wait, and until it
is written.The automation version this step is part of. Only the draft version’s steps
can change.
AutomationStep

