Manage

Deprecation

This endpoint will be discounted due to an upcoming auto-enrollment feature planned for 2022. We do not recommend using this endpoint as it will be disabled once auto-enrollment is released.

The Manage endpoint allows for bulk enrolments of users for a single pathway. You can add (enroll) and remove (unenroll) users by email.

Email addresses in the add parameter must be active users on the app the pathway is published. This ensures that the user has agreed to any terms and permissions beforehand.

Parameters

Key

Type

REQUIRED

pathway

String (The pathway name or SKU code)

OPTIONAL

add

Array of Strings (valid emails)

remove

Array of Strings (valid emails)

Example

The example below adds the user "test@example.com" and removes the user "test2@example.com" from the "My Pathway" pathway. When adding users to a pathway it will only insert active users or users that are not already enrolled on the pathway.

curl -X POST \
  v1/pathways/manage \
  -H 'Authorization: Basic <Your Base64 Encoded Token>' \
  -d '{
	"pathway" : "My Pathway",
	"add"     : ["test@example.com"],
	"remove"  : ["test2@example.com"]
}'

Success Response

Inserts & Deletes The response will contain information about how many users where inserted & deleted. An insert will only occur if the email was not currently enrolled on the pathway. A deletion will only occur if the email was currently enrolled on the pathway.

{
    "status": "success",
    "data": {
        "inserts": 1,
        "deletes": 1,
        "warnings": 0
    },
    "hash": "91e3623eedaff4fcc33aab795ab204aa",
    "response_time": 0.153076171875
}

Success Response With Warning

If there are any issues detected with the add or remove parameter a warning will occur. If the response has a warning an array of messages will detail what went wrong.

{
    "status": "success",
    "data": {
        "inserts": 0,
        "deletes": 0,
        "warnings": 2,
        "messages": [
            {
                "parameter": "add",
                "index": 0,
                "error": "Email not an active user on App Name"
            },
            {
                "parameter": "remove",
                "index": 0,
                "error": "The provided string was not a valid email"
            }
        ]
    },
    "hash": "fca940ab1d6277ea070bc881d9680571",
    "response_time": 0.14357209205627441
}

Last updated