Microsoft Purview eDiscovery v2
Run Microsoft Purview eDiscovery cases, holds and searches through Graph
Creates and closes eDiscovery cases, manages custodians and holds, runs searches with estimates, review sets and purges through Microsoft Graph.
microsoft-purview-ediscovery-v2_2.0.1.tgz
Community code that runs on your platform. A maintainer reviewed this exact source; the download is rebuilt from it. Follow the to install it.
Microsoft Purview eDiscovery v2 runs eDiscovery cases through Microsoft Graph: cases, custodians and their holds, data sources, searches with estimate statistics, review sets, exports, and Graph calls for anything else. Custodian, site and mailbox fields are checked before any request is sent. Errors from Graph are raised with the status and the Graph message.
Live-tested
On FortiSOAR 8.0.1 against a Microsoft 365 test tenant, all 38 operations returned a live success on version 2.0.1. Three results were live errors, and the error is the recorded result:
- Wait for Search Statistics and Wait for Operation: an estimate operation finished with status failed ("an eDiscovery action did not complete"). The failure is raised as the error; the operation is not hidden.
- List Case Operations with a search filter: Graph v1.0 case operations do not expose their search, so the filter is refused. List without the filter works.
The purge playbook branches ran on 2.0.1, including the permanent immediate purge.
Not live-tested
- Purge with the recoverable (soft) option, purged_recoverable: it ran live, but every soft purge left a residual copy of the data in the tenant, the documented purge-index behaviour. The outcome is not proven, so do not rely on a soft purge to remove the data. The permanent immediate purge is live.
Error classes 401, 403, 404 and 429 are replayed offline from the Graph error shape for every operation.
Configuration · 7 fields
- Tenant ID
tenant_idtext requiredMicrosoft Entra ID tenant (directory) ID or domain.
- Client ID
client_idtext requiredApplication (client) ID of the Entra ID app registration.
- Client Secret
client_secretpassword requiredClient secret of the app registration (Certificates & secrets).
- Graph Host
graph_hosttextMicrosoft Graph endpoint host. Default: https://graph.microsoft.com; national clouds use their own, for example https://graph.microsoft.us or microsoftgraph.chinacloudapi.cn. The Entra ID authority is matched to the host automatically unless Authority Host is set.
Default
https://graph.microsoft.com - Authority Host
authority_hosttextMicrosoft Entra ID authority host that issues tokens. Default: https://login.microsoftonline.com; national clouds use their own, for example https://login.microsoftonline.us or https://login.chinacloudapi.cn.
- Verify SSL
verify_sslcheckboxSpecifies whether SSL certificates are to be verified.
Default
true - Request Timeout (seconds)
timeouttextPer-request timeout in seconds applied to token and Graph calls.
Default
60
Operations · 38
Health Check
health_checkhealth_checkVerify the configuration end to end: acquire a token with the client credentials and read the first page of eDiscovery cases.
No parameters.
ReturnstypepropertiesList Cases 2 params
list_caseslist_casesList the eDiscovery cases of the tenant, optionally filtered by status. Follows @odata.nextLink until Limit items have been collected.
- Status
statusselect(Optional) Only cases with this status.
Options activependingDeleteclosingclosed - Limit
limitinteger(Optional) Stop after this many cases, at most 1000. Default: collect every page.
ReturnstypepropertiesCreate Case 2 params
create_casecreate_caseCreate a new eDiscovery case with a display name and an optional description.
- Display Name
display_nametext requiredThe case name.
- Description
descriptiontext(Optional) The case description.
ReturnstypepropertiesGet Case 1 param
get_caseget_caseRead the properties of one eDiscovery case.
- Case ID
case_idtext requiredThe id of the case.
ReturnstypepropertiesClose Case 1 param
close_caseclose_caseClose an eDiscovery case.
- Case ID
case_idtext requiredThe id of the case to close.
ReturnstypepropertiesReopen Case 1 param
reopen_casereopen_caseReopen a closed eDiscovery case.
- Case ID
case_idtext requiredThe id of the case to reopen.
ReturnstypepropertiesDelete Case 1 param
delete_casedelete_caseDelete an eDiscovery case. This is irreversible.
- Case ID
case_idtext requiredThe id of the case to delete.
ReturnstypepropertiesCreate Custodian 3 params
create_custodiancreate_custodianAdd a custodian to a case by email address. Graph v1.0 accepts only the email on create; when Apply Hold To Sources is true (default) the connector additionally issues the applyHold action for the new custodian.
- Case ID
case_idtext requiredThe id of the case.
- Email
emailtext requiredThe custodian's primary SMTP address.
- Apply Hold To Sources
apply_hold_to_sourcescheckboxStart applying hold to the custodian's data sources right after the custodian is added. Default: on.
Default
true
ReturnstypepropertiesCreate Custodians 3 params
create_custodianscreate_custodiansAdd every email address in a comma-separated list as a custodian of the case. Each address is matched against the custodians the case already has first, so a re-run reports those as already present instead of failing on the duplicate; one failing address never aborts the batch - the result list carries a status and, on failure, the error for every email. When Apply Hold To Sources is true…
- Case ID
case_idtext requiredThe id of the case.
- Emails
emailstext requiredComma-separated custodian SMTP addresses, e.g. 'alice@example.onmicrosoft.com, bob@example.onmicrosoft.com'.
- Apply Hold To Sources
apply_hold_to_sourcescheckboxStart applying hold to the data sources of every custodian this call creates. Default: on.
Default
true
ReturnstypepropertiesList Custodians 1 param
list_custodianslist_custodiansList the custodians of a case, following @odata.nextLink.
- Case ID
case_idtext requiredThe id of the case.
ReturnstypepropertiesGet Custodian 2 params
get_custodianget_custodianRead one custodian of a case, including its current hold status.
- Case ID
case_idtext requiredThe id of the case.
- Custodian ID
custodian_idtext requiredThe id of the custodian.
ReturnstypepropertiesRelease Custodian 2 params
release_custodianrelease_custodianRelease a custodian from a case: lifts holds and unbinds their data sources. Returns the release operation.
- Case ID
case_idtext requiredThe id of the case.
- Custodian ID
custodian_idtext requiredThe id of the custodian to release.
ReturnstypepropertiesActivate Custodian 2 params
activate_custodianactivate_custodianRe-activate a released custodian. Returns the activation operation.
- Case ID
case_idtext requiredThe id of the case.
- Custodian ID
custodian_idtext requiredThe id of the custodian to activate.
ReturnstypepropertiesApply Hold 2 params
apply_holdapply_holdStart applying hold to the listed custodians: one applyHold call per custodian id. Continues when a single id fails and reports the per-id results.
- Case ID
case_idtext requiredThe id of the case.
- Custodian IDs
custodian_idstext requiredComma-separated custodian ids to place on hold.
ReturnstypepropertiesRemove Hold 2 params
remove_holdremove_holdStart removing hold from the listed custodians: one removeHold call per custodian id. Continues when a single id fails and reports the per-id results.
- Case ID
case_idtext requiredThe id of the case.
- Custodian IDs
custodian_idstext requiredComma-separated custodian ids to release from hold.
ReturnstypepropertiesCreate Custodian User Source 3 params
create_custodian_user_sourcecreate_custodian_user_sourceAdd the custodian's mailbox and OneDrive for Business site to the case as a userSource, by SMTP address.
- Case ID
case_idtext requiredThe id of the case.
- Custodian ID
custodian_idtext requiredThe id of the custodian.
- Email
emailtext requiredThe SMTP address of the user's mailbox.
ReturnstypepropertiesCreate Custodian Site Source 3 params
create_custodian_site_sourcecreate_custodian_site_sourceAdd a SharePoint site to the custodian's data sources as a siteSource, by site web URL.
- Case ID
case_idtext requiredThe id of the case.
- Custodian ID
custodian_idtext requiredThe id of the custodian.
- Site Web URL
site_web_urltext requiredThe web URL of the SharePoint site.
ReturnstypepropertiesList Custodian User Sources 2 params
list_custodian_user_sourceslist_custodian_user_sourcesList the userSources (mailbox and OneDrive) associated with a custodian.
- Case ID
case_idtext requiredThe id of the case.
- Custodian ID
custodian_idtext requiredThe id of the custodian.
ReturnstypepropertiesList Custodian Site Sources 2 params
list_custodian_site_sourceslist_custodian_site_sourcesList the siteSources (SharePoint sites) associated with a custodian.
- Case ID
case_idtext requiredThe id of the case.
- Custodian ID
custodian_idtext requiredThe id of the custodian.
ReturnstypepropertiesCreate Non-Custodial Data Source 4 params
create_noncustodial_data_sourcecreate_noncustodial_data_sourceAdd data to the case without associating it with a custodian: either a mailbox (Email) or a SharePoint site (Site Web URL), never both. When Apply Hold To Source is true (default) the applyHold action is issued for the new data source.
- Case ID
case_idtext requiredThe id of the case.
- Email
emailtextThe SMTP address of the mailbox to add. Provide this or Site Web URL.
- Site Web URL
site_web_urltextThe web URL of the SharePoint site to add. Provide this or Email.
- Apply Hold To Source
apply_hold_to_sourcecheckboxStart applying hold to the data source right after it is added. Default: on.
Default
true
ReturnstypepropertiesList Non-Custodial Data Sources 1 param
list_noncustodial_data_sourceslist_noncustodial_data_sourcesList the non-custodial data sources of a case, following @odata.nextLink.
- Case ID
case_idtext requiredThe id of the case.
ReturnstypepropertiesCreate Search 7 params
create_searchcreate_searchCreate an eDiscovery (draft) search in a case with a KQL content query. Custodian IDs are expanded to each custodian's existing userSources and siteSources and bound through custodianSources@odata.bind; a custodian with no sources yet contributes nothing. Additional Sources entries (user mailboxes or SharePoint sites) are added through the additionalSources collection after creation. Data Source…
- Case ID
case_idtext requiredThe id of the case.
- Display Name
display_nametext requiredThe display name of the search.
- Description
descriptiontext(Optional) The description of the search.
- Content Query
content_querytext(Optional) The search query in KQL (Keyword Query Language).
- Data Source Scopes
data_source_scopesselect(Optional) When set, the collection spans an entire workload instead of individually referenced locations.
Default
noneOptions noneallTenantMailboxesallTenantSitesallCaseCustodiansallCaseNoncustodialDataSources - Additional Sources
additional_sourcesjson(Optional) JSON array of extra locations, each an object with type "user" (plus email) or "site" (plus site_web_url).
- Custodian IDs
custodian_idstext(Optional) Comma-separated custodian ids whose existing data sources become the custodianSources of the search.
ReturnstypepropertiesUpdate Search 6 params
update_searchupdate_searchUpdate the display name, description, KQL content query or data source scopes of an existing search.
- Case ID
case_idtext requiredThe id of the case.
- Search ID
search_idtext requiredThe id of the search to update.
- Display Name
display_nametext(Optional) A new display name.
- Description
descriptiontext(Optional) A new description.
- Content Query
content_querytext(Optional) A new query in KQL (Keyword Query Language).
- Data Source Scopes
data_source_scopesselect(Optional) A new workload scope.
Options noneallTenantMailboxesallTenantSitesallCaseCustodiansallCaseNoncustodialDataSources
ReturnstypepropertiesList Searches 2 params
list_searcheslist_searchesList the searches of a case, following @odata.nextLink until Limit items have been collected.
- Case ID
case_idtext requiredThe id of the case.
- Limit
limitinteger(Optional) Stop after this many searches, at most 1000. Default: collect every page.
ReturnstypepropertiesGet Search 2 params
get_searchget_searchRead one search, expanding lastEstimateStatisticsOperation so the latest estimate (counts, sizes, progress) is included when one has been run.
- Case ID
case_idtext requiredThe id of the case.
- Search ID
search_idtext requiredThe id of the search.
ReturnstypepropertiesDelete Search 2 params
delete_searchdelete_searchDelete a search from a case.
- Case ID
case_idtext requiredThe id of the case.
- Search ID
search_idtext requiredThe id of the search to delete.
ReturnstypepropertiesRun Estimate Statistics 3 params
run_estimate_statisticsrun_estimate_statisticsStart an estimate of the number and size of items matching the search, and return the created estimate operation (poll it through List Case Operations or Get Search Statistics).
- Case ID
case_idtext requiredThe id of the case.
- Search ID
search_idtext requiredThe id of the search to estimate.
- Statistics Options
statistics_optionstext(Optional) Comma-separated options: includeRefiners, includeQueryStats, includeUnindexedStats, advancedIndexing, locationsWithoutHits. Default: includeRefiners,includeQueryStats,includeUnindexedStats,locationsWithoutHits.
ReturnstypepropertiesGet Search Statistics 2 params
get_search_statisticsget_search_statisticsRead the last estimate statistics of a search: the indexed and unindexed item counts and sizes and the numbers of mailboxes and sites with hits, together with the estimate operation that produced them.
- Case ID
case_idtext requiredThe id of the case.
- Search ID
search_idtext requiredThe id of the search.
ReturnstypepropertiesWait For Search Statistics 4 params
wait_for_search_statisticswait_for_search_statisticsEstimate a search when it has no recent estimate yet, then wait for the statistics: the search is polled through its lastEstimateStatisticsOperation expansion until the estimate operation reaches succeeded or failed, or the timeout budget runs out. Returns the indexed and unindexed item counts and sizes plus the mailbox and site counts the estimate reported.
- Case ID
case_idtext requiredThe id of the case.
- Search ID
search_idtext requiredThe id of the search to estimate and wait for.
- Timeout Seconds
timeout_secondsinteger(Optional) Give up after this many seconds. Default: 300.
Default
300 - Poll Seconds
poll_secondsinteger(Optional) Seconds between polls. Default: 10.
Default
10
ReturnstypepropertiesResidual Copies 2 params
residual_copiesresidual_copiesCount the mail copies a search still matches outside Recoverable Items. Runs the search's content query against each custodian's mailbox through the Graph messages search (the app needs Mail.Read with admin consent). Use after a purge: a copy the purge moved to Recoverable Items is not counted; a copy still in a mail folder is. Returns the count per custodian and the total.
- Case ID
case_idtext requiredThe id of the case.
- Search ID
search_idtext requiredThe id of the search whose content query is checked.
ReturnstypepropertiesWait For Operation 4 params
wait_for_operationwait_for_operationPoll one long-running case operation (the resource an estimate, purge, export or add-to-review-set action returns) until its status reaches succeeded or failed, or the timeout budget runs out. Returns the operation resource and how long the wait took; a failed operation or a timeout is reported as a clear error.
- Case ID
case_idtext requiredThe id of the case.
- Operation ID
operation_idtext requiredThe id of the case operation to poll (the id field of the operation a long-running action returned).
- Timeout Seconds
timeout_secondsinteger(Optional) Give up after this many seconds. Default: 240.
Default
240 - Poll Seconds
poll_secondsinteger(Optional) Seconds between polls. Default: 10.
Default
10
ReturnstypepropertiesList Case Operations 2 params
list_case_operationslist_case_operationsList the long-running operations of a case (estimates, holds, add-to-review-set, exports, purges). A Search ID filter is refused: Graph v1.0 case operations do not expose their search.
- Case ID
case_idtext requiredThe id of the case.
- Search ID
search_idtext(Optional) Only operations bound to this search.
ReturnstypepropertiesCreate Review Set 2 params
create_review_setcreate_review_setCreate a review set in a case.
- Case ID
case_idtext requiredThe id of the case.
- Display Name
display_nametext requiredThe display name of the review set.
ReturnstypepropertiesList Review Sets 1 param
list_review_setslist_review_setsList the review sets of a case, following @odata.nextLink.
- Case ID
case_idtext requiredThe id of the case.
ReturnstypepropertiesAdd To Review Set 3 params
add_to_review_setadd_to_review_setStart adding the results of a search to a review set, and return the created operation.
- Case ID
case_idtext requiredThe id of the case.
- Search ID
search_idtext requiredThe id of the search whose results are added.
- Review Set ID
review_set_idtext requiredThe id of the target review set.
ReturnstypepropertiesExport Result 8 params
export_resultexport_resultStart exporting the results of an estimated search and return the export operation. Once the export has completed, the operation carries exportFileMetadata with a downloadUrl, fileName and size for every export file.
- Case ID
case_idtext requiredThe id of the case.
- Search ID
search_idtext requiredThe id of the estimated search to export.
- Display Name
display_nametext requiredThe display name of the export.
- Description
descriptiontext(Optional) The description of the export.
- Export Format
export_formatselect(Optional) Format of the exported emails. Default: pst.
Default
pstOptions pstmsg - Cloud Attachment Version
cloud_attachment_versionselect(Optional) Versions of cloud attachments to include in messages. Default: latest.
Default
latestOptions latestrecent10recent100all - Document Version
document_versionselect(Optional) Versions of SharePoint files to include. Default: latest.
Default
latestOptions latestrecent10recent100all - Export Location
export_locationselect(Optional) Scope of partially indexed items in the export. Default: responsiveLocations.
Default
responsiveLocationsOptions responsiveLocationsnonresponsiveLocations
ReturnstypepropertiesPurge Data 4 params
purge_datapurge_dataPurge the mailbox items or Teams messages matched by a search. Purge Type permanentlyDelete removes the items beyond recovery and recoverable moves them to the recoverable items folder; per Microsoft documentation Teams messages are permanently deleted for both purge types, and at most 100 items per location are purged. This action is destructive.
- Case ID
case_idtext requiredThe id of the case.
- Search ID
search_idtext requiredThe id of the search whose matched items are purged.
- Purge Type
purge_typeselect requiredControls soft delete or hard delete: recoverable moves items to the recoverable items folder, permanentlyDelete removes them beyond recovery.
Options permanentlyDeleterecoverable - Purge Areas
purge_areasselect requiredThe locations in scope of the purge: mailboxes (Exchange) or teamsMessages (Microsoft Teams).
Options mailboxesteamsMessages
ReturnstypepropertiesExecute API Request 4 params
execute_api_requestexecute_api_requestCall any eDiscovery Graph endpoint under /v1.0/security/cases and return the HTTP status code, the body and the Location header. Method is GET, POST, PATCH or DELETE. Path is relative to /v1.0/security/cases (for example ediscoveryCases/<case-id>/searches) or an absolute URL on the configured Graph Host only. Query is an optional JSON object of query options; Body is an optional JSON document…
- Method
methodselectHTTP method of the Graph call. Default GET.
Options GETPOSTPATCHDELETE - Path
pathtext requiredPath relative to /v1.0/security/cases, for example ediscoveryCases/<case-id>/searches/<search-id>. An absolute https URL is accepted only when its host is the configured Graph Host and its path is under /v1.0/security/cases. No query string here; use Query.
- Query
querytextarea(Optional) JSON object of query options, for example {"$top": 5} or {"$expand": "lastEstimateStatisticsOperation"}.
- Body
bodytextarea(Optional) JSON request body. Only sent with POST or PATCH; rejected for GET and DELETE.
Returnstypeproperties