Skip to main content

Enroll a selected sequence audience

Enroll leads using a server-side selection descriptor or explicit Lead IDs.

POST/api/sequences/{sequence_id}/audience/enroll
HTTP referenceScope User session required; developer API keys unsupportedUpdated October 16, 2026

This page documents the canonical HTTP contract for this endpoint.

Requires an authenticated user session. The current HTTP scope resolver rejects developer API keys, even though the operation catalog declares command scopes.

selection follows this exact structure: {"mode":"ids","ids":["<LEAD_ID>"]} or {"mode":"descriptor","descriptor":{"root":{"kind":"rule","field":"lead_status","operator":"eq","value":"qualified"}}}. The shared selection object may also carry search, sort, limit, scope, source_table_id, and source_table_scope; descriptor selections use descriptor.root directly (no extra filter or filters wrapper). This is the selection-based counterpart to exact-ID enrollment. The server resolves selection criteria; callers do not need to expand every matching Lead ID themselves. Provide exactly one of selection or leadIds.

The queued response confirms asynchronous admission. Poll GET /api/operation-runs/{operation_run_id} using the returned operationRunId or operation_run_id for canonical progress. Developer keys need jobs:read for that read; this enrollment route itself still requires a user session. The native task_id is available through bulk-job status for executor diagnostics.

If no leads are eligible, the API returns status=noop. Without an idempotency key, task_id=null and no operation ID is returned. With idempotencyKey, the server persists a terminal no-op outcome and returns task and canonical operation IDs for replay. Inspect skip reasons and poll only identities actually returned.

Native Command Center enrollment remains sensitive under Approve for me, including manual-only or review-only enrollment; automatic sequence activation does not approve adding Leads. Combined launch-and-enroll actions also require approval. HTTP and CLI keep their existing explicit authenticated invocation and scope requirements.

Normal enrollment requires an ACTIVE sequence. reviewOnly=true is a mutating staging action: it creates paused enrollment records and skips sending side effects, including when the sequence is DRAFT or PAUSED. Use audience preview for read-only eligibility checks. A table-linked selection must identify CRM Lead records, typically from a Sync to Leads result.

Path parameters

  • sequence_idrequired

    string

    Sequence ID.

Query parameters

  • actorUserId · optional

    string | null

    Optional actor override, resolved as a same-organization active user.

Body parameters

  • assignedToUserId · optional

    string | null

    Assignee for generated sequence tasks.

  • assignmentPlan · optional

    array<object> | null

    Optional assignment routes.

  • idempotencyKey · optional

    string | null

    Optional 8-200 character key for retrying the same admission input. maxLength: 200; minLength: 8

  • leadIds · optional

    array<string> | null

    Explicit existing CRM Lead IDs. Provide this or selection.

  • processLimit · optional

    integer | null

    Optional upper bound on leads processed.

  • researchContext · optional

    object | null

    Optional research context attached to generated tasks.

  • reviewOnly · optional

    boolean | null

    Stage paused enrollment records and skip sending side effects. This mutation also permits DRAFT or PAUSED sequences; use audience preview for read-only checks.

  • routingMode · optional

    string | null

    single, round_robin, or weighted_round_robin. enum: ["single","round_robin","weighted_round_robin"]

  • scope · optional

    string | null

    Lead selection scope.

  • selection · optional

    BulkSelectionModel | null

    BulkSelectionModel: {mode:"ids",ids:[...]} or {mode:"descriptor",descriptor:{root:<FilterNode>}}. Descriptor root is a rule or group with kind, field/operator/value or logic/children. Provide this or leadIds.

  • senderAccountIds · optional

    object | null

    Optional channel-to-sender account IDs.

  • senderBindings · optional

    object | null

    Optional explicit sender bindings.

  • skipActiveSequenceConflicts · optional

    boolean | null

    Override the selected sequence conflict policy. Omitted/null inherits the sequence setting; explicitly send true for the CRM operation default. Account exclusions remain sequence-level.

  • sourceTableId · optional

    string | null

    Research table context for resolving a descriptor selection.

  • sourceTableScope · optional

    string | null

    Research table scope, such as company or lead.

  • startDate · optional

    string | null

    Optional enrollment start timestamp.

  • updateLeadOwner · optional

    boolean | null

    Update each Lead owner to the resolved assignee.

  • variableMap · optional

    object | null

    Optional sequence variable mapping.

  • variableOverrides · optional

    object | null

    Optional variable overrides.

Definitions

BulkSelectionModel

Fields

  • descriptor · optional

    FilterDescriptor | null

  • ids · optional

    array<string> | null

  • include_skipped · optional

    boolean | null

  • limit · optional

    integer | null

  • moderequired

    string

    pattern: "^(ids|descriptor)$"

  • scope · optional

    string | null

  • search · optional

    string | null

  • sort · optional

    array<SortSpecModel> | null

  • source_table_id · optional

    string | null

  • source_table_scope · optional

    string | null

FilterDescriptor

Fields

  • rootrequired

    RuleNode | GroupNode

RuleNode

Fields

  • fieldrequired

    string

  • kind · optional

    string

    default: "rule"

  • operatorrequired

    string

  • value · optional

    JSON value | null

  • values · optional

    array<JSON value> | null

GroupNode

Fields

  • childrenrequired

    array<RuleNode | GroupNode>

  • kind · optional

    string

    default: "group"

  • logicrequired

    GroupLogic

    enum: ["and","or","not"]

GroupLogic

SortSpecModel

Fields

  • day_end · optional

    string | null

  • day_start · optional

    string | null

  • direction · optional

    SortDirection

    default: "asc"; enum: ["asc","desc"]

  • fieldrequired

    string

SortDirection

Errors

StatusMeaning
400Provide selection or leadIds; invalid selection or actor.
401Missing or invalid user session.
403Developer API keys are not supported on this route.
409Idempotency key was reused with different input, or the sequence must be ACTIVE.

Docs