Policy

Create policy

Creates a new policy from scratch.

Permissions

Any user or API key must have at least one of the appropriate License Manager resources to be able to successfully run this request. Otherwise they will receive a status code 403 error. These are the applicable resources for this endpoint:

ProductCategoryResource
Promotions Policy EnginePoliciesCreate or Update Policy

There are no applicable predefined roles for this resource list. You must create a custom role and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see Authentication overview.

❗ To prevent integrations from having excessive permissions, consider the best practices for managing API keys when assigning License Manager roles to integrations.

post/api/policy-engine/policies/{id}

Path parameters

idstring required
Example:pa_test_001

Policy ID.

Headers

Content-Typestring required

Type of the content being sent.

Acceptstring required

HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand.

Request body

namestring required

Policy name.

descriptionstring required

Policy description, only for internal use.

statusstring

The status field defines if the policy is active or inactive. An active policy is enforced, while an inactive policy is stored but not applied.

Example request

{
  "name": "id",
  "description": "TesteMarcosPromotionsAlert",
  "status": "active",
  "statements": [
    {
      "effect": "Allow",
      "actions": [
        {
          "id": "SendSlackMessage"
        }
      ],
      "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert",
      "condition": {
        "operation": "None",
        "conditions": [
          {
            "conditions": [
              "None"
            ],
            "operation": "None",
            "key": "skuId",
            "values": [
              "40.00"
            ]
          }
        ]
      }
    }
  ]
}

Response

OK

Changes

Changed in 7 of the 51 revisions of this API.84750

  • f819dda515f123See the full diff
    • removed the request property statements/items/operation

      request-property-removed

    • removed the optional property items/statements/items/operation from the response with the 200 status

      response-optional-property-removed

    • added the new optional request property statements/items/condition/operation

      new-optional-request-property

    • added the new optional request property status

      new-optional-request-property

    • added the optional property items/statements/items/condition/operation to the response with the 200 status

      response-optional-property-added

    • the statements/items/condition/conditions/items/ request property type/format changed from / to object/

      request-property-type-changed

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the effect request property default value Allow was removed

      request-property-default-value-removed

    • the effect response's property default value Allow was removed for the status 200

      response-property-default-value-removed

  • c459ea5a8918224See the full diff
    • removed the enum value numericGreaterThan of the request property statements/items/condition/conditions/items/conditions

      request-property-enum-value-removed

    • removed the enum value stringEquals of the request property statements/items/condition/conditions/items/conditions

      request-property-enum-value-removed

    • added the new numericGreaterThan enum value to the items/statements/items/condition/conditions/items/conditions response property for the response status 200

      response-property-enum-value-added

    • added the new stringEquals enum value to the items/statements/items/condition/conditions/items/conditions response property for the response status 200

      response-property-enum-value-added

    • added the new numericGreaterThan enum value to the request property statements/items/condition/conditions/items/conditions

      request-property-enum-value-added

    • added the new stringEquals enum value to the request property statements/items/condition/conditions/items/conditions

      request-property-enum-value-added

    • removed the numericGreaterThan enum value from the items/statements/items/condition/conditions/items/conditions response property for the response status 200

      response-property-enum-value-removed

    • removed the stringEquals enum value from the items/statements/items/condition/conditions/items/conditions response property for the response status 200

      response-property-enum-value-removed

    • removed the request property statements/items/actions/id

      request-property-removed

    • removed the request property statements/items/actions/metadata

      request-property-removed

    • removed the optional property items/statements/items/actions/id from the response with the 200 status

      response-optional-property-removed

    • removed the optional property items/statements/items/actions/metadata from the response with the 200 status

      response-optional-property-removed

  • d03c6f9386df53939See the full diff
    • request property statements/items/actions/id was restricted to a list of enum values

      request-property-became-enum

    • request property statements/items/condition/conditions/items/conditions was restricted to a list of enum values

      request-property-became-enum

    • request property statements/items/condition/conditions/items/key was restricted to a list of enum values

      request-property-became-enum

    • request property statements/items/condition/conditions/items/operation was restricted to a list of enum values

      request-property-became-enum

    • request property statements/items/operation was restricted to a list of enum values

      request-property-became-enum

    • added the new enum value to the items/statements/items/condition/conditions/items/conditions response property for the response status 200

      response-property-enum-value-added

    • added the new DeactivatePromotions enum value to the items/statements/items/actions/id response property for the response status 200

      response-property-enum-value-added

    • added the new None enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new None enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new SendEmail enum value to the items/statements/items/actions/id response property for the response status 200

      response-property-enum-value-added

    • added the new SendSlackMessage enum value to the items/statements/items/actions/id response property for the response status 200

      response-property-enum-value-added

    • added the new and enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new and enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new between enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new between enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new bool enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new bool enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new brandId enum value to the items/statements/items/condition/conditions/items/key response property for the response status 200

      response-property-enum-value-added

    • added the new dateTimeUtcGreaterThan enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new dateTimeUtcGreaterThan enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new dateTimeUtcLessThan enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new dateTimeUtcLessThan enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new discountPercentage enum value to the items/statements/items/condition/conditions/items/key response property for the response status 200

      response-property-enum-value-added

    • added the new not enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new not enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new numericEquals enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new numericEquals enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new numericGreaterThan enum value to the items/statements/items/condition/conditions/items/conditions response property for the response status 200

      response-property-enum-value-added

    • added the new numericGreaterThan enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new numericGreaterThan enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new numericGreaterThanEquals enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new numericGreaterThanEquals enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new numericLessThan enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new numericLessThan enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new numericLessThanEquals enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new numericLessThanEquals enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new or enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new or enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new skuId enum value to the items/statements/items/condition/conditions/items/key response property for the response status 200

      response-property-enum-value-added

    • added the new stringEquals enum value to the items/statements/items/condition/conditions/items/conditions response property for the response status 200

      response-property-enum-value-added

    • added the new stringEquals enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new stringEquals enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new stringEqualsIgnoreCase enum value to the items/statements/items/condition/conditions/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new stringEqualsIgnoreCase enum value to the items/statements/items/operation response property for the response status 200

      response-property-enum-value-added

    • added the new enum value to the request property statements/items/condition/conditions/items/conditions

      request-property-enum-value-added

    • added the new DeactivatePromotions enum value to the request property statements/items/actions/id

      request-property-enum-value-added

    • added the new None enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new None enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new SendEmail enum value to the request property statements/items/actions/id

      request-property-enum-value-added

    • added the new SendSlackMessage enum value to the request property statements/items/actions/id

      request-property-enum-value-added

    • added the new and enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new and enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new between enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new between enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new bool enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new bool enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new brandId enum value to the request property statements/items/condition/conditions/items/key

      request-property-enum-value-added

    • added the new dateTimeUtcGreaterThan enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new dateTimeUtcGreaterThan enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new dateTimeUtcLessThan enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new dateTimeUtcLessThan enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new discountPercentage enum value to the request property statements/items/condition/conditions/items/key

      request-property-enum-value-added

    • added the new not enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new not enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new numericEquals enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new numericEquals enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new numericGreaterThan enum value to the request property statements/items/condition/conditions/items/conditions

      request-property-enum-value-added

    • added the new numericGreaterThan enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new numericGreaterThan enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new numericGreaterThanEquals enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new numericGreaterThanEquals enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new numericLessThan enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new numericLessThan enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new numericLessThanEquals enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new numericLessThanEquals enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new or enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new or enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new skuId enum value to the request property statements/items/condition/conditions/items/key

      request-property-enum-value-added

    • added the new stringEquals enum value to the request property statements/items/condition/conditions/items/conditions

      request-property-enum-value-added

    • added the new stringEquals enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new stringEquals enum value to the request property statements/items/operation

      request-property-enum-value-added

    • added the new stringEqualsIgnoreCase enum value to the request property statements/items/condition/conditions/items/operation

      request-property-enum-value-added

    • added the new stringEqualsIgnoreCase enum value to the request property statements/items/operation

      request-property-enum-value-added

    • request property statements/items/effect deprecated

      request-property-deprecated

    • response property items/statements/items/effect deprecated

      response-property-deprecated