Enforcement Rule
The enforcement rule resource.
Base/enforcementRule
GET
/enforcementRuleList enforcement rules
Retrieve a paginated list of enforcement rules. Filter, order, and select columns with PostgREST query parameters.
Query parameters
selectstringComma-separated columns to return. Defaults to all.
orderstringColumn to sort by, e.g. `createdAt.desc`.
limitintegerMaximum rows to return.
offsetintegerRows to skip, for pagination.
GET/enforcementRule
curl --request GET \
--url '<your-host>/enforcementRule?select=*&limit=10' \
--header 'Authorization: Bearer <api-key>'Response
[
{
"id": "abc123def456",
"companyId": "xyz789",
"family": "string",
"name": "Example",
"message": "string",
"severity": "string",
"conditionAst": "string",
"surfaces": []
}
]GET
/enforcementRuleRetrieve a enforcement rule
Fetch a single enforcement rule by filtering on `id`.
Query parameters
idstringMatch on the enforcement rule's `id`, e.g. `eq.{id}`.
GET/enforcementRule
curl --request GET \
--url '<your-host>/enforcementRule?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"family": "string",
"name": "Example",
"message": "string",
"severity": "string",
"conditionAst": "string",
"surfaces": []
}POST
/enforcementRuleCreate a enforcement rule
Create a new enforcement rule.
Body parameters
familyenforcementRuleFamilyrequirednamestringrequireddescriptionstringmessagestringrequiredseveritystringrequiredconditionAstobjectrequiredsurfacesenforcementRuleSurfacerequiredtargetTypeenforcementRuleTargetTyperequiredappliesToAllbooleanrequiredfilteredItemTypesarrayrequiredfilteredItemGroupIdsarrayrequiredfilteredItemMatchAllbooleanrequiredactivebooleanrequiredcustomFieldsobjectPOST/enforcementRule
curl --request POST \
--url <your-host>/enforcementRule \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"family":"string","name":"Example","description":"string","message":"string","severity":"string","conditionAst":"string","surfaces":[],"targetType":"string","appliesToAll":true,"filteredItemTypes":[],"filteredItemGroupIds":[],"filteredItemMatchAll":true,"active":true}'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"family": "string",
"name": "Example",
"message": "string",
"severity": "string",
"conditionAst": "string",
"surfaces": []
}PATCH
/enforcementRuleUpdate a enforcement rule
Update an existing enforcement rule, matched on `id`.
Body parameters
familyenforcementRuleFamilyrequirednamestringrequireddescriptionstringmessagestringrequiredseveritystringrequiredconditionAstobjectrequiredsurfacesenforcementRuleSurfacerequiredtargetTypeenforcementRuleTargetTyperequiredappliesToAllbooleanrequiredfilteredItemTypesarrayrequiredfilteredItemGroupIdsarrayrequiredfilteredItemMatchAllbooleanrequiredactivebooleanrequiredcustomFieldsobjectPATCH/enforcementRule
curl --request PATCH \
--url '<your-host>/enforcementRule?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"family":"string"}'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"family": "string",
"name": "Example",
"message": "string",
"severity": "string",
"conditionAst": "string",
"surfaces": []
}DELETE
/enforcementRuleDelete a enforcement rule
Delete a enforcement rule, matched on `id`. Returns 204 No Content.
Query parameters
idstringThe `id` of the enforcement rule to delete, e.g. `eq.{id}`.
DELETE/enforcementRule
curl --request DELETE \
--url '<your-host>/enforcementRule?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'204 No Content