Showing results for 
Search instead for 
Did you mean: 

Create sharing link for a file or folder in SharePoint for specific people



Currently in the Microsoft Flow 'Create sharing link for a file or folder' the Link Scope field only has the following options:

- Anyone with the link, including anonymous

- People in your organization


Please also add the following option which is available in SharePoint and OneDrive:

- Specific people


We really need to be able to create a sharing link just for specific people.

Status: New
Frequent Visitor

@David_Nguyen ,


I tried it about 20 mins ago - set the link expiration to be 2 minutes after the link was created. I tested before and after the 2 minutes were up, using incognito windows, and both times I could still access the share and the files.


My HTTP Requests specify linkKind 6 (Flexible) and Role 1 (View) - were you using the same settings when you tested?


The Inputs from the flow run:



However, a review of the Output reveals a null expiration date:

  "d": {
    "ShareLink": {
      "__metadata": {
        "type": "SP.Sharing.ShareLinkResponse"
      "sharingLinkInfo": {
        "__metadata": {
          "type": "SP.SharingLinkInfo"
        "AllowsAnonymousAccess": false,
        "ApplicationId": null,
        "BlocksDownload": false,
        "Created": "2020-04-08T10:10:53.566Z",
        "CreatedBy": {
          "__metadata": {
            "type": "SP.Sharing.Principal"
          "email": "",
          "expiration": null,
          "id": 6,
          "isActive": true,
          "isExternal": false,
          "jobTitle": null,


Frequent Visitor


Hi David! Thanks so much for your solution! Would you know how I can delete a shared link using the API as well? This would be super helpful for me!


Thanks again! 




You can delete the link with UnshareLink request


I use the Parse Json to Parse ShareID from createlink action. Then I delay 3 days so that receiver can access the file with the link. Then delete the link

 @adriaanvw This is also a good method for the expiration date.


Frequent Visitor

Thank you @David_Nguyen - will give this a try

Frequent Visitor



ThankYou! I have been searching all night for this!


I will try it in the morning!


Thanks mate! Legend!

Frequent Visitor


Hi David - that worked great! Thank-you! Follow up question - Do you know how I can set the "BlocksDownload" property to true? I can't seem to find any documentation on any of these api calls.


Thanks again!! 


@kerridge23 These are from my knowledge, just public in this thread now :)))

 Role: 7 will block it. 


"linkKind":"6", //6: specific,7: external
"role":"7", // 2:can edit, 1: can view, 7: block download


@adriaanvw My output has Expiration.



Frequent Visitor



You are a bloody genius!! 


Thank-You so much mate! 


I owe you a beer!

Regular Visitor

Needs the additional features of :

Specific people


Thanks so much!!

Regular Visitor

Ideally the same options should be available as offered by SharePoint, so not only specific people but also the option to allow "People with existing access" - otherwise there is no way to allow Azure AD Guest/External users who already have permission to the location to be able to use the link, without allowing Anonymous sharing which would be against many security policies:


  • Anyone with the link (previously called "anonymous access" or "shareable")
  • People in your organization with the link
  • People with existing access
  • Specific people