# list policies for role - ListPoliciesForRole

## Overview

list policies for role






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `ListPoliciesForRole`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.genesissai.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RoleName** | string | role name |**Yes**|
| **Scope** | string | scope |No|
| **ProjectID** | string | project ID |No|
| **Limit** | string | limit |No|
| **Offset** | string | offset |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **TotalCount** | int | policy total count |No|
| **Policies** | array[[*AttachedPolicy*](#attachedpolicy)] | policies |No|

#### Data Model


#### AttachedPolicy

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **PolicyName** | string | Permission Policy Name |**Yes**|
| **PolicyURN** | string | Strategy URN |**Yes**|
| **Scope** | string | Application Scope (ScopeRequired: Project Level, ScopeEmpty: Global Level, ScopeUnrestricted: Project Level/Global Level) |**Yes**|
| **AttachedAt** | int | Unix timestamp when the policy is bound |**Yes**|
| **Description** | string | Description |No|
| **ProjectName** | string | Project Name |No|
| **ProjectID** | string | Project ID |No|

## Example

### Request Example
    
```
https://api.genesissai.com/?Action=ListPoliciesForRole
&RoleName=vfMDKOvP
&Scope=YKYdzdOw
&ProjectID=ZaDLZrri
&Limit=SdMriPoz
&Offset=dkSAIWox
```

### Response Example
    
```json
{
  "Action": "ListPoliciesForRoleResponse",
  "Policies": [
    {
      "AttachedAt": 3,
      "Description": "WuKmNORY",
      "PolicyName": "cvLeAbUx",
      "PolicyURN": "uzroiZrD",
      "ProjectID": "NfQcjUCw",
      "ProjectName": "mItNvtEy",
      "Scope": "All"
    }
  ],
  "RetCode": 0,
  "TotalCount": 1
}
```





