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

# modifyLassoLink

> Modify link data.

<Note>
  This API supports undo/redo in NOTE.

  This API modifies the single link selected by the current lasso selection. You must lasso-select exactly one link first. If there is no lasso selection, the selection is not a link, or the selection contains multiple links, the call fails.
  It is recommended to call this API from the plugin UI entered via a lasso toolbar button.
</Note>

```ts theme={null}
static modifyLassoLink(modifyLink: {
 destPath: string;
 destPage?: number;
 linkType: number;
 style: number;
 fullText?: string;
 showText?: string;
}): Promise<APIResponse<boolean>>;
```

**Parameters**

| Parameter             | Type     | Description                                                                                                                                                                                                                                                                                                 |
| --------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `modifyLink.destPath` | `string` | Destination path / URL: when `linkType === 4`, set this to the URL; otherwise set it to the destination file path                                                                                                                                                                                           |
| `modifyLink.destPage` | `number` | Destination page (only valid when `linkType === 0` or `linkType === 2`)<br />For `linkType === 0`: must be a non-negative integer, meaning the target note page<br />For `linkType === 2`: a negative value jumps to the document current page; a non-negative integer jumps to the specified document page |
| `modifyLink.linkType` | `number` | Link type: `0` note page, `1` note file, `2` document, `3` image, `4` URL                                                                                                                                                                                                                                   |
| `modifyLink.style`    | `number` | Link style: `0` solid underline, `1` solid border, `2` dashed border                                                                                                                                                                                                                                        |
| `modifyLink.fullText` | `string` | Full text (required for text links)                                                                                                                                                                                                                                                                         |
| `modifyLink.showText` | `string` | Display text (required for text links)                                                                                                                                                                                                                                                                      |

<Note>
  Currently, `modifyLassoLink` only allows `linkType` in `0..4`.
  When reading lasso link data, you may encounter `linkType=6` (digest link). This type is currently read-only and cannot be modified via this API. See [`Link`](/en/api-reference/supernote-plugin/types/link) / [`LassoLink`](/en/api-reference/supernote-plugin/types/lasso-link).
</Note>

**Returns**

* [`APIResponse<boolean>`](/en/api-reference/supernote-plugin/types/api-response):
  `result === true` indicates modification succeeded.

<Note>
  This API cannot modify a text link into a stroke link, nor modify a stroke link into a text link.
</Note>

## Example

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

/**
 * Example: modify the single link data in the current lasso selection.
 */
export async function exampleModifyLassoLink() {
 const res = await PluginNoteAPI.modifyLassoLink({
 destPath: '/storage/emulated/0/Note/target.note',
 destPage: 1,
 linkType: 0,
 style: 1,
 fullText: 'Full Text',
 showText: 'Show Text',
 });

 if (!res.success) {
 throw new Error(res.error?.message ?? 'modifyLassoLink call failed');
 }
 return res.result;
}
```
