# RBAC

## GET /rbac/roles

> Get all available permissions and system role definitions.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/rbac/roles":{"get":{"tags":["RBAC"],"description":"Get all available permissions and system role definitions.","responses":{"200":{"description":"Default Response"}}}}}}
```

## GET /rbac/roles/{siteId}

> List all roles configured for a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/rbac/roles/{siteId}":{"get":{"tags":["RBAC"],"description":"List all roles configured for a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## POST /rbac/roles/{siteId}

> Create a new predefined role for a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/rbac/roles/{siteId}":{"post":{"tags":["RBAC"],"description":"Create a new predefined role for a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## GET /rbac/roles/{siteId}/me

> Get the current user's role and permissions for a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/rbac/roles/{siteId}/me":{"get":{"tags":["RBAC"],"description":"Get the current user's role and permissions for a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## DELETE /rbac/roles/{siteId}/{roleId}

> Delete a custom role from a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/rbac/roles/{siteId}/{roleId}":{"delete":{"tags":["RBAC"],"description":"Delete a custom role from a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"roleId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## PATCH /rbac/roles/{siteId}/{roleId}

> Update an existing role for a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/rbac/roles/{siteId}/{roleId}":{"patch":{"tags":["RBAC"],"description":"Update an existing role for a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"roleId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## PUT /rbac/roles/{siteId}/{staffId}

> Update a staff member role assignment.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/rbac/roles/{siteId}/{staffId}":{"put":{"tags":["RBAC"],"description":"Update a staff member role assignment.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["role_ids"],"properties":{"role_ids":{"type":"array","items":{"type":"string"}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"staffId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kitehouse.co.uk/docs/api-reference/rbac.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
