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

Émeric Trang 20 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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,310 questions
0 comments No comments
{count} votes

Accepted answer
  1. Akhil Nasalwai - MSFT 1,050 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.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Émeric Trang 20 Reputation points
    2025-03-05T09:53:26.0966667+00:00

    Hello Akhil,

    Thank you for your answer. It is already useful. I saw the Roles data table but did not understand it properly.

    I am logged in with a user I am already using to create online meetings and townhall directly in Teams.

    What does it means "having the organizer role" ? do I need to do anything so that a user has this role ?

    Also I tried the graph explorer already, but I cannot make it works. For town halls especially, the permission tab is always empty which make it a bit useless.

    I manage to call the endpoint which returns the list of town halls, but for any reason it is empty even if I created townhalls in Teams.


  2. Émeric Trang 20 Reputation points
    2025-03-05T15:25:46.7466667+00:00

    Hello, I finally manage to make the call works.

    A mis configuration when calling the /token api endpoint.

    Thank you for your time !


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.