Sequences

Enroll a person in a sequence

Enrolls a People record in a live sequence. Requires a USER API key. Returns the created instance. enrollerUserId optionally enrolls on behalf of a different user of the same account, who becomes enrolledByUserId, the sender's owner, and the [User] variable source — gated by the account's enrollOnBehalfPolicy (see the account sequence settings endpoint); omitted or equal to the API key's user, behavior is unchanged. Errors use details.code: ON_BEHALF_NOT_ALLOWED (403, policy doesn't allow it), ENROLLER_NOT_FOUND (400, target user doesn't exist, isn't active, belongs to another account, or has no authId), ENROLLER_CANNOT_OPERATE_SEQUENCE (403, target user lacks permission on this sequence).

post/public/v1/sequences/{sequenceId}/enrollments

Path parameters

sequenceIdnumber nullable
Example:101

Headers

idempotency-keystring
Example:example value

Request body

personRowIdstring required
senderConnectedAccountIdinteger
overrideConflictboolean
overrideDoNotContactboolean
replaceInstanceIdinteger
enrollerUserIdinteger

Example request

{
  "personRowId": "example",
  "senderConnectedAccountId": 1,
  "replaceInstanceId": 1,
  "enrollerUserId": 1
}

Response

Previously completed idempotent enrollment

Example response

{
  "instance": {
    "id": 1,
    "accountId": 1,
    "sequenceId": 1,
    "personRowId": "example",
    "snapshotId": "example",
    "sourceSnapshotId": "example",
    "snapshotPinnedAt": "example",
    "currentNodeId": "example",
    "status": "ACTIVE",
    "blockedOn": "NONE",
    "nextExecutionAt": "example",
    "enrolledByUserId": 1,
    "senderConnectedAccountId": 1,
    "startedAt": "example",
    "lastAdvancedAt": "example",
    "exitedAt": "example",
    "completedAt": "example",
    "pausedAt": "example",
    "removedAt": "example",
    "exitReason": "example",
    "exitNote": "example",
    "exitedByUserId": 1,
    "failureReason": "example",
    "failureCode": "example",
    "createdAt": "example",
    "updatedAt": "example",
    "enrolledByUser": {
      "id": 1,
      "firstName": "example",
      "lastName": "example",
      "email": "user@example.com",
      "avatar": "example"
    },
    "exitedByUser": {
      "id": 1,
      "firstName": "example",
      "lastName": "example",
      "email": "user@example.com",
      "avatar": "example"
    }
  },
  "activeSequenceSummary": {
    "instances": [
      {
        "instanceId": 1,
        "restricted": true
      }
    ],
    "activeCount": 1,
    "maxAllowed": 1,
    "blockedCode": "ACTIVE_SEQUENCE_CONFLICT",
    "blockedReason": "example"
  }
}

Changes

Changed in 1 of the 2 revisions of this API.1