View all methods
userGroups.update
Updates an existing user group. You can update the name and/or the group members.
Facts
| Method | POST https://api.getdx.com/userGroups.update |
| Required scope | user_groups:write |
Arguments
Required arguments
| Name | Type | Description |
|---|---|---|
token |
Token |
Auth token passed as an HTTP header. |
id |
Text |
The group ID. |
Optional arguments
| Name | Type | Description |
|---|---|---|
name |
Text |
The new name for the group. |
members |
Array<Text> |
Array of email addresses to replace current group members. |
Example request
This is a typical request:
curl -X POST https://api.getdx.com/userGroups.update \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx' \
-d '{
"id": "group_id",
"name": "Updated Frontend Team",
"members": ["user1@company.com", "user3@company.com"]
}'
Example response
This is a typical success response:
{
"ok": true,
"group": {
"id": "group_id",
"name": "Updated Frontend Team",
"owner_id": "owner_id",
"owner_email": "owner@company.com",
"team_id": "team_id",
"members": [
{
"id": "user_id",
"email": "user1@company.com",
"name": "John Doe"
},
{
"id": "user_id_2",
"email": "user3@company.com",
"name": "Jane Smith"
}
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:45:00Z"
}
}
Errors
This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok param in the response.
| Error | Description |
|---|---|
not_authed |
No authentication token provided. |
invalid_auth |
Some aspect of authentication cannot be validated. |
not_found |
Group with the specified ID not found. |
validation_failed |
One or more supplied parameters did not pass validation. |
group_members_limit_exceeded |
Group members limit exceeded (max 100 members per group). |
Notes
- Group member updates replace the entire member list - to add a single member, include all existing members plus the new one
- At least one of
nameormembersmust be provided in the request