Difference between two listed endpoints for creating an event

pklong 140 Reputation points
2023-08-31T01:13:35.5033333+00:00

https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=http

For creating an event, what would be the difference between these two endpoints?

POST /users/{id | userPrincipalName}/events

POST /users/{id | userPrincipalName}/calendar/events

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,866 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 41,286 Reputation points
    2023-09-01T08:42:11.93+00:00

    Hi @pklong

    If you're just creating an event in the user's default calendar, there's really no difference between the two endpoints.

    However, the /calendar/events endpoint is usually used to create events in a specific calendar, such as the user's birthday calendar:

    POST /users/{id | userPrincipalName}/calendars/{calendar id}/events
    

    Hope this helps.

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


1 additional answer

Sort by: Most helpful
  1. msft-gu 1,355 Reputation points
    2023-09-01T01:35:33.2566667+00:00

    Hi pklong,

    Good day and thank you for your question. I was able to use the two endpoints on my test environment and there was no difference when I checked in on OWA - Outlook - Calendar.

    Endpoint:

    POST /users/user@domain.com/events

    POST /users/user@domain.com/calendar/events


    If I answered your question, please upvote and accept it as an answer.

    0 comments No comments

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.