Skip to content

Enrollment routes: update, delete

The Enrollment Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.

Reference for Enrollment, one group of Enrollment routes.

Enrollment.update

Changes the given properties of an Enrollment. Verb page.

Text
PATCH /{namespace}/enrollments/{id}

Path: id. Body, as JSON: the other inputs. Emits Enrollment.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Enrollment.
stepstringThe Sequence step the person is on.
nextAtdatetimeWhen the next step fires; empty while paused or exited.
branchesstring[]The branches taken so far, in order.
exitReasonstringWhy the run ended.

Returns

OutputTypeRequiredDescription
enrollmentEnrollmentrequiredThe Enrollment.

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

Terminal
curl -X PATCH https://api.sb/leaseline.app/enrollments/enrollment_t2LKaLorKn \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"nextAt":"2026-10-22T12:00:00Z"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "enrollment": {
    "$id": "https://api.sb/leaseline.app/enrollments/enrollment_t2LKaLorKn",
    "$type": "Enrollment",
    "status": "active",
    "step": "Example step",
    "nextAt": "2026-10-22T12:00:00Z"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Enrollment.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Enrollment.delete

Deletes an Enrollment: a soft delete that keeps its history, undone by Thing.restore. Verb page.

Text
DELETE /{namespace}/enrollments/{id}

Path: id. Emits Enrollment.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Enrollment.

Returns

OutputTypeRequiredDescription
enrollmentEnrollmentrequiredThe Enrollment.

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

Terminal
curl -X DELETE https://api.sb/leaseline.app/enrollments/enrollment_t2LKaLorKn \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "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.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}