<commit_before>﻿# Create a sharing link for an item in OneDrive

You can use **createLink** action to share an existing item via a link. This is
a developer-friendly shortcut for creating common sharing links.

The **action.createLink** method will create a new sharing link if the specified link type
doesn't already exist. If a sharing link of the specified type already exists, the existing sharing link will be returned.

## HTTP request

````
POST /drive/items/{item-id}/action.createLink<commit_msg>Clarify scope required for creating a link<commit_after>﻿# Create a sharing link for an item in OneDrive

You can use **createLink** action to share an existing item via a link. This is
a friendly shortcut for creating common sharing links.

The **action.createLink** method will create a new sharing link if the specified
link type doesn't already exist. If a sharing link of the specified type already
exists, the existing sharing link will be returned.

**Note:** Your application must be granted read-write permissions to the item
to be able to create a sharing link. This maps to the `onedrive.readwrite` scope
when requesting user consent.

## HTTP request

````
POST /drive/items/{item-id}/action.createLink
{'fraction_non_alphanumeric': 0.06562756357670221, 'fraction_numerical': 0.0, 'mean_word_length': 4.648148148148148, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '488977', 'n_tokens_mistral': 307, 'n_tokens_neox': 296, 'n_words': 176}