---
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.
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.
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.
object
Generic HTTP error.
idstring
Machine readable error code.
messagestring
Human readable error details.
401
Token error. Login again.
object
Generic HTTP error.
idstring
Machine readable error code.
messagestring
Human readable error details.
403
Insufficient permissions to access this resource.
object
Generic HTTP error.
idstring
Machine readable error code.
messagestring
Human readable error details.
406
Invalid 'Accept' header.
object
Generic HTTP error.
idstring
Machine readable error code.
messagestring
Human readable error details.
422
Request validation error. Check "errors" array for details.
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.
object
Generic HTTP error.
idstring
Machine readable error code.
messagestring
Human readable error details.