---
name: "agreeOpenDoor"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "agreeOpenDoor - Approve a remote unlock request, applicable to WiFi Pro category devices."
summary: "Approve a remote unlock request, applicable to WiFi Pro category devices. Call this interface to confirm unlocking when a visitor requests to unlock via doorbell."
---

## agreeOpenDoor

> [VERSION] @ray-js/lock-sdk >= 1.0.0

### Description

Approve remote door-open request (used by Wi‑Fi Pro solution)

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `option` | `OpenDoorCallOptions` | No | Approve-to-open call options (e.g., timeout for waiting for device report) |

### Return Value

Type: `Promise<void>`

None (resolves when done)

### Error Codes

| Error Code | Error Message |
| --- | --- |
| `1052` | Previous operation on the same device is still in progress |
| `1002` | Operation timed out |
| `1003` | Remote unlock failed (cloud invocation error) |
| `1004` | Device reported unlock failure |
| `1005` | Remote unlock failed (key invalidated) |
| `1006` | Key usage limit reached |
| `1007` | Key not within validity period |
| `1008` | Invalid key |

### Referenced Types

##### `interface` OpenDoorCallOptions

| Property | Type | Description |
| --- | --- | --- |
| `timeout` | `number` | Timeout for waiting for device reports (ms), default 15000 ms |


### Examples

```ts
import { agreeOpenDoor } from '@ray-js/lock-sdk';
await agreeOpenDoor();
```
