Manage

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

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