---
name: "getPanelAgentCustomRolePage"
mode: "api"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.6" }
---

## getPanelAgentCustomRolePage

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.6

> 💡 This API depends on cloud capabilities. In the Miniapp Developer Platform (https://platform.tuya.com/miniapp/), go to Development Settings > Cloud Capabilities to configure authorization.

### Description

Query the custom role list (paginated).

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetPanelAgentCustomRolePageParams` | Yes | Request body |

### Return Value

Type: `Promise<GetPanelAgentCustomRolePageResult>`

GetPanelAgentCustomRolePageResult (see type definitions and minituya return parameters for field meanings)

### Referenced Types

##### `interface` GetPanelAgentCustomRolePageParams

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `devId` | `string` | Yes | Device ID |
| `pageNo` | `number` | Yes | Page number |
| `pageSize` | `number` | Yes | Page size |
| `roleCategory` | `string` | No | Role category |

##### `type` GetPanelAgentCustomRolePageResult

```typescript
CommonPageResult<PanelAgentCustomRoleListItem>
```


### Examples

#### Request example

```typescript
import { getPanelAgentCustomRolePage } from '@tuya-miniapp/cloud-api';

const params = {
  devId: 'your_device_id',
  pageNo: 1,
  pageSize: 10,
  roleCategory: 'assistant',
};

getPanelAgentCustomRolePage(params)
  .then(result => {
    console.log('Custom role list:', result);
  })
  .catch(error => {
    console.error('Failed to get custom role list:', error);
  });
```

#### Response example

```json
{
  "page": 1,
  "pageSize": 10,
  "totalPage": 1,
  "total": 1,
  "list": [
    {
      "roleId": "role_custom_001",
      "roleName": "Smart Assistant Xiaomei",
      "roleDesc": "A gentle and caring smart assistant",
      "roleIntroduce": "I'm Xiaomei, your personal smart assistant",
      "roleImgUrl": "https://example.com/role_avatar.jpg",
      "useLangCode": "zh-CN",
      "useLangName": "Chinese (Simplified)",
      "useTimbreId": "timbre_001",
      "useTimbreName": "Gentle female voice",
      "useLlmId": "1001",
      "useLlmName": "GPT-3.5-turbo",
      "inBind": true,
      "templateId": "template_001",
      "inConversation": false,
      "lastTextAnswer": "Hello, how can I help you?"
    }
  ]
}
```
