# Roles

A role is a group of permissions that can be granted. Permissions are a set of actions that can be applied to entities. For more information, see [Roles](https://docs.run.ai/v2.19/admin/runai-setup/access-control/rbac/?h=roles#roles).

## Get a list of roles.

> Use to retrieve a list of roles.

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.19"},"tags":[{"name":"Roles","description":"A role is a group of permissions that can be granted. \nPermissions are a set of actions that can be applied to entities.\nFor more information, see [Roles](https://docs.run.ai/v2.19/admin/runai-setup/access-control/rbac/?h=roles#roles).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"Roles":{"type":"array","items":{"$ref":"#/components/schemas/Role1"}},"Role1":{"allOf":[{"$ref":"#/components/schemas/RoleCreationFields"},{"$ref":"#/components/schemas/MetadataFields"}]},"RoleCreationFields":{"type":"object","description":"May contain additional creation fields that are not updatable","required":["name","description","permissions"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"permissions":{"$ref":"#/components/schemas/Permissions"}}},"Permissions":{"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"Permission":{"type":"object","required":["resourceType","actions","groupId","displayName"],"properties":{"resourceType":{"$ref":"#/components/schemas/ResourceType"},"displayName":{"type":"string"},"groupId":{"$ref":"#/components/schemas/ResourceTypeGroupId"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/Action"}}}},"ResourceType":{"type":"string","enum":["department","tenant","project","cluster","cluster-config","internal-cluster-config","nodepools","nodes","settings","users","groups","apps","dashboards-overview","dashboards-analytics","dashboards-consumption","roles","access_rules","jobs","workloads","workspaces","trainings","inferences","environments","pvc-assets","git-assets","host-path-assets","nfs-assets","s3-assets","compute-resources","templates","credentials","events-history","policies","cm-volume-assets","datavolumes","datavolumes/sharedscopes","secret-volume-assets"]},"ResourceTypeGroupId":{"type":"string","enum":["organization","physical-resource","iam","dashboard","workload","workload-asset"]},"Action":{"type":"string","enum":["create","read","update","delete","sync"]},"MetadataFields":{"type":"object","required":["id","createdAt","updatedAt","createdBy"],"properties":{"id":{"type":"integer","format":"int32"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","nullable":true,"format":"date-time"},"tenantId":{"$ref":"#/components/schemas/TenantId"},"createdBy":{"type":"string"}}},"TenantId":{"description":"The id of the tenant.","type":"integer","format":"int32"},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/authorization/roles":{"get":{"summary":"Get a list of roles.","description":"Use to retrieve a list of roles.","operationId":"get_roles","tags":["Roles"],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Roles"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Get a role by id.

> Retrieve the details of a role by id.

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.19"},"tags":[{"name":"Roles","description":"A role is a group of permissions that can be granted. \nPermissions are a set of actions that can be applied to entities.\nFor more information, see [Roles](https://docs.run.ai/v2.19/admin/runai-setup/access-control/rbac/?h=roles#roles).\n"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"RoleIdPath":{"name":"roleIdPath","in":"path","required":true,"description":"The id of the role to retrieve","schema":{"type":"integer","format":"int32","minimum":0}}},"schemas":{"Role1":{"allOf":[{"$ref":"#/components/schemas/RoleCreationFields"},{"$ref":"#/components/schemas/MetadataFields"}]},"RoleCreationFields":{"type":"object","description":"May contain additional creation fields that are not updatable","required":["name","description","permissions"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"permissions":{"$ref":"#/components/schemas/Permissions"}}},"Permissions":{"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"Permission":{"type":"object","required":["resourceType","actions","groupId","displayName"],"properties":{"resourceType":{"$ref":"#/components/schemas/ResourceType"},"displayName":{"type":"string"},"groupId":{"$ref":"#/components/schemas/ResourceTypeGroupId"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/Action"}}}},"ResourceType":{"type":"string","enum":["department","tenant","project","cluster","cluster-config","internal-cluster-config","nodepools","nodes","settings","users","groups","apps","dashboards-overview","dashboards-analytics","dashboards-consumption","roles","access_rules","jobs","workloads","workspaces","trainings","inferences","environments","pvc-assets","git-assets","host-path-assets","nfs-assets","s3-assets","compute-resources","templates","credentials","events-history","policies","cm-volume-assets","datavolumes","datavolumes/sharedscopes","secret-volume-assets"]},"ResourceTypeGroupId":{"type":"string","enum":["organization","physical-resource","iam","dashboard","workload","workload-asset"]},"Action":{"type":"string","enum":["create","read","update","delete","sync"]},"MetadataFields":{"type":"object","required":["id","createdAt","updatedAt","createdBy"],"properties":{"id":{"type":"integer","format":"int32"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","nullable":true,"format":"date-time"},"tenantId":{"$ref":"#/components/schemas/TenantId"},"createdBy":{"type":"string"}}},"TenantId":{"description":"The id of the tenant.","type":"integer","format":"int32"},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/authorization/roles/{roleIdPath}":{"get":{"summary":"Get a role by id.","description":"Retrieve the details of a role by id.","operationId":"get_role","tags":["Roles"],"parameters":[{"$ref":"#/components/parameters/RoleIdPath"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Role1"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```


---

# 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://run-ai-docs.nvidia.com/api/2.19/authentication-and-authorization/roles.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.
