Automation Steps

Update Automation Step

Changed on

Edits a step of the draft version. A published version's steps never change; edit the same key in the draft instead. previous_step_id can't change. Setting source_code also needs every read permission listed for previewing a step, which the step's code reads the account with.

patch/automation_steps/{id}

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.

Request body

object required
action_type, 'wait' | 'email' | 'message'

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.

config, union

The step's settings for its action_type: delay_seconds for a wait, and sender_id and attachment_ids for an email or a message. Writing it replaces the whole object, except that a step keeps its attachment_ids when the write leaves them out.

source_code, string nullable

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.

Example request

{
  "action_type": "message",
  "config": {
    "delay_seconds": 86400
  },
  "source_code": "export default () => message.send({ subject: \"Thanks!\", text: \"Thanks for your order!\" });"
}

Response

Automation step updated

AutomationStep required
action_type, 'wait' | 'email' | 'message' required

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.

automation_id, string required

ID of the automation the step belongs to, prefixed ato_.

config, union required

The 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.

created_at, string required

When the step was created, as an ISO 8601 timestamp.

id, string required

Automation step ID, prefixed atos_. A step gets a new ID in every version. Its key stays the same.

issues, string[] required
key, integer required

Identifies the same step across versions. A new step gets a key no step of the automation has used.

previous_step_id, string nullable required

ID of the step this one runs after, prefixed atos_. null when it runs first, directly after the member enrolls.

purpose, 'transactional' | 'marketing' | 'null' nullable required

Whether this step's message is transactional or marketing. null when its code is being classified.

sender, union required

Who a step's message comes from. type picks the shape: an email_address for an email step, a user on the team for a message step.

source_code, string nullable required

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.

updated_at, string required

When the step was last updated, as an ISO 8601 timestamp.

version, integer required

The automation version this step is part of. Only the draft version's steps can change.

waiting_enrollments_count, integer required

Members on this step's version who are waiting for it to run.

Example response

{
  "action_type": "email",
  "automation_id": "ato_xxxxxxxxxxxxxx",
  "config": {
    "delay_seconds": 86400
  },
  "created_at": "2026-01-01T12:00:00.000Z",
  "id": "atos_xxxxxxxxxxxxxx",
  "key": 2,
  "previous_step_id": "atos_xxxxxxxxxxxxxx",
  "purpose": "transactional",
  "sender": {
    "type": "email_address"
  },
  "source_code": "export default () => message.skip();",
  "updated_at": "2026-01-01T12:00:00.000Z",
  "version": 1
}

Changes

    • info

      added the required property purpose to the response with the status

    • info

      added the new optional request property config/anyOf[subschema #2: Email]/attachment_ids

    • info

      added the new optional request property config/anyOf[subschema #3: Message]/attachment_ids

    2 more changes in this revision