@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Policies System API
@base https://apiexamples.vtexcommercestable.com.br
@auth ApiKey X-VTEX-API-AppKey in header | ApiKey X-VTEX-API-AppToken in header | ApiKey VtexIdclientAutCookie in header
@common_fields {Content-Type: str=application/json # Type of the content being sent., Accept: str=application/json # HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.}
@endpoints 6
@toc api(6)

@endpoint GET /api/policy-engine/policies
@desc Get policy list
@returns(200) OK

@endpoint POST /api/policy-engine/evaluate
@desc Evaluate policies
@required {resource: str # Scope on which this policy must be evaluated., context: map # Conditions that the policy needs to satisfy.}
@returns(200) OK
@example_request {"resource":"vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert","context":{"brandId":"2000001","discountPercentage":"91.00"}}

@endpoint GET /api/policy-engine/policies/{id}
@desc Get policy by ID
@required {id: str # Policy ID.}
@returns(200) OK

@endpoint POST /api/policy-engine/policies/{id}
@desc Create policy
@required {id: str # Policy ID., name: str # Policy name., description: str # Policy description, only for internal use., statements: [map{effect!: str, actions: [map], resource: str, condition: map}] # Requirements for the the policy to be applied.}
@optional {status: str # 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.}
@returns(200) OK

@endpoint PUT /api/policy-engine/policies/{id}
@desc Update policy
@required {id: str # Policy ID., name: str # Policy name., description: str # Policy description, only for internal use., statements: [map{effect!: str, actions: [map], resource: str, condition: map}] # Requirements for the the policy to be applied.}
@optional {status: str # 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.}
@returns(200) OK

@endpoint DELETE /api/policy-engine/policies/{id}
@desc Delete policy by ID
@required {id: str # Policy ID.}
@returns(200) 200 OK

@end
