Add users by email
Add users from a list of email addresses to a department and optional groups.
POST https://cotlet.dev/api/v1/ispring/departments/{department_id}/users-by-emails
write Confirm
Runs Users, Export/Import, Add users by email: up to 50 emails per call, one department, and up to 5 groups. An email that already belongs to a user is added to the groups and stays in their current department. Only the Account Owner and Account Administrators can use this. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| emails string[] required | string[] | Up to 50 email addresses. |
| department_id string required | string | Department from list_departments. |
| group_ids string[] | string[] | Up to 5 groups from list_groups. |
Request
curl -X POST https://cotlet.dev/api/v1/ispring/departments/department_8c41d2/users-by-emails \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"emails":["jane@example.com"]}' result = client.call("ispring", "add_users_by_email", {"emails":["jane@example.com"],"department_id":"department_8c41d2"}) const result = await cotlet.call('ispring', 'add_users_by_email', {"emails":["jane@example.com"],"department_id":"department_8c41d2"}); cotlet call ispring add_users_by_email --data '{"emails":["jane@example.com"],"department_id":"department_8c41d2"}' Example response
{
"added": 2,
"existing": 0,
"users": [
{
"user_id": "u_a1f003",
"email": "new.hire1@example.com",
"department": "Support"
},
{
"user_id": "u_a1f004",
"email": "new.hire2@example.com",
"department": "Support"
}
]
}