Create an inventory rule
Adds a rule so scripts from a known vendor are justified without being reviewed one by one. Reconciliation runs straight away and applies the rule to scripts already in the inventory that are still unreviewed. A website is limited to 200 rules.
Requires the manager role on the website and the compliance plan feature.
An OpenID Connect access token issued by Keycloak, acting as the signed-in user.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Display name for the rule.
1 <= length <= 255Pattern to match script URLs against.
1 <= length <= 1024How urlPattern is read. glob uses * wildcards and is the default. regex is a regular expression, kept for existing integrations. Patterns are matched safely, and one with too many unbounded repetitions is rejected.
Applied to every script the pattern matches.
1 <= length <= 4096Tags to apply to every script this rule matches.
items <= 50Defaults to true.
Rules are tried from the lowest value up, and the first match wins. Put the most specific rules first.
0 <= valueResponse Body
application/json
curl -X POST "https://api-next.centralcsp.com/v1/workspaces/string/websites/string/compliance/rules" \ -H "Content-Type: application/json" \ -d '{ "name": "Stripe", "urlPattern": "https://*.stripe.com/*", "justification": "Stripe payment scripts, approved vendor." }'{ "id": "string", "workspaceId": "string", "websiteId": "string", "name": "Stripe", "urlPattern": "https://*.stripe.com/*", "patternType": "glob", "justification": "string", "tagIds": [ "string" ], "enabled": true, "sortOrder": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}