---
name: "getPresetEvent"
mode: "kit"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.5" }
---

## getPresetEvent

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

### Description

Query preset events for the VisionBox list

### Parameters

`Params`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `params` | `GetAiVisualPresetEventParams` | Yes | - | Request body |

### Referenced Types

##### `type` GetAiVisualPresetEventParams

| Property | Type | Description |
| --- | --- | --- |
| `gid` | `string` | Home gid |
| `businessType` | `"BusinessType.aigcProtect" \\| "BusinessType.aiTimePhotoAlbumDetect" \\| "BusinessType.aiSmartFreeEvent"` | Business type (minituya `getPresetEvent` docs use fields like `eventValue`/`stockId`; not fully aligned with this wrapper—use `BusinessType` as the source of truth) |

##### `enum` BusinessType

| Enum Value | Actual Value | Description |
| --- | --- | --- |
| `BusinessType.aigcProtect` | `aigcProtect` | VisionBox protection |
| `BusinessType.aiTimePhotoAlbumDetect` | `aiTimePhotoAlbumDetect` | Time Album detection |
| `BusinessType.aiSmartFreeEvent` | `aiSmartFreeEvent` | Free smart events |


### Examples

#### Request example

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

getPresetEvent({ gid: '194137', businessType: 'aiSmartFreeEvent' })
  .then((list) => console.log(list))
  .catch(console.error);
```

#### Response example

```json
[
  {
    "configCode": "person",
    "configCodeIcon": "https://images.example.com/icon.png",
    "configCodeDesc": "Person Detection"
  }
]
```
