We are launching all new Klivolks 3.0See what is new

User Groups

Create groups and roles, list them by type and manage their members.

Everything in KPass — user roles, user types, departments, arbitrary groups, and permissions themselves — is stored as one kind of group, distinguished by its Group Type. Groups can contain users or other groups, so a role can inherit from another role or department.

Create a group — groupType can be user-role, user-type, or any custom type (never permission; use the Permissions endpoints for those):

curl -X POST https://kpass.one/api/v1/groups \
  -H "X-Client-Id: YOUR_CLIENT_ID" \
  -H "X-Api-Secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "groupName": "Support Agent",
    "slug": "support-agent",
    "groupType": "user-role",
    "userType": "customer"
  }'

groupName is the display label; slug is the stable key stored on users and sent in events (generated from the label when omitted, unique per organisation and groupType, and not changeable through the API). A user-role must give the userType: the slug (or id) of an existing user type, e.g. customer; every group response includes slug (and roles userType).

List groups, optionally filtered by type:

curl "https://kpass.one/api/v1/groups?groupType=user-role" \
  -H "X-Client-Id: YOUR_CLIENT_ID" \
  -H "X-Api-Secret: YOUR_API_SECRET"

Add a member (a user or another group) to a group:

curl -X POST https://kpass.one/api/v1/groups/GROUP_ID/members \
  -H "X-Client-Id: YOUR_CLIENT_ID" \
  -H "X-Api-Secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "memberId": "USER_OR_GROUP_ID",
    "memberType": "user"
  }'