Microsoft SharePoint and OneDrive v2
Find and fix oversharing in SharePoint and OneDrive through Graph
Lists site and OneDrive sharing, revokes anonymous and oversharing links, quarantines files, and runs site governance checks through Microsoft Graph.
microsoft-sharepoint-v2_5.0.0.tgz
Community code that runs on your platform. A maintainer reviewed this exact source; the download is rebuilt from it. Follow the to install it.
Configuration · 8 fields
- Tenant ID
tenant_idtext requiredMicrosoft Entra ID tenant (directory) ID or domain.
- Client ID
client_idtext requiredApplication (client) ID of the Entra ID app registration.
- Client Secret
client_secretpassword requiredClient secret of the app registration (Certificates & secrets).
- Default Site URL
site_urltextOptional default site. Operations take site_url as a parameter, which overrides this.
- Internal Domains
internal_domainstext(Optional) Comma-separated domains of your organisation. A grantee outside them is reported as an external grantee. Without this, only guest identities (#EXT#) are external.
- Verify SSL
verify_sslcheckboxSpecifies whether SSL certificates are to be verified.
Default
true - Search Region
search_regiontextMicrosoft Search region for application permissions: NAM, EUR, APC, etc. Default NAM.
Default
NAM - Timeout (seconds)
timeoutintegerTimeout for each Graph request.
Default
60
Operations · 33
Health Check
health_checkhealth_checkAcquire a Graph token and read the root site.
No parameters.
ReturnstypepropertiesGet Site 1 param
get_siteget_siteRead one SharePoint site by URL.
- Site URL
site_urltext requiredSharePoint site URL, for example https://contoso.sharepoint.com/sites/soc.
ReturnstypepropertiesGet Lists 2 params
get_listsget_listsList the lists and libraries of a site.
- Site URL
site_urltext requiredSharePoint site URL, for example https://contoso.sharepoint.com/sites/soc.
- Limit
limitinteger(Optional) Stop after this many items.
ReturnstypepropertiesList Site Libraries 1 param
list_site_librarieslist_site_librariesNames of the document libraries of a site (feeds the Document Library dropdown; not a playbook step).
- Site URL
site_urltext requiredSharePoint site URL, for example https://contoso.sharepoint.com/sites/soc.
ReturnstypepropertiesList Drives 2 params
list_driveslist_drivesList the drives of a user (personal OneDrive and others) or of a site (its document libraries).
- User ID or UPN
user_idtextUser id or UPN. Lists the user's drives.
- Site URL
site_urltextSharePoint site URL. Lists the site's document libraries.
ReturnstypepropertiesGet Drive 4 params
get_driveget_driveRead the drive a target names (drive_id, user_id, or site_url with library).
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
ReturnstypepropertiesList Folder 6 params
list_folderlist_folderList the children of a folder (or the library root).
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- Folder Path
folder_pathtext(Optional) Folder path inside the library. Default: library root.
- Limit
limitinteger(Optional) Stop after this many items.
ReturnstypepropertiesSearch Files 6 params
search_filessearch_filesSearch a library by name and content (Graph drive search).
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- Query
querytext requiredSearch text. Graph matches file names and content.
- Limit
limitinteger(Optional) Stop after this many items.
ReturnstypepropertiesGet File Metadata 5 params
get_file_metadataget_file_metadataRead one file or folder by path.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- File Path
file_pathtext requiredPath of the file inside the library, for example SOC Lab Seed/report.txt.
ReturnstypepropertiesDownload File 5 params
read_file_contentread_file_contentDownload a file and store it as a FortiSOAR attachment.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- File Path
file_pathtext requiredPath of the file inside the library, for example SOC Lab Seed/report.txt.
ReturnstypepropertiesUpload File 7 params
upload_fileupload_fileUpload a FortiSOAR attachment into a library, replacing a file with the same name.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- Folder Path
folder_pathtext(Optional) Folder path inside the library. Default: library root.
- File Name
file_nametext requiredName of the file in SharePoint (no slashes).
- Attachment
attachment_idtext requiredFortiSOAR attachment id, IRI or file IRI.
ReturnstypepropertiesDelete File 5 params
delete_filedelete_fileDelete a file (it moves to the site recycle bin).
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- File Path
file_pathtext requiredPath of the file inside the library, for example SOC Lab Seed/report.txt.
ReturnstypepropertiesList Permissions 5 params
list_permissionslist_permissionsList who can reach a file and how (links and grants), with exposure flags.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- File Path
file_pathtext requiredPath of the file inside the library, for example SOC Lab Seed/report.txt.
ReturnstypepropertiesCreate Sharing Link 7 params
create_sharing_linkcreate_sharing_linkCreate a view or edit link for a file (anonymous, organization or users).
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- File Path
file_pathtext requiredPath of the file inside the library, for example SOC Lab Seed/report.txt.
- Link Type
link_typeselectDefault: view.
Options vieweditembed - Scope
scopeselectDefault: organization.
Options anonymousorganizationusers
ReturnstypepropertiesRevoke Permission 6 params
revoke_permissionrevoke_permissionRemove one permission (a link or a grant) from a file.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- File Path
file_pathtext requiredPath of the file inside the library, for example SOC Lab Seed/report.txt.
- Permission ID
permission_idtext requiredPermission id from List Permissions or Audit Sharing.
ReturnstypepropertiesGrant File Access 8 params
invite_userinvite_userGrant one user read or write access to a file.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- File Path
file_pathtext requiredPath of the file inside the library, for example SOC Lab Seed/report.txt.
- Email
emailtext requiredGuest or member address.
- Role
roleselectDefault: read.
Options readwrite - Send Invitation
send_invitationcheckboxEmail the invitation (default off).
ReturnstypepropertiesSharing Snapshot 7 params
sharing_snapshotsharing_snapshotTake a compact snapshot of the sharing of every file under a folder, for permission-drift baselines. Returns the snapshot as a JSON string.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- Folder Path
folder_pathtext(Optional) Folder path inside the library. Default: library root.
- Recursive
recursivecheckboxDescend into sub-folders (default on).
- Max Files
max_itemsintegerSnapshot at most this many files (default 200, max 1000).
ReturnstypepropertiesDiff Sharing Snapshot 2 params
diff_sharing_snapshotdiff_sharing_snapshotCompare two snapshots and report drift: added and removed sharing entries, new and removed files, and the added link permissions that can be remediated.
- Previous Snapshot
previoustext requiredEarlier snapshot JSON (from Sharing Snapshot).
- Current Snapshot
currenttext requiredCurrent snapshot JSON (from Sharing Snapshot).
ReturnstypepropertiesList Recent Sites 2 params
list_recent_siteslist_recent_sitesList Microsoft 365 groups (each with a SharePoint site) created at or after a time, newest first.
- Created After
created_aftertext requiredISO 8601 date or timestamp (UTC). Groups created at or after this time are listed.
- Limit
limitinteger(Optional) Stop after this many items.
ReturnstypepropertiesGet Site Governance 3 params
get_site_governanceget_site_governancePolicy facts for one Microsoft 365 group and its site: owners, visibility, guests, sensitivity label, naming. Findings: owner_missing, visibility_public, naming_bad, label_missing, guests_present.
- Group ID
group_idtext requiredMicrosoft 365 group id (GUID).
- Naming Prefix
naming_prefixtextRequired display name prefix. Default SOAR-.
- Require Sensitivity Label
require_labelbooleanReport label_missing when no sensitivity label is set.
ReturnstypepropertiesAdd Group Owner 3 params
add_group_owneradd_group_ownerAdd a user as an owner of a Microsoft 365 group. Retries while a new group is still replicating.
- Group ID
group_idtext requiredMicrosoft 365 group id (GUID).
- Owner UPN
owner_upntext requiredUser principal name of the new owner.
- Attempts
attemptsintegerRetries while the group is not ready (10 s apart). Default 6.
ReturnstypepropertiesSet Group Visibility 2 params
set_group_visibilityset_group_visibilitySet a Microsoft 365 group's visibility to Public or Private.
- Group ID
group_idtext requiredMicrosoft 365 group id (GUID).
- Visibility
visibilitytext requiredPublic or Private.
ReturnstypepropertiesAudit Sharing 7 params
audit_sharingaudit_sharingWalk a folder and report every file's sharing exposure. Findings are files with an anonymous or organisation link, a user link, or any guest grantee.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- Folder Path
folder_pathtext(Optional) Folder path inside the library. Default: library root.
- Recursive
recursivecheckboxDescend into sub-folders (default on).
- Max Files
max_itemsintegerAudit at most this many files (default 100, max 1000).
ReturnstypepropertiesCreate Folder 7 params
create_foldercreate_folderCreate a folder under a folder (or the library root). Conflict behaviour fail (default) or rename.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- Folder Path
folder_pathtext(Optional) Folder path inside the library. Default: library root.
- Folder Name
folder_nametext requiredName of the new folder (no slashes).
- Conflict Behavior
conflict_behaviorselectDefault: fail.
Options failrename
ReturnstypepropertiesMove Item 7 params
move_itemmove_itemMove a file or folder to another folder of the library, optionally renaming it.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- File Path
file_pathtext requiredPath of the file inside the library, for example SOC Lab Seed/report.txt.
- Destination Folder
destination_folder_pathtextDrive-relative destination folder. Empty moves to the library root.
- New Name
new_nametextOptional new name.
ReturnstypepropertiesCopy File 12 params
copy_itemcopy_itemCopy a file to another folder. Same drive: a Graph server-side copy (asynchronous; with wait on, default, the connector polls until it completes). With a destination drive (dst_drive_id, dst_user_id or dst_site_url) the bytes are copied to that drive.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- File Path
file_pathtext requiredPath of the file inside the library, for example SOC Lab Seed/report.txt.
- Destination Folder
destination_folder_pathtextDrive-relative destination folder. Empty copies to the library root.
- New Name
new_nametextOptional name for the copy.
- Wait For Completion
waitcheckboxPoll the monitor until the copy finishes (default on).
- Destination Drive ID
dst_drive_idtext(Optional) Destination drive id for a cross-drive copy. Empty: copy within the source drive.
- Destination User ID or UPN
dst_user_idtext(Optional) Destination user's personal OneDrive.
- Destination Site URL
dst_site_urltext(Optional) Destination SharePoint site URL.
- Destination Library
dst_librarytext(Optional) Destination library with dst_site_url.
ReturnstypepropertiesList File Versions 6 params
list_versionslist_versionsList the version history of a file (newest first, as Graph returns it).
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- File Path
file_pathtext requiredPath of the file inside the library, for example SOC Lab Seed/report.txt.
- Limit
limitinteger(Optional) Stop after this many items.
ReturnstypepropertiesRestore File Version 6 params
restore_versionrestore_versionMake an earlier version of a file the current one. The version it replaces is kept in the history.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- File Path
file_pathtext requiredPath of the file inside the library, for example SOC Lab Seed/report.txt.
- Version ID
version_idtext requiredVersion id from List File Versions (for example 2.0).
ReturnstypepropertiesGet List Item 3 params
get_list_itemget_list_itemRead one item of a SharePoint list with its fields.
- Site URL
site_urltext requiredSharePoint site URL, for example https://contoso.sharepoint.com/sites/soc.
- List
list_nametext requiredList display name, internal name or id.
- Item ID
item_idtext requiredList item id.
ReturnstypepropertiesCreate List Item 3 params
create_list_itemcreate_list_itemCreate an item in a SharePoint list from a JSON object of field values.
- Site URL
site_urltext requiredSharePoint site URL, for example https://contoso.sharepoint.com/sites/soc.
- List
list_nametext requiredList display name, internal name or id.
- Fields (JSON)
fieldstext requiredJSON object: column internal name to value.
ReturnstypepropertiesUpdate List Item 4 params
update_list_itemupdate_list_itemUpdate some fields of a SharePoint list item (only the keys given change).
- Site URL
site_urltext requiredSharePoint site URL, for example https://contoso.sharepoint.com/sites/soc.
- List
list_nametext requiredList display name, internal name or id.
- Item ID
item_idtext requiredList item id.
- Fields (JSON)
fieldstext requiredJSON object of the fields to change.
ReturnstypepropertiesUpload Large File 8 params
upload_file_largeupload_file_largeUpload a FortiSOAR attachment in chunks through a Graph upload session (for files above about 4 MB). Replaces a file with the same name.
- Drive ID
drive_idtext(Optional) Graph drive id of any drive (library, OneDrive or group drive). Wins over user_id and site_url.
- User ID or UPN
user_idtext(Optional) User id or UPN: that user's personal OneDrive. Used when no drive_id is given.
- Site URL
site_urltextSharePoint site URL (https://contoso.sharepoint.com/sites/soc). Used when no drive_id or user_id is given.
- Document Library
librarytext(Optional) Document library name with site_url. Default: the site's default library (Documents).
- Folder Path
folder_pathtext(Optional) Folder path inside the library. Default: library root.
- File Name
file_nametext requiredName in SharePoint (no slashes).
- Attachment
attachment_idtext requiredFortiSOAR attachment id, IRI or file IRI.
- Chunk Size (KiB)
chunk_size_kbintegerFragment size, a multiple of 320 (default 3200).
ReturnstypepropertiesExecute Graph Request 4 params
execute_api_requestexecute_api_requestCall any Microsoft Graph v1.0 endpoint (pass-through). Graph errors come back as data (status_code, body).
- Method
methodselect requiredHTTP method.
Options GETPOSTPATCHPUTDELETE - Endpoint
endpointtext requiredPath under /v1.0, for example /sites/{id}/lists. Full Graph URLs are accepted; other hosts are refused.
- Query Parameters (JSON)
query_paramstextJSON object of query parameters.
- Payload (JSON)
payloadtextJSON body for POST, PATCH or PUT.
Returnstypeproperties