Skip to content

Commit d9a2583

Browse files
committed
wip
1 parent 22b1050 commit d9a2583

2 files changed

Lines changed: 48 additions & 9 deletions

File tree

docs/configuration/exporting/rbac-api.rst

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,21 @@ Overview
1212
The RBAC API provides a single endpoint with three operations:
1313

1414
* **GET** - Retrieve current RBAC configuration
15-
* **POST** - Set/update RBAC configuration
15+
* **POST** - Set/update RBAC configuration
1616
* **DELETE** - Remove all RBAC configurations
1717

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+
1830
Authentication
1931
--------------
2032

@@ -24,10 +36,6 @@ All requests require API key authentication. Include your API key in the request
2436
2537
Authorization: Bearer YOUR_API_KEY
2638
27-
The API key must have:
28-
- ``READ`` permission for GET requests
29-
- ``WRITE`` permission for POST and DELETE requests
30-
3139
API Endpoint
3240
------------
3341

@@ -43,7 +51,12 @@ Get RBAC Configuration
4351

4452
Retrieve the current RBAC configuration for your account.
4553

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'
4760
4861
**Response (200 OK):**
4962

@@ -83,9 +96,29 @@ Set RBAC Configuration
8396

8497
Create or update the RBAC configuration for your account.
8598

86-
**POST** ``/api/rbac?account_id=YOUR_ACCOUNT_ID``
99+
.. warning::
100+
This operation **completely replaces** all existing RBAC configurations. The API will:
87101

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' \
112+
-H 'Authorization: Bearer YOUR_API_KEY' \
113+
-H 'Content-Type: application/json' \
114+
-d '{
115+
"account_id": "YOUR_ACCOUNT_ID",
116+
"scopes": [...],
117+
"groups": [...],
118+
"role_permission_groups": [...]
119+
}'
120+
121+
**Request Body Example:**
89122

90123
.. code-block:: json
91124
@@ -148,7 +181,12 @@ Delete RBAC Configuration
148181

149182
Remove all RBAC configurations for your account.
150183

151-
**DELETE** ``/api/rbac?account_id=YOUR_ACCOUNT_ID``
184+
**Request:**
185+
186+
.. code-block:: bash
187+
188+
curl -X DELETE 'https://api.robusta.dev/api/rbac?account_id=YOUR_ACCOUNT_ID' \
189+
-H 'Authorization: Bearer YOUR_API_KEY'
152190
153191
**Response (200 OK):**
154192

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
configuration/exporting/alert-export-api
8989
configuration/exporting/alert-statistics-api
9090
configuration/exporting/namespace-resources-api
91+
configuration/exporting/rbac-api
9192

9293
.. toctree::
9394
:maxdepth: 4

0 commit comments

Comments
 (0)