Adding Users to User Groups

Prerequisites

  • Permission: data:user_group:manage for the target group

  • Users must exist in the system

API Endpoint

POST /groups/members?identifier={group_identifier}

Request Body

{
  "principals": [
    "123e4567-e89b-12d3-a456-426614174000",
    "987fcdeb-51a2-43d7-8901-234567890abc"
  ]
}

Fields:

  • principals (required): Array of user UUIDs to add

Response

{
  "ok": true
}

Example:

curl -X POST "https://api.example.com/groups/members?identifier=550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "principals": [
      "123e4567-e89b-12d3-a456-426614174000",
      "987fcdeb-51a2-43d7-8901-234567890abc"
    ]
  }'

Notes

  • Users can belong to multiple groups

  • Adding a user already in the group is idempotent

  • Users immediately inherit all roles assigned to the group

Last updated