onlineMeeting: createOrGet

Namespace: microsoft.graph

Create an onlineMeeting object with a custom specified external ID. If the external ID already exists, this API will return the onlineMeeting object with that external ID.

Note: The meeting does not show on the user's calendar.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) OnlineMeetings.ReadWrite
Delegated (personal Microsoft account) Not supported.
Application OnlineMeetings.ReadWrite.All*

Important

* Administrators must create an application access policy and grant it to a user, authorizing the app configured in the policy to create or get an online meeting with external ID on behalf of that user (user ID specified in the request path).

HTTP request

To call createOrGet API with delegated token:

POST /me/onlineMeetings/createOrGet

To call createOrGet API with application token:

POST /users/{userId}/onlineMeetings/createOrGet

Note

userId is the object ID of a user in Microsoft Entra admin center > user management page. See more details in application access policy.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-type application/json. Required.

Request body

In the request body, provide a JSON object with the following parameters.

Parameter Type Description
endDateTime DateTime The meeting end time in UTC.
externalId String The external ID. A custom ID. (Required)
participants meetingParticipants The participants associated with the online meeting. This includes the organizer and the attendees.
startDateTime DateTime The meeting start time in UTC.
subject String The subject of the online meeting.

Notes:

  • If the startDateTime and endDateTime are not provided, the startDateTime will default to the current dateTime value and endDateTime value will equal the startDateTime + 1 hour.
  • If the startDateTime is provided, but endDateTime is not, the endDateTime value will equal the startDateTime + 1 hour.
  • An error is thrown if the endDateTime is provided without the startDateTime or if the endDateTime is earlier than the startDateTime.
  • When multiple users within the same tenant use the same externalId to run this query, different meeting instances are generated, each with its own unique ID. The combination of tenantId, userId, and externalId serves as the identifier for a meeting with an external ID.

Response

If successful, this method returns a 201 Created response code if a new meeting is created, or a 200 OK response code if an existing meeting is retrieved. In both cases, an onlineMeeting object is returned in the response body.

Examples

Request

The following example shows how to create or get an online meeting with an external ID.

POST https://graph.microsoft.com/v1.0/me/onlineMeetings/createOrGet
Content-Type: application/json

{
    "startDateTime": "2020-02-06T01:49:21.3524945+00:00",
    "endDateTime": "2020-02-06T02:19:21.3524945+00:00",
    "subject": "Create a meeting with customId provided",
    "externalId": "7eb8263f-d0e0-4149-bb1c-1f0476083c56",
    "participants": {
        "attendees": [
            {
                "identity": {
                    "user": {
                        "id": "1f35f2e6-9cab-44ad-8d5a-b74c14720000"
                    }
                },
                "upn": "test1@contoso.com"
            }
        ]
    }
}

Response

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "(redacted)",
    "creationDateTime": "2020-09-11T06:30:18.1909168Z",
    "startDateTime": "2020-09-11T06:30:18.0615989Z",
    "endDateTime": "2020-09-11T07:30:18.0615989Z",
    "joinWebUrl": "(redacted)",
    "subject": "Create a meeting with customId provided",
    "isBroadcast": false,
    "autoAdmittedUsers": "EveryoneInCompany",
    "isEntryExitAnnounced": true,
    "allowedPresenters": "everyone",
    "videoTeleconferenceId": "(redacted)",
    "externalId": "7eb8263f-d0e0-4149-bb1c-1f0476083c56",
    "participants": {
        "organizer": {
            "upn": "(redacted)",
            "role": "presenter",
            "identity": {
                "user": {
                    "id": "(redacted)",
                }
            }
        },
        "attendees": [
            {
                "upn": "test1@contoso.com",
                "role": null,
                "identity": {
                    "user": {
                        "id": "1f35f2e6-9cab-44ad-8d5a-b74c14720000",
                    }
                }
            }
        ],
        "producers": [],
        "contributors": []
    },
    "lobbyBypassSettings": {
        "scope": "organization",
        "isDialInBypassEnabled": false
    },
    "audioConferencing": {
        "conferenceId": "(redacted)",
        "tollNumber": "+1 206-485-3005",
        "tollFreeNumber": null,
        "dialinUrl": "https://dialin.teams.microsoft.com/0e73a853-1cc2-436c-b18c-9f53e0a97c24?id=(redacted)"
    },
    "chatInfo": {
        "threadId": "19:7ebda77322dd4505ac4dedb5b67df076@thread.tacv2",
        "messageId": "0",
        "replyChainMessageId": null
    },
}