Custom Roles
6 Endpunkte. Basis-URL: https://xapi.ambertech.cloud/api/v1
List custom roles#
GET
/rolesTokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
base_role | Query | string | Werte: |
is_active | Query | string | – |
is_deleted | Query | string | – |
search | Query | string | – |
Antworten
- 200OK
Beispiel (cURL)
curl -X GET "https://xapi.ambertech.cloud/api/v1/roles" \
-H "Authorization: Bearer $XISUITE_TOKEN"Create a custom role#
POST
/rolesTokenRequest-Body
| Name | Typ | Beschreibung |
|---|---|---|
namePflicht | string | Role name |
description | object | Role description |
color | string | Hex color |
icon | object | Icon name |
base_role | string | Werte: |
permissions | object | Permissions JSONB object |
is_active | boolean | Whether role is active |
Antworten
- 201Erstellt
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/roles" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…"}'Get custom role by ID#
GET
/roles/{id}TokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Antworten
- 200OK
Beispiel (cURL)
curl -X GET "https://xapi.ambertech.cloud/api/v1/roles/{id}" \
-H "Authorization: Bearer $XISUITE_TOKEN"Update a custom role#
PUT
/roles/{id}TokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
name | string | – |
description | object | – |
color | string | – |
icon | object | – |
base_role | string | Werte: |
permissions | object | – |
is_active | boolean | – |
Antworten
- 200OK
Beispiel (cURL)
curl -X PUT "https://xapi.ambertech.cloud/api/v1/roles/{id}" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"…","description":{},"color":"…"}'Actions: toggle_active | restore | permanent_delete | duplicate | check_usage#
PATCH
/roles/{id}TokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
actionPflicht | string | Werte: |
is_active | boolean | Required for toggle_active |
newName | string | Required for duplicate |
organizationId | string | Organization ID (for duplicate) |
Antworten
- 200OK
Beispiel (cURL)
curl -X PATCH "https://xapi.ambertech.cloud/api/v1/roles/{id}" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"toggle_active"}'Soft-delete a custom role#
DELETE
/roles/{id}TokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Antworten
- 200OK
Beispiel (cURL)
curl -X DELETE "https://xapi.ambertech.cloud/api/v1/roles/{id}" \
-H "Authorization: Bearer $XISUITE_TOKEN"