> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MarketingAutomationStepInsertInput

> Insert a step. Pass after (parent) or before (existing child), not both. A/B parents require variantId. Condition parents require branch TRUE or FALSE. Pass exactly one typed payload. Which payloads the automation's trigger accepts is listed per trigger in marketingAutomationCatalog; any other returns STEP_NOT_INSERTABLE.

<ResponseField name="abTest" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-ab-test-step-input">MarketingAutomationAbTestStepInput</a>}>
  <Expandable title="fields" lazyRender>
    <ResponseField name="customTitle" type="String" />

    <ResponseField name="description" type="String" />

    <ResponseField name="name" type="String" />

    <ResponseField name="variants" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-ab-test-variant-input">[MarketingAutomationAbTestVariantInput!]</a>}>
      <Expandable title="fields" lazyRender>
        <ResponseField name="id" type="ID">
          Existing variant id.
        </ResponseField>

        <ResponseField name="name" type="String">
          Merchant-facing name.
        </ResponseField>

        <ResponseField name="nextStepId" type="ID">
          First step on this arm.
        </ResponseField>

        <ResponseField name="weight" type="Int">
          Share of traffic, typically summing to 100.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="after" type="ID">
  Insert on the outgoing edge of this parent step.
</ResponseField>

<ResponseField name="before" type="ID">
  Insert immediately before this child. The child must have exactly one incoming edge.
</ResponseField>

<ResponseField name="branch" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-condition-branch">MarketingAutomationConditionBranch</a>}>
  Which condition arm to attach to.
</ResponseField>

<ResponseField name="condition" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-condition-step-input">MarketingAutomationConditionStepInput</a>}>
  <Expandable title="fields" lazyRender>
    <ResponseField name="customTitle" type="String" />

    <ResponseField name="description" type="String" />

    <ResponseField name="expression" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-condition-expression-input">MarketingAutomationConditionExpressionInput</a>}>
      <Expandable title="fields" lazyRender>
        <ResponseField name="existingSegment" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-existing-segment-condition-input">MarketingAutomationExistingSegmentConditionInput</a>} />

        <ResponseField name="inlineSegment" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-inline-segment-condition-input">MarketingAutomationInlineSegmentConditionInput</a>} />

        <ResponseField name="triggerData" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-trigger-data-condition-input">MarketingAutomationTriggerDataConditionInput</a>} />
      </Expandable>
    </ResponseField>

    <ResponseField name="nextFalseStepId" type="ID">
      First step when the expression does not match.
    </ResponseField>

    <ResponseField name="nextTrueStepId" type="ID">
      First step when the expression matches.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="end" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-end-step-input">MarketingAutomationEndStepInput</a>}>
  <Expandable title="fields" lazyRender>
    <ResponseField name="customTitle" type="String" />
  </Expandable>
</ResponseField>

<ResponseField name="manageCustomerTags" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-manage-customer-tags-step-input">MarketingAutomationManageCustomerTagsStepInput</a>}>
  <Expandable title="fields" lazyRender>
    <ResponseField name="customTitle" type="String" />

    <ResponseField name="disabled" type="Boolean" />

    <ResponseField name="nextStepId" type="ID" />

    <ResponseField name="operation" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-tag-operation">MarketingAutomationTagOperation</a>} />

    <ResponseField name="tagIds" type="[String!]">
      Customer tag ids: each tag's `id` or `legacyId`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="manageStaticSegment" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-manage-static-segment-step-input">MarketingAutomationManageStaticSegmentStepInput</a>}>
  <Expandable title="fields" lazyRender>
    <ResponseField name="customTitle" type="String" />

    <ResponseField name="disabled" type="Boolean" />

    <ResponseField name="nextStepId" type="ID" />

    <ResponseField name="operation" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-tag-operation">MarketingAutomationTagOperation</a>} />

    <ResponseField name="segmentId" type="String">
      The static segment's `id` or `legacyId`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="sendEmail" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-send-email-step-input">MarketingAutomationSendEmailStepInput</a>}>
  Insertable only when the trigger schema has an Email field (not SMS signup).

  <Expandable title="fields" lazyRender>
    <ResponseField name="customTitle" type="String" />

    <ResponseField name="disabled" type="Boolean" />

    <ResponseField name="emailAddressFieldName" type="String" />

    <ResponseField name="nextStepId" type="ID" />

    <ResponseField name="originTemplateId" type="ID">
      The email template this send is copied from: its `id` or `legacyId`. Its trigger must match the automation's.
    </ResponseField>

    <ResponseField name="recipientNameFieldName" type="String" />

    <ResponseField name="templateId" type="ID">
      The email template to send: its `id`, or its `legacyId` from an earlier version of the Redo API. Its trigger must match the automation's.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="sendSms" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-send-sms-step-input">MarketingAutomationSendSmsStepInput</a>}>
  Insertable only when the trigger schema has a Phone field (not email signup, HSA, or extended warranty).

  <Expandable title="fields" lazyRender>
    <ResponseField name="customTitle" type="String" />

    <ResponseField name="disabled" type="Boolean" />

    <ResponseField name="nextStepId" type="ID" />

    <ResponseField name="phoneNumberFieldName" type="String" />

    <ResponseField name="recipientNameFieldName" type="String" />

    <ResponseField name="templateId" type="ID">
      The SMS template to send: its `id`, or its `legacyId` from an earlier version of the Redo API. Its trigger must match the automation's.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="sendWebhook" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-send-webhook-step-input">MarketingAutomationSendWebhookStepInput</a>}>
  Insert requires an http or https destinationUrl and a payload.

  <Expandable title="fields" lazyRender>
    <ResponseField name="authType" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-webhook-auth-type">MarketingAutomationWebhookAuthType</a>} />

    <ResponseField name="customTitle" type="String" />

    <ResponseField name="destinationUrl" type="String" />

    <ResponseField name="disabled" type="Boolean" />

    <ResponseField name="headers" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-send-webhook-header-input">[MarketingAutomationSendWebhookHeaderInput!]</a>}>
      Replaces the stored header list. Include every header's value.

      <Expandable title="fields" lazyRender>
        <ResponseField name="key" type="String!" required>
          Header name. Letters, numbers, hyphens, and underscores only.
        </ResponseField>

        <ResponseField name="value" type="String!" required>
          Header value. Write-only; reads do not return it.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="nextStepId" type="ID" />

    <ResponseField name="oauth2Config" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-send-webhook-o-auth2-config-input">MarketingAutomationSendWebhookOAuth2ConfigInput</a>}>
      Required on insert when authType is OAUTH2\_CLIENT\_CREDENTIALS, including clientSecret.

      <Expandable title="fields" lazyRender>
        <ResponseField name="audience" type="String" />

        <ResponseField name="clientId" type="String" />

        <ResponseField name="clientSecret" type="String">
          Write-only. Omit on update to keep the stored secret. Never returned.
        </ResponseField>

        <ResponseField name="scope" type="String" />

        <ResponseField name="tokenUrl" type="String" />
      </Expandable>
    </ResponseField>

    <ResponseField name="payload" type="String" />
  </Expandable>
</ResponseField>

<ResponseField name="startAgentConversation" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-start-agent-conversation-step-input">MarketingAutomationStartAgentConversationStepInput</a>}>
  Start a Commerce Agent conversation. Insertable when Commerce Agent is enabled, the trigger supports it, and the trigger schema has an Email or Phone field. Requires strategyId.

  <Expandable title="fields" lazyRender>
    <ResponseField name="channel" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-commerce-agent-channel-input">MarketingAutomationCommerceAgentChannelInput</a>}>
      <Expandable title="fields" lazyRender>
        <ResponseField name="extendedOutreach" type="Boolean">
          SMS only. Reach customers who have not subscribed through Recover. Defaults to false.
        </ResponseField>

        <ResponseField name="kind" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-commerce-agent-channel-kind">MarketingAutomationCommerceAgentChannelKind!</a>} required />

        <ResponseField name="subscribers" type="Boolean">
          SMS only. Defaults to true. False needs extendedOutreach true.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="customTitle" type="String" />

    <ResponseField name="disabled" type="Boolean" />

    <ResponseField name="nextStepId" type="ID" />

    <ResponseField name="strategyId" type="ID">
      A CommerceAgentStrategy id from this store. Required on insert.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="variantId" type="ID">
  Which A/B variant arm to attach to.
</ResponseField>

<ResponseField name="wait" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-wait-step-input">MarketingAutomationWaitStepInput</a>}>
  <Expandable title="fields" lazyRender>
    <ResponseField name="customTitle" type="String" />

    <ResponseField name="nextStepId" type="ID" />

    <ResponseField name="numDays" type="Int" />

    <ResponseField name="numSeconds" type="Int" />

    <ResponseField name="timeUnit" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-wait-time-unit">MarketingAutomationWaitTimeUnit</a>} />
  </Expandable>
</ResponseField>

<ResponseField name="waitForEvent" type={<a href="/docs/api-reference/v3/reference/marketing/marketing-automation-wait-for-event-step-input">MarketingAutomationWaitForEventStepInput</a>}>
  <Expandable title="fields" lazyRender>
    <ResponseField name="customTitle" type="String" />

    <ResponseField name="eventType" type="String" />

    <ResponseField name="filter" type={<a href="/docs/api-reference/v3/reference/common/json">JSON</a>} />

    <ResponseField name="nextStepId" type="ID" />
  </Expandable>
</ResponseField>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.