Create a One-Time Data Detect Scan Policy
Creates a one-time Data Detect scan policy.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, and Developer editions with the Salesforce Shield or Data Detect Licenses. |
Example
curl https://MyDomainName.my.salesforce.com/services/data/v68.0/datadetect/policies/create -H "Authorization: Bearer token" -H "Content-Type: application/json" -d @policy.json -X POSTRequest Body Schema
| name | string | required | A unique name to identify the policy |
| description | string | optional | A description of what the policy scans for |
| scanType | string | required | Identifies whether the policy scans org data (PatternMatch) or
Data 360 DLOs (DCPatternMatch) |
| startTime | string (datetime) | required if scanType is PatternMatch. Unsupported if scanType
is DCPatternMatch |
Start time of a custom date range. Scans records whose SystemModstamp falls
between this time and endTime |
| endTime | string (datetime) | required if scanType is PatternMatch. Unsupported if scanType
is DCPatternMatch |
End time of a custom date range. Scans records whose SystemModstamp falls
between the startTime and this time |
Example REQUEST BODY
{
"name": "Customer PII policy",
"description": "Detect emails and phone numbers on Contact",
"scanType": "DCPatternMatch"
}
Example 200 RESPONSE BODY
{
"policyId": "1Doxx0000004C92",
"status": "SUCCESS"
}
Example 400 RESPONSE BODY
{
"errorCode": "MISSING_ARGUMENT", "message": "Required field 'name' is missing."
}
Example 401 RESPONSE BODY
{
"errorCode": "INVALID_SESSION_ID", "message": "Session expired or invalid."
}
Example 403 RESPONSE BODY
{
"errorCode": "INSUFFICIENT_ACCESS", "message": "You do not have access to DataDetect."
}
Did this article solve your issue?
Let us know so we can improve!
