---
name: "saveTempOnlineUnlimited"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "saveTempOnlineUnlimited - Save an online unlimited password, applicable to WiFi Photo Lock devices."
summary: "Save an online unlimited password, applicable to WiFi Photo Lock devices."
---

## saveTempOnlineUnlimited

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

> 💡 This API is for WiFi Pro locks only; do not use it with other locks.

### Description

Save an online unlimited-use password

### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `password` | `string` | Yes | Password value must be numeric |
| `name` | `string` | Yes | Password name, up to 20 characters |
| `effective` | `EffectiveConfig` | Yes | Password validity settings |
| `phone` | `string` | No | SMS notification phone number; if provided, SMS is enabled |
| `countryCode` | `string` | No | SMS country code |

### Return Value

Type: `Promise<__object>`

None (resolve after successful save)

##### __object

| Property | Type | Description |
| --- | --- | --- |
| `type` | `"custom"` |  |
| `name` | `string` |  |
| `pwdId` | `string` |  |
| `effectiveConfig` | `EffectiveConfig` |  |

### Error Codes

| Error Code | Error Message |
| --- | --- |
| `1030` | Invalid password format |
| `1031` | Password name too long (over 20 characters) |
| `1032` | Missing validity time settings |
| `1033` | Missing start date |
| `1034` | Missing end date |
| `1010` | Start time is later than expiry time |
| `1035` | weeks not provided in weekly repeat mode |
| `1037` | Cloud: Password already exists (USER_PWD_ALREADY_EXIST) |
| `1038` | Cloud: Duplicate password name (LOCK_PWD_NAME_REPEAT) |
| `1039` | Cloud: Invalid time parameters (START_END_DATE_NOT_RIGHT) |

### Referenced Types

##### `type` BitStatus

Bit switch: 0 off, 1 on / Single-bit flag

```typescript
export type BitStatus = 0 | 1;
```

##### `type` Week

Weekly repeat bitmap: indices 0–6 correspond to Sun–Sat; 0 inactive, 1 active

```typescript
export type Week = [
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
  BitStatus,
];
```


### Examples

#### Example

```ts
import { saveTempOnlineUnlimited } from '@ray-js/lock-sdk';
saveTempOnlineUnlimited({ password: '654321', name: 'Unlimited-use password' });
```
