Skip to main content
POST
PreviewRule

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
matcher
attributes · object
required

Which checks the candidate would apply to.

id
string<uuid> | null

Set to an existing rule's id to preview an edit to it — the candidate replaces that rule during resolution, so the result reflects the change rather than the addition of a second rule. Omit to preview a new rule.

dimension
enum<string>

The dimension the candidate would categorise along.

Available options:
CATEGORY_DIMENSION_UNSPECIFIED,
CATEGORY_DIMENSION_TECHNICAL,
CATEGORY_DIMENSION_GOVERNANCE
scope
enum<string>

Scope the candidate would be saved with. Defaults to RULE_SCOPE_WORKSPACE.

Available options:
RULE_SCOPE_UNSPECIFIED,
RULE_SCOPE_GLOBAL,
RULE_SCOPE_WORKSPACE
title
string

Title the candidate would be saved with. Does not affect the outcome.

Maximum string length: 200
category
string

The category the candidate would assign.

Required string length: 1 - 200
priority
integer<int32>

Priority the candidate would be saved with. It participates in resolution exactly as it would once saved, so previewing at the wrong priority reports the wrong impact.

Required range: -1000000 <= x <= 1000000
sampleSize
integer<int32> | null

How many check ids to return in each of the response's samples — it caps affected_entity_ids and explicit_category_entity_ids independently, so either may come back at this size. Defaults to 100, and may be 0 for counts only. The counts are always exact whatever this is set to.

Required range: 0 <= x <= 1000

Response

200 - application/json

Success

matchedCount

Checks whose predicate the candidate matches at all — its raw reach, whether or not it ends up winning them.

affectedCount

Checks whose effective category on the candidate's dimension would actually change. This is the rule's real impact. It equals newly_categorised_count + reassigned_count, and matched_count equals this plus unchanged_count.

newlyCategorisedCount

Of the affected checks, how many have no category on this dimension today.

reassignedCount

Of the affected checks, how many already have a different category that the candidate would take over. Worth a second look before saving.

unchangedCount

Checks the candidate matches whose effective category would not change. The three fields below say why, and add up to this one.

affectedEntityIds
string[]

A sample of the affected checks, ordered by entity id.

affectedEntityIdsTruncated
boolean

True when the sample was cut short by sample_size.

higherPriorityRuleCount

Of the unchanged checks, how many a rule of higher priority already wins, so the candidate never gets to assign anything. Raise the candidate's priority to take these over.

explicitCategoryCount

Of the unchanged checks, how many carry a category set explicitly on the check, or declared by the tool that produced it. Either outranks every rule, so these are the checks the candidate looks like it covers and does not — no priority will win them. Clear the explicit category to hand a check back to the rules.

sameCategoryCount

Of the unchanged checks, how many the candidate does win, assigning the category the check already has. Nothing to do about these; the rule is simply agreeing with what is there.

explicitCategoryEntityIds
string[]

A sample of the checks counted in explicit_category_count, ordered by entity id — the ones worth showing a customer, because a rule that reads as covering them does not.

explicitCategoryEntityIdsTruncated
boolean

True when that sample was cut short by sample_size.