Get Policy by ID

Retrieves general information of a policy by its ID.

Response body object has the following properties:

AttributeTypeDescription
idstringPolicy ID
namestringPolicy Name
descriptionstringPolicy description. This description is only for internal use of identification
statementsarray of objectsRequirements to the Policy be applied
↳ actionsarray of objectsActions that the Policy will execute
↳↳ idstringAction ID. The possible values can be SendSlackMessage, SendEmail, and DeactivatePromotions
↳↳ metadataobjectData inside of the actions
↳ resourcestringScope on which this policy must be evaluated
↳ conditionobjectCondition to activate this policy. This object can have a maximum of ten recursive conditions
↳↳ conditionsarray of objectsList of conditions that will activate the policy
↳↳↳ conditionsarrayThese are the conditions the actions can have. The possible values are [], stringEquals, and numericGreaterThan
↳↳↳ operationstringThe action of the condition. This operation possible values are None, stringEquals, stringEqualsIgnoreCase, numericEquals, numericLessThan, numericLessThanEquals, numericGreaterThan, numericGreaterThanEquals, bool, not, or, and, dateTimeUtcGreaterThan, dateTimeUtcLessThan, and between
↳↳↳ keystringThe element that will define what the policy will influence. This field has the possible values skuId, brandId, discountPercentage
↳↳↳ valuesarrayValue of the key
↳↳ operationstringThis operation will determine if all the conditions need to be valid or at least one of them if the conditions array is not empty. The possible values to these fields are None, stringEquals, stringEqualsIgnoreCase, numericEquals, numericLessThan, numericLessThanEquals, numericGreaterThan, numericGreaterThanEquals, bool, not, or, and, dateTimeUtcGreaterThan, dateTimeUtcLessThan, and between

Response body example:

{
    "id": "pa_test_001",
    "name": "TestAlarmBerenice",
    "description": "TesteMarcosPromotionsAlert",
    "statements": [
        {
            "actions": [
                {
                    "id": "SendSlackMessage",
                    "metadata": {
                        "channel": "C01NJFF35R6",
                        "relatedUsers": [
                            "URUNDC2NB"
                        ],
                        "alertDescription": "Avoid selling products from Berenice with a discount greater than 70%."
                    }
                }
            ],
            "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert",
            "condition": {
                "conditions": [
                    {
                        "conditions": [],
                        "operation": "stringEquals",
                        "key": "brandId",
                        "values": [
                            "2000001"
                        ]
                    },
                    {
                        "conditions": [],
                        "operation": "numericGreaterThan",
                        "key": "discountPercentage",
                        "values": [
                            "70.00"
                        ]
                    }
                ],
                "operation": "and"
            }
        }
    ]
}
Language
URL
Click Try It! to start a request and see the response here!