User Groups
11 Endpunkte. Basis-URL: https://xapi.ambertech.cloud/api/v1
List user groups#
/groupsTokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
is_deleted | Query | string | – |
search | Query | string | – |
Antworten
- 200OK
curl -X GET "https://xapi.ambertech.cloud/api/v1/groups" \
-H "Authorization: Bearer $XISUITE_TOKEN"Create a user group#
/groupsTokenRequest-Body
| Name | Typ | Beschreibung |
|---|---|---|
namePflicht | string | Group name |
description | object | Group description |
color | string | Hex color code (6-digit) |
default_role_id | object | Default role ID for new members |
organizationId | string | Organization ID (sent by frontend, ignored — JWT is used) |
Antworten
- 201Erstellt
curl -X POST "https://xapi.ambertech.cloud/api/v1/groups" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…"}'Get a user group by ID#
/groups/{id}TokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
withMembers | Query | string | – |
Antworten
- 200OK
curl -X GET "https://xapi.ambertech.cloud/api/v1/groups/{id}" \
-H "Authorization: Bearer $XISUITE_TOKEN"Update a user group#
/groups/{id}TokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
name | string | Group name |
description | object | Group description |
color | string | Hex color code (6-digit) |
default_role_id | object | Default role ID for new members |
Antworten
- 200OK
curl -X PUT "https://xapi.ambertech.cloud/api/v1/groups/{id}" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…","description":{},"color":"#6B7280"}'Actions: restore | permanent_delete | duplicate#
/groups/{id}TokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
actionPflicht | string | Werte: |
newName | string | New name (required for duplicate) |
organizationId | string | Organization ID (accepted from frontend, JWT org is always used) |
copyMembers | boolean | When duplicating, copy existing group members too. |
Antworten
- 200OK
curl -X PATCH "https://xapi.ambertech.cloud/api/v1/groups/{id}" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"restore"}'Soft-delete a user group#
/groups/{id}TokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Antworten
- 200OK
curl -X DELETE "https://xapi.ambertech.cloud/api/v1/groups/{id}" \
-H "Authorization: Bearer $XISUITE_TOKEN"List members of a group#
/groups/{id}/membersTokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Antworten
- 200OK
curl -X GET "https://xapi.ambertech.cloud/api/v1/groups/{id}/members" \
-H "Authorization: Bearer $XISUITE_TOKEN"Add member(s) to a group#
/groups/{id}/membersTokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
user_id | string | Single user ID to add |
user_ids | string[] | Multiple user IDs to add (bulk) |
role_id | object | Role ID to assign to added member(s) |
Antworten
- 201Erstellt
curl -X POST "https://xapi.ambertech.cloud/api/v1/groups/{id}/members" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"user_id":"…","user_ids":[],"role_id":{}}'Update role of a group member#
/groups/{id}/membersTokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
user_idPflicht | string | User ID whose role to update |
role_id | object | New role ID (null to remove role) |
Antworten
- 200OK
curl -X PATCH "https://xapi.ambertech.cloud/api/v1/groups/{id}/members" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"user_id":"…"}'Remove member(s) from a group#
/groups/{id}/membersTokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
user_id | string | Single user ID to remove |
user_ids | string[] | Multiple user IDs to remove (bulk) |
Antworten
- 200OK
curl -X DELETE "https://xapi.ambertech.cloud/api/v1/groups/{id}/members" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"user_id":"…","user_ids":[]}'Get group memberships for several users#
/groups/membershipsTokenReturns a map of user id to the groups that user belongs to, restricted to the caller's organization and excluding soft-deleted groups. Every requested id is present in the response; users with no groups map to an empty array.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
user_idsPflicht | Query | string[] | Comma-separated user ids |
Antworten
- 200OK
curl -X GET "https://xapi.ambertech.cloud/api/v1/groups/memberships" \
-H "Authorization: Bearer $XISUITE_TOKEN"