
Hi @Titus Tolbert (Sr. Dev Operation, Hoka corp)
Thank you for posting your question in the Microsoft Q&A forum.
From your description, my suggestion is creating separated links for internal and external users.
For external, you can use this method Web.CreateAnonymousLinkWithExpiration method
For internal, you can use either
Web.ShareObject Method (Microsoft.SharePoint.Client) | Microsoft Learn or
Web.CreateOrganizationSharingLink Method (Microsoft.SharePoint.Client) | Microsoft Learn
You can read at CSOM SPT for more details how to use it:
[MS-CSOMSPT]: CreateOrganizationSharingLink | Microsoft Learn
[MS-CSOMSPT]: ShareObject | Microsoft Learn
[MS-CSOMSPT]: CreateAnonymousLinkWithExpiration | Microsoft Learn
I hope this information helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.