Add members to a group
POST/tap/api/v1/groups/:groupId/members
Adds one or more users to a group. Every ID is checked, in order, before any membership is written, so a 400, 403, or 404 response adds no one and reports the first ID that fails. Users already in the group are skipped. Each membership stores a copy of the user's fullName, email, and userRole. Requires the admin role.
Request
Responses
- 200
- 400
- 403
- 404
- 500
The memberships that were created.
The request body has neither userId nor userIds, userIds is empty, or an ID is not a decimal number ("Invalid user ID: {id}").
The caller does not have the admin role, or one of the users is a super_admin and the caller is not.
The group was not found ("Group not found."), or an ID is not a user ("User not found: {id}"). A server ID is treated as not found, in userId and in userIds alike.
The request body is malformed: not a JSON object, userId is null, or userIds is not an array of IDs. A membership that cannot be saved is left out of data instead of causing an error.