Create a OneDrive sharing link
files_create_linkCreate a sharing link for a OneDrive file or folder and get its URL, permission type, and scope. Defaults to an organization view link; retry with organization scope if anonymous is blocked.
Instructions
Creates a sharing link for a OneDrive file or folder and returns its URL, permission type and scope. Defaults to a view link scoped to the organization. Anonymous links are blocked by policy in many tenants, which surfaces as a 403: retry with scope organization. Calling this twice with the same type and scope returns the existing link rather than creating a second one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Link permission: view for read-only, edit for read-write. Defaults to view. | view |
| scope | No | Who can use the link. organization requires the recipient to sign in to the same tenant; anonymous works for anyone holding the URL and is disabled by policy in many tenants. | organization |
| itemId | Yes | Id of the file or folder to create a sharing link for. |