Share a OneDrive file with someone
share_onedrive_itemGive a named person access to a file or folder by their email address, and get back the link to pass on. Only named people — there is no "anyone with the link" option, so someone without a Microsoft account cannot be given access. The person is NOT emailed: send them the link yourself if they should know. Ask the user to confirm before sharing anything.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Defaults to reader. OneDrive has no comment-only role, so commenter grants read | |
| Yes | Email address of the person to give access to | ||
| itemId | Yes | ||
| mailbox | Yes | Email address of the connected Outlook/Microsoft 365 mailbox to act on. Call list_authorized_mailboxes to see available options. | |
| expiresInDays | No | Access is removed automatically after this many days, up to 365 |