Skip to content

Groups

Groups provide a hierarchical way to organize users. Users inherit all roles assigned to their group and all ancestor groups. This lets you model org structures without manually assigning roles to every user.

Required scopes: groups:read for GET requests, groups:write for POST / PUT / DELETE.


{
"id": 3,
"name": "Engineering",
"description": "Engineering team",
"parentGroupId": null,
"tenantId": 1
}
FieldTypeDescription
idintegerInternal numeric ID
namestringGroup name
descriptionstring | nullOptional description
parentGroupIdinteger | nullParent group ID for hierarchy, or null for root groups
tenantIdintegerThe workspace this group belongs to

GET /t/{slug}/api/v1/groups

Returns all groups in the workspace, including nested groups.

Example request:

Terminal window
curl https://auth.yourdomain.com/t/my-app/api/v1/groups \
-H "Authorization: Bearer kauth_my-app_KEY"

Response 200 OK:

{
"data": [
{ "id": 3, "name": "Engineering", "description": null, "parentGroupId": null, "tenantId": 1 },
{ "id": 4, "name": "Backend", "description": null, "parentGroupId": 3, "tenantId": 1 }
],
"meta": { "total": 2, "offset": 0, "limit": 20 }
}

POST /t/{slug}/api/v1/groups

Request body:

{
"name": "Backend",
"description": "Backend engineering",
"parentGroupId": 3
}
FieldRequiredDescription
nameYesGroup name (non-empty)
descriptionNoOptional description
parentGroupIdNoID of parent group. Omit for a root group.

Response 201 Created: Returns the created group object.


GET /t/{slug}/api/v1/groups/{groupId}

Response 200 OK: Returns the group object.


PUT /t/{slug}/api/v1/groups/{groupId}

Request body:

{
"name": "Backend Platform",
"description": "Updated description"
}

Response 200 OK: Returns the updated group object.


DELETE /t/{slug}/api/v1/groups/{groupId}

Deletes the group and removes all user memberships. Child groups are not deleted — they become root groups.

Response 204 No Content


POST /t/{slug}/api/v1/groups/{groupId}/members/{userId}

Adds the user to the group. The user immediately inherits all roles assigned to the group and its ancestors.

Path parameters:

ParameterTypeDescription
groupIdintegerThe group’s numeric ID
userIdintegerThe user’s numeric ID

Response 204 No Content


DELETE /t/{slug}/api/v1/groups/{groupId}/members/{userId}

Removes the user from the group. Role inheritance from this group is revoked immediately and reflected in subsequent tokens.

Response 204 No Content