Skip to content

Enrollment methods: cancel, pause, resume

The Enrollment Verbs cancel, pause, resume as typed SDK methods, with inputs, result, refusals and an example.

Reference for Enrollment, one group of Enrollment methods.

Enrollment.cancel

Cancel ends one Contact’s run through a Sequence for good, with the reason it records as exitReason. Verb page.

TypeScript
interface EnrollmentVerbs {
  cancel(input: EnrollmentCancelInput, options?: SB.CallOptions): SB.Call<Enrollment>
}

Emits Enrollment.canceled.

Inputs

InputTypeRequiredDescription
enrollmentEnrollmentrequiredThe Enrollment to end.
reasonstringrequiredWhy it ends.

Returns

OutputTypeRequiredDescription
enrollmentEnrollmentrequiredThe Enrollment, now exited.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const enrollment = await $.Enrollment.cancel({ enrollment: 'enrollment_t2LKaLorKn', reason: 'replied' })

Enrollment.pause

Pause stops one Contact’s run through a Sequence at its current step, without ending it. Verb page.

TypeScript
interface EnrollmentVerbs {
  pause(input: EnrollmentPauseInput, options?: SB.CallOptions): SB.Call<Enrollment>
}

Emits Enrollment.paused.

Inputs

InputTypeRequiredDescription
enrollmentEnrollmentrequiredThe Enrollment to pause.

Returns

OutputTypeRequiredDescription
enrollmentEnrollmentrequiredThe Enrollment, now paused.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const enrollment = await $.Enrollment.pause({ enrollment: 'enrollment_t2LKaLorKn' })

Enrollment.resume

Resume restarts a paused run at the step it stopped on and sets when that step fires. Verb page.

TypeScript
interface EnrollmentVerbs {
  resume(input: EnrollmentResumeInput, options?: SB.CallOptions): SB.Call<Enrollment>
}

Emits Enrollment.resumed.

Inputs

InputTypeRequiredDescription
enrollmentEnrollmentrequiredThe paused Enrollment.

Returns

OutputTypeRequiredDescription
enrollmentEnrollmentrequiredThe Enrollment, active again.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const enrollment = await $.Enrollment.resume({ enrollment: 'enrollment_t2LKaLorKn' })