---
name: "updateTempCustom"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "updateTempCustom - Update custom temporary password name and validity configuration."
summary: "Update custom temporary password name and validity configuration. Currently only supports updating name and validity configuration, and only supports cloud update."
---

## updateTempCustom

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

### Description

Update a custom temporary password.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `UpdateTempPasswordParams` | Yes | Update parameters |

### Return Value

Type: `Promise<boolean>`

None (resolve after successful update)

### Error Codes

| Error Code | Error Message |
| --- | --- |
| `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 end time |
| `1035` | weeks not provided in weekly repeat mode |
| `1039` | Cloud: Invalid time parameters (START_END_DATE_NOT_RIGHT) |

### Referenced Types

##### `interface` UpdateTempPasswordParams

| Property | Type | Description |
| --- | --- | --- |
| `unlockBindingId` | `string` | Password ID |
| `name` | `string` | Password name, length must not exceed 20 |
| `effective` | `EffectiveConfig` | Password validity configuration |

##### `interface` EffectiveConfig

| Property | Type | Description |
| --- | --- | --- |
| `effectiveDate` | `number` | Effective date (seconds-level timestamp) |
| `expiredDate` | `number` | Expiration date (seconds-level timestamp) |
| `repeat` | `"none" \| "week"` | Repeat policy: none or weekly |
| `weeks` | `Week` | Weekly repeat bitmap |
| `effectiveTime` | `number` | Daily start time (minutes) |
| `expiredTime` | `number` | Daily end time (minutes) |

##### `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

```ts
import { updateTempCustom } from '@ray-js/lock-sdk';
await updateTempCustom({ id: 'pwd_001', name: 'New password name' });
```
