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

# Create sequence with steps

> Creates a sequence together with its settings, schedule and whole step tree in one request, instead of creating each node separately.
Steps in a list run one after another. A condition must be the last step of its list; the steps that follow it go in its branches, keyed by branch name (e.g. "yes", "no"). A branch that is left out or empty ends the sequence on that path.
Steps are validated with the same rules as the single node endpoints. If anything is invalid, nothing is created.
The schedule works like the schedule endpoint: a day that is left out is disabled, so list every sending day. Without a schedule the sequence sends Monday to Friday 8 to 18.
Required follow-up conditions (e.g. "request accepted within days" after a LinkedIn connection request) are not added automatically; include them in the tree.



## OpenAPI

````yaml https://multichannel-api.salesforge.ai/public/multichannel/swagger/doc.json post /multichannel/workspaces/{workspaceID}/sequences/tree
openapi: 3.1.0
info:
  description: Multichannel public endpoints consumed through salesforge-api public docs.
  title: Multichannel Public API
  version: '1.0'
servers:
  - url: https://multichannel-api.salesforge.ai/public
security:
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
  - ApiKeyAuth: []
externalDocs:
  description: ''
  url: ''
paths:
  /multichannel/workspaces/{workspaceID}/sequences/tree:
    post:
      tags:
        - Sequences
      summary: Create sequence with steps
      description: >-
        Creates a sequence together with its settings, schedule and whole step
        tree in one request, instead of creating each node separately.

        Steps in a list run one after another. A condition must be the last step
        of its list; the steps that follow it go in its branches, keyed by
        branch name (e.g. "yes", "no"). A branch that is left out or empty ends
        the sequence on that path.

        Steps are validated with the same rules as the single node endpoints. If
        anything is invalid, nothing is created.

        The schedule works like the schedule endpoint: a day that is left out is
        disabled, so list every sending day. Without a schedule the sequence
        sends Monday to Friday 8 to 18.

        Required follow-up conditions (e.g. "request accepted within days" after
        a LinkedIn connection request) are not added automatically; include them
        in the tree.
      parameters:
        - description: Workspace ID
          in: path
          name: workspaceID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                - $ref: '#/components/schemas/requests.CreateSequenceTreeRequest'
                  description: >-
                    Create sequence with steps request. The timezone field is
                    required and accepts only IANA time zone names (e.g.,
                    America/New_York).
                  summary: request
        description: >-
          Create sequence with steps request. The timezone field is required and
          accepts only IANA time zone names (e.g., America/New_York).
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.CreateSequenceTreeResponse'
          description: Created
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
          description: Forbidden
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    requests.CreateSequenceTreeRequest:
      properties:
        description:
          type: string
        kind:
          enum:
            - primary
            - subsequence
          type: string
        name:
          type: string
        schedule:
          $ref: '#/components/schemas/dto.Schedule'
        settings:
          $ref: '#/components/schemas/requests.SequenceSettingsInput'
        steps:
          items:
            $ref: '#/components/schemas/requests.SequenceTreeStepRequest'
          type: array
          uniqueItems: false
        timezone:
          example: America/New_York
          type: string
        timezoneMode:
          description: >-
            TimezoneMode is "sequence" (default: the schedule runs in timezone)
            or "lead" (in each

            lead's timezone, with timezone as the fallback).
          enum:
            - sequence
            - lead
          type: string
      required:
        - name
        - timezone
      type: object
    responses.CreateSequenceTreeResponse:
      properties:
        nodes:
          items:
            $ref: '#/components/schemas/responses.SequenceTreeNodeResponse'
          type: array
          uniqueItems: false
        sequence:
          $ref: '#/components/schemas/responses.CreateSequenceResponse'
      type: object
    responses.ErrorResponse:
      properties:
        data:
          description: >-
            Optional error context. Its shape depends on the message and
            endpoint.
        message:
          description: >-
            Human-readable error text or, for documented cases, a stable
            machine-readable code that clients can branch on.
          example: Invalid request body
          type: string
      type: object
    dto.Schedule:
      properties:
        friday:
          $ref: '#/components/schemas/dto.DaySchedule'
        monday:
          $ref: '#/components/schemas/dto.DaySchedule'
        saturday:
          $ref: '#/components/schemas/dto.DaySchedule'
        sunday:
          $ref: '#/components/schemas/dto.DaySchedule'
        thursday:
          $ref: '#/components/schemas/dto.DaySchedule'
        tuesday:
          $ref: '#/components/schemas/dto.DaySchedule'
        wednesday:
          $ref: '#/components/schemas/dto.DaySchedule'
      type: object
    requests.SequenceSettingsInput:
      properties:
        bcc:
          type: string
        bounceShieldEnabled:
          type: boolean
        cc:
          type: string
        ccAndBccEnabled:
          type: boolean
        clickTrackingEnabled:
          type: boolean
        companyOutreachLimitCount:
          type: integer
        companyOutreachLimitEnabled:
          type: boolean
        espMatchingEnabled:
          type: boolean
        localizedOptOutEnabled:
          type: boolean
        openTrackingEnabled:
          type: boolean
        opportunitiesValue:
          type: number
        optOutLinkEnabled:
          type: boolean
        optOutLinkText:
          type: string
        optOutText:
          type: string
        optOutTextEnabled:
          type: boolean
        pauseOnClick:
          type: boolean
        pauseOnOpen:
          type: boolean
        plainTextEmailsEnabled:
          type: boolean
        sendingPriority:
          enum:
            - regular
            - high
          type: string
        sequentialCompanySendingEnabled:
          type: boolean
        taskPriorityPolicy:
          enum:
            - new_contacts
            - followups_first
          example: new_contacts
          type: string
        trackOpportunitiesEnabled:
          type: boolean
      type: object
    requests.SequenceTreeStepRequest:
      properties:
        actionId:
          example: 3
          type: integer
        branches:
          additionalProperties:
            items:
              $ref: '#/components/schemas/requests.SequenceTreeStepRequest'
            type: array
          type: object
        conditionId:
          type: integer
        distributionStrategy:
          enum:
            - equal
            - custom
          type: string
        metadata:
          $ref: '#/components/schemas/requests.ConditionMetadataRequest'
        ref:
          example: intro-email
          maxLength: 100
          type: string
        type:
          enum:
            - action
            - condition
          example: action
          type: string
        variants:
          items:
            $ref: '#/components/schemas/requests.SequenceTreeVariantRequest'
          type: array
          uniqueItems: false
        waitInMinutes:
          example: 1440
          minimum: 0
          type: integer
      required:
        - type
      type: object
    responses.SequenceTreeNodeResponse:
      properties:
        actionId:
          type: integer
        analytics:
          $ref: '#/components/schemas/dto.NodeAnalyticsDTO'
        branches:
          items:
            $ref: '#/components/schemas/responses.NodeBranchResponse'
          type: array
          uniqueItems: false
        conditionId:
          type: integer
        distributionStrategy:
          type: string
        id:
          type: integer
        ref:
          type: string
        sequenceId:
          type: integer
        type:
          type: string
        variants:
          items:
            $ref: '#/components/schemas/responses.NodeVariantResponse'
          type: array
          uniqueItems: false
        waitInMinutes:
          type: integer
        waitType:
          type: string
      type: object
    responses.CreateSequenceResponse:
      properties:
        builderMode:
          type: string
        description:
          type: string
        id:
          type: integer
        kind:
          type: string
        name:
          type: string
        settings:
          $ref: '#/components/schemas/responses.SequenceSettingsResponse'
        status:
          type: string
        timezone:
          type: string
        timezoneMode:
          enum:
            - sequence
            - lead
          type: string
      type: object
    dto.DaySchedule:
      properties:
        enabled:
          type: boolean
        from:
          maximum: 23
          minimum: 0
          type: integer
        to:
          maximum: 23
          minimum: 0
          type: integer
      type: object
    requests.ConditionMetadataRequest:
      properties:
        allowedValidationStatuses:
          items:
            type: string
          type: array
          uniqueItems: false
      type: object
    requests.SequenceTreeVariantRequest:
      properties:
        exposureInPercentage:
          example: 100
          maximum: 100
          type: integer
        isEnabled:
          example: true
          type: boolean
        metadata:
          $ref: '#/components/schemas/requests.SequenceTreeVariantMetadataRequest'
      type: object
    dto.NodeAnalyticsDTO:
      properties:
        active:
          type: integer
        completed:
          type: integer
        endValue:
          type: integer
        failed:
          type: integer
      type: object
    responses.NodeBranchResponse:
      properties:
        analytics:
          $ref: '#/components/schemas/dto.BranchAnalyticsDTO'
        description:
          type: string
        fromNodeId:
          type: integer
        id:
          type: integer
        name:
          type: string
        toNodeId:
          type: integer
      type: object
    responses.NodeVariantResponse:
      properties:
        exposureInPercentage:
          type: number
        id:
          type: integer
        isEnabled:
          type: boolean
        metadata:
          $ref: '#/components/schemas/responses.MetadataResponse'
        nodeId:
          type: integer
      type: object
    responses.SequenceSettingsResponse:
      properties:
        bcc:
          type: string
        bounceShieldEnabled:
          type: boolean
        cc:
          type: string
        ccAndBccEnabled:
          type: boolean
        clickTrackingEnabled:
          type: boolean
        companyOutreachLimitCount:
          type: integer
        companyOutreachLimitEnabled:
          type: boolean
        espMatchingEnabled:
          type: boolean
        localizedOptOutEnabled:
          type: boolean
        openTrackingEnabled:
          type: boolean
        opportunitiesValue:
          type: number
        optOutLinkEnabled:
          type: boolean
        optOutLinkText:
          type: string
        optOutText:
          type: string
        optOutTextEnabled:
          type: boolean
        pauseOnClick:
          type: boolean
        pauseOnOpen:
          type: boolean
        plainTextEmailsEnabled:
          type: boolean
        sendingPriority:
          enum:
            - regular
            - high
          type: string
        sequentialCompanySendingEnabled:
          type: boolean
        taskPriorityPolicy:
          enum:
            - new_contacts
            - followups_first
          example: new_contacts
          type: string
        trackOpportunitiesEnabled:
          type: boolean
      type: object
    requests.SequenceTreeVariantMetadataRequest:
      properties:
        message:
          example: Hi, are you the right person to talk to about outbound?
          type: string
        name:
          example: Variant A
          type: string
        subject:
          example: Quick question
          type: string
      type: object
    dto.BranchAnalyticsDTO:
      properties:
        count:
          type: integer
        percentage:
          type: number
      type: object
    responses.MetadataResponse:
      properties:
        allowedValidationStatuses:
          items:
            type: string
          type: array
          uniqueItems: false
        contentSource:
          $ref: '#/components/schemas/dto.ContentSource'
        message:
          type: string
        name:
          type: string
        subject:
          type: string
      type: object
    dto.ContentSource:
      enum:
        - api
        - tiptap
        - agent
      type: string
      x-enum-varnames:
        - ContentSourceAPI
        - ContentSourceTipTap
        - ContentSourceAgent
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: Authorization
      type: apiKey

````

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