> For the complete documentation index, see [llms.txt](https://docs.accelerator-platform.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.accelerator-platform.com/core-api-reference/roles.md).

# Roles

"Roles" refer to a feature that enables the management and control of user roles and permissions within an application. Roles define different levels of access and permissions, ensuring users only have access to relevant functionality and data. Administrators can create and define roles based on application requirements, associating them with specific permissions. This role-based access control allows for granular control over user actions and data access. The Roles feature in our Accelerator product provides a scalable solution for secure and controlled access to application functionality and data based on user roles.

## Roles Data Model

<table><thead><tr><th width="194.33333333333331">Name</th><th width="154">Data</th><th>Description</th></tr></thead><tbody><tr><td>_id</td><td>String</td><td>System-generated unique identifier assigned to each role.</td></tr><tr><td>_createdAt</td><td>Date</td><td>System-generated timestamp that denotes the date and time when a role was created.</td></tr><tr><td>_createdBy</td><td>String</td><td>System-generated field that indicates the account who created.</td></tr><tr><td>_modifiedAt</td><td>Date</td><td>System-generated generated timestamp that denotes the date and time when a role was modified.</td></tr><tr><td>_modifiedBy</td><td>String</td><td>System-generated field that indicates the account who modified.</td></tr><tr><td>org</td><td>String</td><td>Represents the organization associated with the role in the system.</td></tr><tr><td>name</td><td>String</td><td>Represents the name of the role in the system.</td></tr><tr><td>label</td><td>String</td><td>Represents the label of the role in the system.</td></tr><tr><td>description</td><td>String</td><td>Represents the description of the role in the system.</td></tr><tr><td>status</td><td>String</td><td>Represents the status of the role in the system.</td></tr><tr><td>policies</td><td>Array</td><td>Represents the list of policies attached to the role in the system.</td></tr></tbody></table>

## Example Roles

```json
{
    "_id":
        {
            "$oid":"64392c4f862be321e3598f65"
        },
    "_createdAt":
        {
            "$date":
                {
                    "$numberLong":"1681468495815"
                }
        },
    "_createdBy":"john@email.com",
    "_modifiedAt":
        {
            "$date":
                {
                    "$numberLong":"1687865984008"
                }
        },
    "_modifiedBy":"john@email.com",
    "org":"64392b37862be321e3598f58",
    "name":"Provider",
    "label":"Providers215",
    "description":"",
    "status":"active",
    "policies":["64392c1d862be321e3598f63"]
}
```

{% openapi src="/files/1Zvo9GVhuSXznVDAJt9t" path="/api/v1/CreateRole" method="post" %}
[User\_APIs.json](https://1738158455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCVrtNgJZsfJ0IDZkXa1%2Fuploads%2FNC5TClB7wr0JsePCc7Gu%2FUser_APIs.json?alt=media\&token=9aca0938-9a30-499f-8a52-0225fe22a66b)
{% endopenapi %}

{% openapi src="/files/1Zvo9GVhuSXznVDAJt9t" path="/api/v1/GetRoles" method="get" %}
[User\_APIs.json](https://1738158455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCVrtNgJZsfJ0IDZkXa1%2Fuploads%2FNC5TClB7wr0JsePCc7Gu%2FUser_APIs.json?alt=media\&token=9aca0938-9a30-499f-8a52-0225fe22a66b)
{% endopenapi %}

{% openapi src="/files/1Zvo9GVhuSXznVDAJt9t" path="/api/v1/GetRole/{id}" method="get" %}
[User\_APIs.json](https://1738158455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCVrtNgJZsfJ0IDZkXa1%2Fuploads%2FNC5TClB7wr0JsePCc7Gu%2FUser_APIs.json?alt=media\&token=9aca0938-9a30-499f-8a52-0225fe22a66b)
{% endopenapi %}
