Enrollment routes: cancel, pause, resume
The Enrollment Verbs cancel, pause, resume as api.sb routes, with inputs, result, refusals and an example.
Reference for Enrollment, one group of Enrollment routes.
Enrollment.cancel
Cancel ends one Contact’s run through a Sequence for good, with the reason it records as exitReason. Verb page.
POST /{namespace}/ enrollments/ {enrollment}/ cancelPath: enrollment. Body, as JSON: the other inputs. Emits Enrollment.canceled.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
enrollment | Enrollment | required | The Enrollment to end. |
reason | string | required | Why it ends. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
enrollment | Enrollment | required | The Enrollment, now exited. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X POST https: //api.sb/ leaseline.app/ enrollments/ enrollment_t2LKaLorKn/ cancel \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"reason": "replied"}'{
"api": "https: //api.sb/ leaseline.app",
"enrollment": {
"$id": "https: //api.sb/ leaseline.app/ enrollments/ enrollment_t2LKaLorKn",
"$type": "Enrollment",
"status": "active",
"step": "Example step"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Enrollment.cancel",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}Enrollment.pause
Pause stops one Contact’s run through a Sequence at its current step, without ending it. Verb page.
POST /{namespace}/ enrollments/ {enrollment}/ pausePath: enrollment. Emits Enrollment.paused.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
enrollment | Enrollment | required | The Enrollment to pause. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
enrollment | Enrollment | required | The Enrollment, now paused. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X POST https: //api.sb/ leaseline.app/ enrollments/ enrollment_t2LKaLorKn/ pause \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ leaseline.app",
"enrollment": {
"$id": "https: //api.sb/ leaseline.app/ enrollments/ enrollment_t2LKaLorKn",
"$type": "Enrollment",
"status": "active",
"step": "Example step"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Enrollment.pause",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}Enrollment.resume
Resume restarts a paused run at the step it stopped on and sets when that step fires. Verb page.
POST /{namespace}/ enrollments/ {enrollment}/ resumePath: enrollment. Emits Enrollment.resumed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
enrollment | Enrollment | required | The paused Enrollment. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
enrollment | Enrollment | required | The Enrollment, active again. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X POST https: //api.sb/ leaseline.app/ enrollments/ enrollment_t2LKaLorKn/ resume \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ leaseline.app",
"enrollment": {
"$id": "https: //api.sb/ leaseline.app/ enrollments/ enrollment_t2LKaLorKn",
"$type": "Enrollment",
"status": "active",
"step": "Example step"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Enrollment.resume",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}