Share via

Try to create townhall using microsoft graph api, but keep having 403 response

Émeric Trang 25 Reputation points
2025-03-04T17:29:24.3166667+00:00

hello !

I am trying to use Microsoft Graph Api in order to create Townhalls.

I have created an app and added the VirtualEvent.ReadWrite permission.

I also added the OnlineMeetings,ReadWrite.All permission since it seems to be needed to access the communication API (as described here).

The VirtualEvent.ReadWrite is a delegated type, so I am calling the /authorize url to get a code and then call the /token endpoint to have an access token.

The scope for the authorize url is "offline_access VirtualEvent.Read VirtualEvent.ReadWrite".

I manage to have the token, but I keep having a 403 error when trying to create my townhall.

Also, I've noticed in the JWT that in the roles "claim", the VirtualEvent.ReadWrite is missing :

"roles": [
    "OnlineMeetings.Read.All",
    "OnlineMeetings.ReadWrite.All",
    "VirtualEvent.Read.All"
  ],
"sub": "a9eef465-05b3-49a3-bca7-302718307d3a",
"tenant_region_scope": "EU",	

I am quite new to Microsoft graph api, so maybe I am missing something.

Thanks in advance.

Microsoft Security | Microsoft Graph

Answer accepted by question author

Akhil Nasalwai - MSFT 1,690 Reputation points Microsoft External Staff
2025-03-05T05:26:40.1833333+00:00

Hello Émeric Trang,

Thank you for reaching out to Microsoft Support!!

For creating Townhalls using Graph API, as per the official documentation, only delegated permissions are supported i.e.VirtualEvent.ReadWrite. We recommend you testing the API in Graph Explorer by signing in as user having organizer role and let us know if you are able to create townhall event.

Link: Create Townhall permissions

Role required: virtualeventtownhall-objects Roles

Also, after adding the permissions, without granting the admin consent the roles might not appear in the token claims.

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.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.