Evaluate Policies

This endpoint consults all policies and checks the ones that satisfy the request body’s conditions.

Request body has the following properties:

AttributeTypeDescription
resourcestringLocation of the data used on the policy
contextobjectConditions that the Policy needs to satisfy

Request body example:

{
    "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert",
    "context" : {
        "brandId": "2000001",
        "discountPercentage": "91.00" 
    }
}

Response body has the following properties:

AttributeTypeDescription
idstringAction ID
metadataobjectMetadata object from the current action

Response body example:

[
    {
        "id": "SendSlackMessage",
        "metadata": {
            "channel": "C01NJFF35R6",
            "relatedUsers": [
                "URUNDC2NB"
            ],
            "alertDescription": "Avoid selling products from Berenice with a discount greater than 70%."
        }
    }
]
Language
URL
Click Try It! to start a request and see the response here!