> For the complete documentation index, see [llms.txt](https://everyday-digital.gitbook.io/falkor-dev-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://everyday-digital.gitbook.io/falkor-dev-docs/pathways/enrolments/manage.md).

# Manage

{% hint style="danger" %}
**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.
{% endhint %}

The Manage endpoint allows for bulk enrolments of users for a single [pathway](https://docs.falkor.io/pathways/create-a-pathway). You can add (enroll) and remove (unenroll) users by email.&#x20;

{% hint style="warning" %}
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.
{% endhint %}

### 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.&#x20;

```
{
    "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. &#x20;

```
{
    "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
}
```
