Add a user to a group
Endpoint URL
POST /api/v2/group-memberships
Adds a user to a group. Set enroll_to_courses to true to synchronously enroll the user in the group's active courses regardless of the group's auto-enroll setting. When false or omitted, the endpoint does not force course enrollment and the group's normal auto-enroll behavior remains in effect.
Request
Responses
- 204
- 400
- 401
- 404
Group membership created
Invalid request. Returned when the JSON body is empty or malformed; user_id or group_id is missing, not an integer, or not positive; enroll_to_courses is not a boolean; or the group membership cannot be created, including when the user already belongs to the group.
Unauthorized. Returned when Public API access is disabled or the API key is missing or invalid.
Not found. Returned when the requested group or user does not exist.