Edit

mailbox: createImportSession

Namespace: microsoft.graph

Create a session to import an Exchange mailbox item that was exported using the exportItems API.

This API is available in the following national cloud deployments.

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

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) MailboxItem.ImportExport Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application MailboxItem.ImportExport.All Not available.

HTTP request

POST /admin/exchange/mailboxes/{mailboxId}/createImportSession

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this action returns a 200 OK response code and a mailboxItemImportSession in the response body.

Examples

Request

The following example shows how to create an import session. The opaque URL, returned in the importUrl property of the response, is preauthenticated and contains the appropriate authorization token for subsequent POST queries in the https://outlook.office365.com domain. This token expires at the time specified in expirationDateTime. Don't customize this URL for subsequent POST operations.

POST https://graph.microsoft.com/v1.0/admin/exchange/mailboxes/MBX:e0643f21@a7809c93/createImportSession

Response

The following example shows the response.

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

HTTP/1.1 200 OK
Content-type: application/json
Content-length: 232

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.mailboxItemImportSession",
    "importUrl": "https://outlook.office365.com/api/gv1.0/Mailboxes('MBX:e0643f21@a7809c93')/importItem?authtoken=eyJhbGciOiJSUzI1NiIsImtpZCI6IjFTeXQ1b",
    "expirationDateTime": "2024-10-17T19:00:48.1052906Z"
}