> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetRolesInfo

# Package: accounts

# Namespace: RolesManagementService

# Method link: https://dev.wix.com/docs/api-reference/account-level/user-management/accounts/users/get-roles-info.md

## Introduction

Retrieves all available roles in the requesting account, including predefined and custom roles.
> **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.

---

## REST API

### Schema

```
 Method: getRolesInfo
 Description: Retrieves all available roles in the requesting account, including predefined and custom roles. > **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.
 URL: https://www.wixapis.com/roles-management/roles
 Method: GET
 Method parameters:
   param name: filter | type: RolesInfoFilter    
        - name: roleLevel | type: RoleLevel | description: Role level to return. Default: ALL.  
             - enum: ALL, SITE_LEVEL, ACCOUNT_LEVEL
        - name: editorTypes | type: array<EditorType> | description: Filter for editor-specific roles. Default: ALL.  
             - enum: UNINITIALIZED, EDITORX, BLOCKS, STUDIO
   query param name: locale | type: locale | description: Language of predefined roles names and descriptions to return, in ISO 639 format. Default: `en`.  
 Return type: GetRolesInfoResponse
  - name: predefinedRoles | type: array<RoleInfo> | description: Predefined roles.  
     - name: id | type: string | description: Role GUID.  
     - name: title | type: string | description: Role title, translated according to the request locale. If translation fails, the original title is returned.  
     - name: description | type: string | description: Role description, translated according to the request locale. If translation fails, the original description is returned.  
     - name: restrictFromLevel | type: RoleLevelRestriction | description: Whether this role is restricted from accessing a specific resource type. Default: `NoRestriction`.  
         - enum: NoRestriction, Site, Account
  - name: customRoles | type: array<RoleInfo> | description: Custom roles.  


```

### Examples

### Get Roles Info
```curl
# Basic request (no filters)
curl -X GET \
  'https://www.wixapis.com/roles-management/roles' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>'

# With query parameters for filtering
curl -X GET \
  'https://www.wixapis.com/roles-management/roles?locale=en&filter.role_level=ALL' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>'

# Response:
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.userManagement.users.getRolesInfo(options)
 Description: Retrieves all available roles in the requesting account, including predefined and custom roles. > **Important**: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.
 Method parameters:
   param name: options | type: GetRolesInfoOptions  none  
        - name: locale | type: string | description: Language of predefined roles names and descriptions to return, in ISO 639 format. Default: `en`.  
        - name: filter | type: RolesInfoFilter | description: Roles to return.  
           - name: roleLevel | type: RoleLevel | description: Role level to return. Default: ALL.  
                 - enum: ALL, SITE_LEVEL, ACCOUNT_LEVEL
           - name: editorTypes | type: array<EditorType> | description: Filter for editor-specific roles. Default: ALL.  
                 - enum: UNINITIALIZED, EDITORX, BLOCKS, STUDIO
 Return type: PROMISE<GetRolesInfoResponse>
  - name: predefinedRoles | type: array<RoleInfo> | description: Predefined roles.  
     - name: _id | type: string | description: Role GUID.  
     - name: title | type: string | description: Role title, translated according to the request locale. If translation fails, the original title is returned.  
     - name: description | type: string | description: Role description, translated according to the request locale. If translation fails, the original description is returned.  
     - name: restrictFromLevel | type: RoleLevelRestriction | description: Whether this role is restricted from accessing a specific resource type. Default: `NoRestriction`.  
         - enum: NoRestriction, Site, Account
  - name: customRoles | type: array<RoleInfo> | description: Custom roles.  


```

### Examples

### Get available account roles with an API key
```javascript
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { users } from "@wix/user-management";
const wixClient = createClient({
 modules: { users },
 auth: ApiKeyStrategy({
    apiKey: "MY-API-KEY",
  }),
});

async function getRolesInfo(options) {
  const response = await users.getRolesInfo(options);
}

```

### getRolesInfo (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { users } from '@wix/user-management';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { users },
  // Include the auth strategy and host as relevant
});


async function getRolesInfo(options) {
  const response = await myWixClient.users.getRolesInfo(options);
};
```

---