You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration/exporting/rbac-api.rst
+47-9Lines changed: 47 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,21 @@ Overview
12
12
The RBAC API provides a single endpoint with three operations:
13
13
14
14
* **GET** - Retrieve current RBAC configuration
15
-
* **POST** - Set/update RBAC configuration
15
+
* **POST** - Set/update RBAC configuration
16
16
* **DELETE** - Remove all RBAC configurations
17
17
18
+
Prerequisites
19
+
-------------
20
+
21
+
Before using the RBAC API, you need:
22
+
23
+
1. **API Key** - Create an API key at https://platform.robusta.dev/settings#api-keys
24
+
25
+
* The key must have ``READ`` permission for GET requests
26
+
* The key must have ``WRITE`` permission for POST and DELETE requests
27
+
28
+
2. **Account ID** - Find your account ID at https://platform.robusta.dev/settings#workspace
29
+
18
30
Authentication
19
31
--------------
20
32
@@ -24,10 +36,6 @@ All requests require API key authentication. Include your API key in the request
24
36
25
37
Authorization: Bearer YOUR_API_KEY
26
38
27
-
The API key must have:
28
-
- ``READ`` permission for GET requests
29
-
- ``WRITE`` permission for POST and DELETE requests
30
-
31
39
API Endpoint
32
40
------------
33
41
@@ -43,7 +51,12 @@ Get RBAC Configuration
43
51
44
52
Retrieve the current RBAC configuration for your account.
45
53
46
-
**GET** ``/api/rbac?account_id=YOUR_ACCOUNT_ID``
54
+
**Request:**
55
+
56
+
.. code-block:: bash
57
+
58
+
curl -X GET 'https://api.robusta.dev/api/rbac?account_id=YOUR_ACCOUNT_ID' \
59
+
-H 'Authorization: Bearer YOUR_API_KEY'
47
60
48
61
**Response (200 OK):**
49
62
@@ -83,9 +96,29 @@ Set RBAC Configuration
83
96
84
97
Create or update the RBAC configuration for your account.
85
98
86
-
**POST** ``/api/rbac?account_id=YOUR_ACCOUNT_ID``
99
+
.. warning::
100
+
This operation **completely replaces** all existing RBAC configurations. The API will:
87
101
88
-
**Request Body:**
102
+
* Delete ALL existing scopes, groups, and role_permission_groups
103
+
* Create new configurations based on the provided request body
104
+
105
+
If you omit any of these fields (scopes, groups, or role_permission_groups), those configurations will be deleted and not replaced. To preserve existing configurations, you must include them in your request.
106
+
107
+
**Request:**
108
+
109
+
.. code-block:: bash
110
+
111
+
curl -X POST 'https://api.robusta.dev/api/rbac?account_id=YOUR_ACCOUNT_ID' \
0 commit comments