---
title: "Simulate a given expression for a Condition, Policy or Criteria Script."
slug: "simulate-a-given-expression-for-a-condition-policy-or-criteria-script-1"
updated: 2026-03-02T22:30:52Z
published: 2026-03-02T22:35:48Z
canonical: "support.appgate.com/simulate-a-given-expression-for-a-condition-policy-or-criteria-script-1"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.appgate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Simulate a given expression for a Condition, Policy or Criteria Script.

Post/conditions/test

Simulate a given expression for a Condition, Policy or Criteria Script.

SecurityHTTPType bearer

Body parameters

The evaluation details.

<select class='api-response-data' aria-label='Media type'><option value='290891b0-34d1-4bf0-8161-37fceff0748a'>application/json</option>
</select>Expand Allobject  expressionstring    Required

The javascript expression to evaluate.

Examplereturn claims.user.username === 'admin';
userClaimsobject  Example{
  "username": "admin",
  "groups": [
    "CN=test,OU=unit,DC=company,DC=com",
    "CN=finance,OU=unit,DC=company,DC=com"
  ]
}
deviceClaimsobject  Example{
  "os": {
    "name": "Microsoft Windows 10 Pro",
    "platform": "x64",
    "type": "desktop"
  },
  "isUserAdmin": true,
  "language": "en-us"
}
systemClaimsobject  Example{
  "connectTime": "2018-11-16T13:25:15.672Z",
  "tunIPv4": "15.0.0.24",
  "clientSrcIP": "192.168.111.184"
}
timestring  (date-time)    

Responses200

Evaluation result.

<select class='api-response-data' aria-label='Media type'><option value='c5f94e56-d38e-429d-b71d-492e8cb6aa61'>application/json</option>
</select>object  resultboolean    

Whether the evaluation succeeded or not.

outputstring    

The output logs from the evaluation. Generated by "console.log" and "print" functions.

ExampleDebug log
errorstring    

The error text. Available if the evaluation has an error.

ExampleExpression does not return boolean. Received: String
executionMsnumber    

How long it took to evaluate the expression.

Example201.0

400

JSON error. Check the JSON format.

<select class='api-response-data' aria-label='Media type'><option value='e78f46fd-7f98-4c65-9a36-ce1142342563'>application/json</option>
</select>object  

Generic HTTP error.

idstring    

Machine readable error code.

messagestring    

Human readable error details.

401

Token error. Login again.

<select class='api-response-data' aria-label='Media type'><option value='8ac2eeb3-f289-4176-92a0-fe99999b61c2'>application/json</option>
</select>object  

Generic HTTP error.

idstring    

Machine readable error code.

messagestring    

Human readable error details.

403

Insufficient permissions to access this resource.

<select class='api-response-data' aria-label='Media type'><option value='403096b6-77a6-432f-bd6d-fd7549eeb5b0'>application/json</option>
</select>object  

Generic HTTP error.

idstring    

Machine readable error code.

messagestring    

Human readable error details.

406

Invalid 'Accept' header.

<select class='api-response-data' aria-label='Media type'><option value='60e34ab5-e214-4a1f-8f38-d6813e31a8e6'>application/json</option>
</select>object  

Generic HTTP error.

idstring    

Machine readable error code.

messagestring    

Human readable error details.

422

Request validation error. Check "errors" array for details.

<select class='api-response-data' aria-label='Media type'><option value='ef74b632-cf97-4eed-8e09-ce08783ebd48'>application/json</option>
</select>Expand Allobject  

Http 422 error for object validation.

idstring    

Machine readable error code.

messagestring    

Human readable error details.

errors Array of object   

List of fields with validation errors.

object  fieldstring    

Name of the field that failed validation.

Examplename
messagestring    

Failure reason.

Examplemay not be null

500

Unexpected server side error.

<select class='api-response-data' aria-label='Media type'><option value='4b47856b-6b3d-4ccb-8ec5-ad2c63bf8cbe'>application/json</option>
</select>object  

Generic HTTP error.

idstring    

Machine readable error code.

messagestring    

Human readable error details.
