# Role

## Retrieves roles the current user may manage for a company.

> Resolves the effective company scope and returns roles filtered by the caller's permissions, including current role members.\
> \
> Required roles: Admin.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Role"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Role/Get":{"get":{"tags":["Role"],"summary":"Retrieves roles the current user may manage for a company.","description":"Resolves the effective company scope and returns roles filtered by the caller's permissions, including current role members.\n\nRequired roles: Admin.","parameters":[{"name":"companyId","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Retrieves members of a specific role within a company.

> Validates whether the caller can access the requested role and company combination before returning role members.\
> \
> Required roles: Admin.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Role"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Role/Get/{companyId}/{roleId}":{"get":{"tags":["Role"],"summary":"Retrieves members of a specific role within a company.","description":"Validates whether the caller can access the requested role and company combination before returning role members.\n\nRequired roles: Admin.","parameters":[{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"roleId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Adds a user to a role.

> Verifies caller permissions and prevents self-role changes before assigning the specified user to the target role.\
> \
> Required roles: Admin.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Role"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Role/AddMember/{roleId}/{userId}":{"get":{"tags":["Role"],"summary":"Adds a user to a role.","description":"Verifies caller permissions and prevents self-role changes before assigning the specified user to the target role.\n\nRequired roles: Admin.","parameters":[{"name":"roleId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Removes a user from a role.

> Verifies caller permissions and prevents self-role changes before removing the specified user from the target role.\
> \
> Required roles: Admin.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Role"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Role/RemoveMember/{roleId}/{userId}":{"get":{"tags":["Role"],"summary":"Removes a user from a role.","description":"Verifies caller permissions and prevents self-role changes before removing the specified user from the target role.\n\nRequired roles: Admin.","parameters":[{"name":"roleId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```


---

# 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://docs.safegpt.nl/api-nl/endpoints/role.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.
