> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supernote.com/llms.txt
> Use this file to discover all available pages before exploring further.

# unlockPathWithPassword

> Unlock an encrypted file or directory with a password.

```ts wrap theme={null}
static unlockPathWithPassword(filePath: string, password: string): Promise<APIResponse<boolean>>;
```

**Parameters**

| Parameter  | Type     | Description                      |
| ---------- | -------- | -------------------------------- |
| `filePath` | `string` | File or directory path           |
| `password` | `string` | Password used to unlock the path |

**Returns**

* [`APIResponse<boolean>`](/en/api-reference/supernote-plugin/types/api-response):
  `result === true` means unlock succeeds, and `result === false` means unlock fails

## Example

```ts wrap theme={null}
import { PluginFileAPI } from 'sn-plugin-lib';

/**
 * Example: unlock an encrypted path with a password.
 */
export async function exampleUnlockPathWithPassword() {
  const filePath = '/storage/emulated/0/Note/demo.note';
  const password = '123456';

  const res = await PluginFileAPI.unlockPathWithPassword(filePath, password);
  if (!res.success) {
    throw new Error(res.error?.message ?? 'unlockPathWithPassword call failed');
  }

  return res.result;
}
```
