Assign Many Users to a Group
Endpoint
/i/groups/save-many-user-group
Ⓔ Enterprise Only
This API is available exclusively in Countly Enterprise.
Overview
Bulk-assigns many users (by email list) to one group.
Authentication
- Authentication methods:
- API Key (parameter):
api_key=YOUR_API_KEY - Auth Token (parameter):
auth_token=YOUR_AUTH_TOKEN - Auth Token (header):
countly-token: YOUR_AUTH_TOKEN
- API Key (parameter):
Permissions
- Required access: global admin
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes (or auth_token) | API key authentication |
auth_token | String | Yes (or api_key) | Auth token authentication |
args | Object (JSON string) | Yes | Stringified bulk assignment object |
args Object Fields
| Field | Type | Required | Description |
|---|---|---|---|
emails | Array | Yes | User email list |
group_id | String | Yes | Target group ID |
Response
Success Response
{
"result": "Success"
}
Response Fields
| Field | Type | Description |
|---|---|---|
result | String | Operation status |
Error Responses
| HTTP Status | Response |
|---|---|
| 200 | { "result": "Not enough args" } |
| 400 | { "result": "Users not found" } |
| 400 | { "result": "Cannot add Global Admin to group" } |
| 400 | { "result": "Group not found" } |
| 400 | { "result": "Missing parameter \"api_key\" or \"auth_token\"" } |
Behavior/Processing
- Validates
emailsandgroup_id. - Loads target users and group.
- Merges each user permission with group permission.
- Updates users in bulk and updates group member list.
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.members | Endpoint data source | ** - Bulk update target |
countly.groups | Endpoint data source | ** - Group member list update target |
Examples
Example: Assign Many Users
Endpoint form:
https://your-server.com/i/groups/save-many-user-group?api_key=YOUR_API_KEY&args={"emails":["a@example.com","b@example.com","c@example.com"],"group_id":"507f1f77bcf86cd799439011"}
Decoded args object:
{
"emails": [
"a@example.com",
"b@example.com",
"c@example.com"
],
"group_id": "507f1f77bcf86cd799439011"
}
Related Endpoints
Ⓔ Enterprise
This feature is part of Countly Enterprise.
Get Access:
Already a Customer? Use support portal if you have any questions
Last Updated
2026-02-16