Forum Discussion

mgongAPI's avatar
mgongAPI
Copper Contributor
Mar 03, 2025

Webhooks for file permissions changes

Hey there! 

 

I am looking to receive a webhook from Sharepoint when permissions on a file or folder change. This doesn't seem like an explicit event in Sharepoint, but I did find this section in the docs

 

I've tested using this header a few times, but so far have not been able to receive the webhooks. Here is a cURL of my webhook setup request: 

curl --location 'https://graph.microsoft.com/v1.0/subscriptions' \ --header 'Authorization: Bearer [redacted]' \ --header 'Content-Type: application/json' \ --header 'prefer: includesecuritywebhooks' \ --data '{ "resource": "/drives/[drive_id]/root", "changeType": "updated", "notificationUrl": "[target_url\]", "expirationDateTime": "2025-03-03T21:15:14Z", }'

 

Sharepoint responds with a 201, with the following response headers:

 

"headers": { "User-Agent": "Mozilla/5.0", "Accept-Encoding": "gzip, deflate, br", "Accept": "*/*", "Connection": "keep-alive", "Authorization": "[redacted]", "content-type": "application/json", "prefer": "includesecuritywebhooks", "Content-Length": "405" }

 

So it does seem that the header was accepted. In terms of licenses, my Sharepoint instance is tied to a user with an E5 trial license, and a paid E3 license. I am still not receiving webhooks when permissions update on files. I do receive other webhooks (ie files changed, added etc), just not for a permission change event. 


Has anyone figured out how to use this header successfully? 

 

Thanks! 

No RepliesBe the first to reply

Resources