Current behavior
Endpoints such as:
- POST /v8/RestoreSessions/{restoreSessionId}/organization/mailboxes/{mailboxId}/exportToPst
- the equivalent item / folder export-to-PST actions, and the OneDrive / SharePoint export-to-ZIP actions
Problem / impact
Because the connection stays idle until generation finishes (no bytes, no headers), the synchronous model fights every layer between client and server:
- Time-to-first-byte exceeds normal timeouts. A multi-GB mailbox can take many minutes to build before the first byte; HTTP clients, reverse proxies, and load balancers time the "read" out and abort what is actually a healthy export.
- Automation/pipelines are held hostage. CI/CD jobs, message-queue workers, and orchestration tasks must block a worker (and often keep a broker delivery un-acked) for the full generation, tripping consumer/idle timeouts and starving other work.
- No progress or control. Until the stream starts there's no signal whether the server is still working or wedged, and no clean way to cancel.
An opt-in asynchronous flavor, ideally negotiated so existing integrations are unaffected — e.g. a Prefer: respond-async request header (RFC 7240) or an ?async=true query parameter:
- Kick off: the POST validates and enqueues the export, then returns 202 Accepted immediately, with a Location header pointing at an export-job/operation resource (the existing restore-session Export event would be a natural fit to reuse).
- Poll: GET that resource for status (Running → Success / Failed / Cancelled), ideally with progress and the final media type (PST vs split-ZIP) once known.
- Download: on Success, GET the generated file from a stable URL — keeping the existing Range support so the download itself remains resumable.
- (Optional) Clean up: a DELETE on the job to release the temp file explicitly, with TTL-based cleanup as a backstop.