-
Notifications
You must be signed in to change notification settings - Fork 375
Open
Labels
needs peer reviewNeeds second pair of eyes to review the spec or PRNeeds second pair of eyes to review the spec or PRnew feature
Description
Usage
m365 outlook event add [options]
Description
Create an event in the default calendar or a specific calendar of a user
Options
| Option | Description |
|---|---|
--subject <subject> |
Subject of the event. |
--start <start> |
Start date and time in ISO 8601 format (for example 2026-02-10T09:00:00). |
--end <end> |
End date and time in ISO 8601 format (for example 2026-02-10T09:30:00). |
--userId [userId] |
ID of the user. Specify either userId or userName, but not both. |
--userName [userName] |
UPN of the user. Specify either userId or userName, but not both. |
--calendarId [calendarId] |
ID of the calendar. Specify either calendarId or calendarName, but not both. |
--calendarName [calendarName] |
Name of the calendar. Specify either calendarId or calendarName, but not both. |
--allowNewTimeProposals [allowNewTimeProposals] |
true if the organizer allows invitees to propose a new time when responding; otherwise, false. Default is true. |
--bodyContents [bodyContents] |
Body content of the event. You can also load from a file using @filePath. |
--bodyContentType [bodyContentType] |
Type of the body content. Available options: Text, HTML. Default is Text. |
--categories [categories] |
Comma-separated list of categories. |
--hideAttendees [hideAttendees] |
When set to true, each attendee only sees themselves in the meeting request and meeting tracking list. Default is false. |
--importance [importance] |
Importance of the event. Available options: low, normal, high. |
--isAllDay [isAllDay] |
Set to true if the event lasts all day. |
--isOnlineMeeting [isOnlineMeeting] |
Set to true to create the event as an online meeting. Default is false. |
--isReminderOn [isReminderOn] |
Set to true if an alert is set to remind the user of the event. |
--location [location] |
Location display name of the event (maps to location.displayName). Specify either location or locations, but not both. |
--locationEmailAddress [locationEmailAddress] |
Optional email address of the location (maps to location.locationEmailAddress). Requires location. |
--locations [locations] |
Comma-separated list of location display names (maps to locations[].displayName). Specify either location or locations, but not both. |
--onlineMeetingProvider [onlineMeetingProvider] |
Online meeting provider. Available options: teamsForBusiness, skypeForBusiness, skypeForConsumer, unknown. Default is unknown. |
--optionalAttendees [optionalAttendees] |
Comma-separated list of optional attendee email addresses. |
--recurrence [recurrence] |
Recurrence definition as JSON string. You can also load from a file using @filePath. |
--reminderMinutesBeforeStart [reminderMinutesBeforeStart] |
The number of minutes before the event start time that the reminder alert occurs. |
--requiredAttendees [requiredAttendees] |
Comma-separated list of required attendee email addresses. |
--resources [resources] |
Comma-separated list of resource attendee email addresses (added as resource attendees). |
--responseRequested [responseRequested] |
Default is true, which represents the organizer would like an invitee to send a response to the event. |
--sensitivity [sensitivity] |
Sensitivity of the event. Available options: normal, personal, private, confidential. |
--showAs [showAs] |
Status to show. Available options: free, tentative, busy, oof, workingElsewhere, unknown. |
--timeZone [timeZone] |
Time zone used for the event start and end. If not specified, the start and end times are in UTC. |
--transactionId [transactionId] |
Custom identifier to help avoid redundant POST operations in case of client retries. |
Examples
Create an event in the default calendar of the current signed in user.
m365 outlook event add --subject "Weekly sync" --start "2026-02-10T09:00:00" --end "2026-02-10T09:30:00"Create an event for a specific user using their UPN.
m365 outlook event add --userName "john.doe@contoso.com" --subject "Sprint review" --start "2026-02-10T14:00:00" --end "2026-02-10T15:00:00" --timeZone "Pacific Standard Time"Create an event in a specific calendar of a user.
m365 outlook event add --userName "john.doe@contoso.com" --calendarId "AAMkAGRkZ" --subject "Release planning" --start "2026-02-12T10:00:00" --end "2026-02-12T11:30:00"Create an event with required and optional attendees, categories, and a reminder.
m365 outlook event add --subject "Project kickoff" --start "2026-02-15T09:00:00" --end "2026-02-15T10:00:00" --requiredAttendees "alex@contoso.com,dana@contoso.com" --optionalAttendees "sam@contoso.com" --categories "Preset0,Preset6" --isReminderOn true --reminderMinutesBeforeStart 15Create an all day event with a physical location.
m365 outlook event add --subject "Company offsite" --start "2026-02-20T00:00:00" --end "2026-02-21T00:00:00" --isAllDay true --location "Head Office"Create an online meeting using Microsoft Teams and disallow new time proposals.
m365 outlook event add --subject "Customer demo" --start "2026-02-18T13:00:00" --end "2026-02-18T14:00:00" --isOnlineMeeting true --onlineMeetingProvider teamsForBusiness --allowNewTimeProposals falseCreate a recurring weekly event using a recurrence definition loaded from file.
m365 outlook event add --subject "Weekly status meeting" --start "2026-02-16T10:00:00" --end "2026-02-16T10:30:00" --recurrence @recurrence.jsonCreate an event with HTML body content loaded from a file and a custom transaction id.
m365 outlook event add --subject "Town hall" --start "2026-02-25T16:00:00" --end "2026-02-25T17:30:00" --bodyContents @invite.html --bodyContentType HTML --transactionId "townhall-2026-02"Additional Info
API: https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=http
Remarks
--timeZoneis used to set thestart.timeZoneandend.timeZonevalues in the request. If you pass onlystartandendwithouttimeZone, the defaut is UTC.- For
--isAllDay true, set start and end to midnight values and keep them in the same time zone. - After creating an online meeting by setting
isOnlineMeetingandonlineMeetingProvider, you can’t change those values later.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs peer reviewNeeds second pair of eyes to review the spec or PRNeeds second pair of eyes to review the spec or PRnew feature