Loading
Connect in real time with the Trailblazer Community in Slack Open BetaRead More
Set Up and Maintain Your Salesforce Organization
Update a Custom Pattern in a Scan Policy

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 PUT

Path 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
Example REQUEST BODY
{
  "expressionName": "US SSN",
  "expression": "\\d{3}-\\d{2}-\\d{4}"
}
Example
Example 200 RESPONSE BODY
{
  "id": "0DERM0000004Cff0AE",
  "status": "SUCCESS"
}
Example
Example 400 RESPONSE BODY
{

	"errorCode": "INVALID_ID_FIELD", "message": "The custom-pattern id in the URL is missing or malformed."
}
Example
Example 403 RESPONSE BODY
{

	"errorCode": "FUNCTIONALITY_NOT_ENABLED", "message": "The DataDetect headless API is not enabled for this org."
}
Example
Example 404 RESPONSE BODY
{

	"errorCode": "RESOURCE_NOT_FOUND", "message": "No policy exists for the supplied id."
}
 
Loading
Salesforce Help | Article