Update a Custom Pattern in a Scan Policy
Replaces a custom pattern in a 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/{policyId}/custompatterns/{patternId} -H "Authorization: Bearer token" -H "Content-Type: application/json" -d @policy.json -X PUTPath Parameters
| policyId | string | required | ID of the scan policy that contains the custom pattern |
| patternId | string | required | ID of the custom pattern to update. The pattern must belong to the policy
specified in policyId. If the pattern doesn't exist or belongs to a
different policy, the request returns 400 |
Request Body Schema
| expressionName | string | required | A unique name to identify the custom pattern. The name can be up to 256
characters, may only contain A-Z
a-z
0-9
_
- and spaces |
| expression | string | required | The syntax of the regex. The expression can be up to 255 characters. Backreferences and lookaround aren’t supported |
Example REQUEST BODY
{
"expressionName": "US SSN",
"expression": "\\d{3}-\\d{2}-\\d{4}"
}
Example 200 RESPONSE BODY
{
"id": "0DERM0000004Cff0AE",
"status": "SUCCESS"
}
Example 400 RESPONSE BODY
{
"errorCode": "INVALID_ID_FIELD", "message": "The custom-pattern id in the URL is missing or malformed."
}
Example 403 RESPONSE BODY
{
"errorCode": "FUNCTIONALITY_NOT_ENABLED", "message": "The DataDetect headless API is not enabled for this org."
}
Example 404 RESPONSE BODY
{
"errorCode": "RESOURCE_NOT_FOUND", "message": "No policy exists for the supplied id."
}
Did this article solve your issue?
Let us know so we can improve!
