Add users to group
Add existing or new users to a group by email.
POST https://cotlet.dev/api/v1/learnupon/groups/{group_id}/users-to-groups
write Confirm
Adds the users to one group. An email without an account in the portal gets an invite and stays pending until it is accepted. With process_enrollments true, users are enrolled on courses assigned to the group. Removing a user from a group by hand does not unenroll them. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| group_id string required | string | Group id from list_groups. |
| emails array required | array | Email addresses to add. |
| process_enrollments boolean | boolean | Enroll on courses assigned to the group. Default: true. |
Request
curl -X POST https://cotlet.dev/api/v1/learnupon/groups/group_8c41d2/users-to-groups \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"emails":"jane@example.com"}' result = client.call("learnupon", "add_users_to_group", {"group_id":"group_8c41d2","emails":"jane@example.com"}) const result = await cotlet.call('learnupon', 'add_users_to_group', {"group_id":"group_8c41d2","emails":"jane@example.com"}); cotlet call learnupon add_users_to_group --data '{"group_id":"group_8c41d2","emails":"jane@example.com"}' Example response
{
"group_id": "4902",
"added": 2,
"invited": 1
}