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

Parameters: add_users_to_group
NameTypeDescription
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
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"}'
Python
result = client.call("learnupon", "add_users_to_group", {"group_id":"group_8c41d2","emails":"jane@example.com"})
Node.js
const result = await cotlet.call('learnupon', 'add_users_to_group', {"group_id":"group_8c41d2","emails":"jane@example.com"});
CLI
cotlet call learnupon add_users_to_group --data '{"group_id":"group_8c41d2","emails":"jane@example.com"}'

Example response

JSON

{
  "group_id": "4902",
  "added": 2,
  "invited": 1
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.