Is it possible to subscribe a webhook to a specific folder in SharePoint?

Mercen 20 Reputation points
2025-01-09T08:18:08.24+00:00

I attempted to subscribe to a specific folder using the resource value /drives/{drive-id}/items/{folder-id}, but I encountered the following error:

{
    "error": {
        "code": "InvalidRequest",
        "message": "resource '/drives/(drive-id)/items/(folder-id)' is not supported.",
        "innerError": {
            "date": "2025-01-09T07:57:09",
            "request-id": "7e7814d2-4fbf-48cf-8bc5-170c7f432f41",
            "client-request-id": "7e7814d2-4fbf-48cf-8bc5-170c7f432f41"
        }
    }
}

I couldn’t find any documentation explaining how to subscribe to a folder. Is there a way to achieve this?Screenshot 2025-01-09 at 5.16.42 PM If this isn’t possible, how did Zapier manage to achieve it?

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | OneDrive | For business | Windows
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2025-01-09T08:50:36.9433333+00:00

    Hello Mercen,

    Thank you for reaching out to Microsoft Support!

    The subscription function varies from account to account, and for personal accounts, you can subscribe to the root folder or any subfolder in that drive. On OneDrive for Business, you can subscribe to only the root folder. You can see the details of this document:

    https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=csharp#driveitem

    Subscribe to Resource Path You can view this document:

    https://learn.microsoft.com/en-us/graph/api/resources/change-notifications-api-overview?view=graph-rest-1.0

    For an error when you create a subscription, if you are using a work or school account, this error is expected.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.