Share via

Graph API - required permissions for createSession

Yu, Miseon 0 Reputation points
2026-02-27T06:27:55.2666667+00:00

Hi support,

I've tried createSession

POST https://graph.microsoft.com/v1.0/drives/<myDriveID>/items/<myWorkbookID>/workbook/createSession

based on https://learn.microsoft.com/en-us/graph/api/workbook-createsession?view=graph-rest-1.0&tabs=http#permissions

However, I've met an error of "HTTP [40002] [EditModeAccessDenied] Contact the workbook owner to request edit access".

I made use of an Azure AD app. registration of Application permissions. Isn't this supported according to the table in the section of 'permissions' of the above page?

Best regards,

Miseon

Azure App Configuration
Azure App Configuration

An Azure service that provides hosted, universal storage for Azure app configurations.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-02-27T06:28:12.8733333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The workbook/createSession API only supports delegated permissions with a work or school account. Application permissions are not supported for this API.

    From the permissions table for workbook: createSession:

    • Delegated (work or school account): Files.ReadWrite (least privileged)
    • Delegated (personal Microsoft account): Not supported
    • Application: Not supported

    Because the call is being made with an Azure AD app registration using application permissions, the service is effectively trying to operate without a signed-in user context and cannot obtain edit rights on the workbook, which results in the EditModeAccessDenied error.

    To use createSession successfully:

    1. Use delegated permissions (Files.ReadWrite) instead of application permissions.
    2. Ensure the signed-in user has edit access to the target workbook in OneDrive/SharePoint.
    3. Call:
         POST /me/drive/items/{id}/workbook/createSession
         Content-type: application/json
         
         {
           "persistChanges": true
         }
      
      with an access token obtained on behalf of that user.

    If an app-only (daemon/service) scenario is required, a different approach is needed because workbook/createSession itself cannot be used with application permissions.


    References:

    0 comments No comments

Your answer

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