curl --request POST \
--url https://api.sandbox.humanity.org/v2/queries/evaluate \
--header 'Content-Type: application/json' \
--data '
{
"query": {
"check": {
"claim": "<string>",
"operator": "<unknown>",
"value": "<unknown>"
}
}
}
'{
"type": "<unknown>",
"passed": true,
"evaluatedAt": "<string>",
"evidence": {
"claimsUsed": [
{
"path": "<string>",
"value": "<unknown>",
"credentialId": "<string>",
"source": "<string>"
}
],
"checkResults": [
{
"claim": "<string>",
"operator": "<string>",
"expectedValue": "<unknown>",
"actualValue": "<unknown>",
"passed": true
}
]
},
"expiresAt": "<string>"
}Evaluate a query against the authenticated user’s credentials. This endpoint allows declarative queries to check user claims.
curl --request POST \
--url https://api.sandbox.humanity.org/v2/queries/evaluate \
--header 'Content-Type: application/json' \
--data '
{
"query": {
"check": {
"claim": "<string>",
"operator": "<unknown>",
"value": "<unknown>"
}
}
}
'{
"type": "<unknown>",
"passed": true,
"evaluatedAt": "<string>",
"evidence": {
"claimsUsed": [
{
"path": "<string>",
"value": "<unknown>",
"credentialId": "<string>",
"source": "<string>"
}
],
"checkResults": [
{
"claim": "<string>",
"operator": "<string>",
"expectedValue": "<unknown>",
"actualValue": "<unknown>",
"passed": true
}
]
},
"expiresAt": "<string>"
}// Predicate query (boolean check)
const result = await sdk.evaluateQuery({
accessToken: token.accessToken,
query: {
check: { claim: 'identity.age', operator: '>=', value: 18 }
}
});
// Projection query (data extraction)
const data = await sdk.evaluateQuery({
accessToken: token.accessToken,
query: {
projections: [{ claim: 'identity.email', lens: 'pluck' }]
}
});
true or false based on credential values.
{
"query": {
"check": {
"claim": "identity.age",
"operator": ">=",
"value": 18
}
}
}
| Operator | Description | Example |
|---|---|---|
== | Equals | { "claim": "kyc.passed", "operator": "==", "value": true } |
!= | Not equals | { "claim": "identity.country", "operator": "!=", "value": "US" } |
> | Greater than | { "claim": "financial.net_worth", "operator": ">", "value": 100000 } |
>= | Greater than or equal | { "claim": "identity.age", "operator": ">=", "value": 21 } |
< | Less than | { "claim": "identity.age", "operator": "<", "value": 65 } |
<= | Less than or equal | { "claim": "financial.loan_balance", "operator": "<=", "value": 50000 } |
in | Value in array | { "claim": "identity.country", "operator": "in", "value": ["US", "CA", "UK"] } |
notIn | Value not in array | { "claim": "identity.country", "operator": "notIn", "value": ["RU", "CN"] } |
contains | Array contains value | { "claim": "identity.social_accounts", "operator": "contains", "value": "github" } |
isDefined | Claim exists | { "claim": "kyc.document_number", "operator": "isDefined" } |
startsWith | String prefix | { "claim": "identity.email", "operator": "startsWith", "value": "admin@" } |
matchRegex | Regex match | { "claim": "identity.phone", "operator": "matchRegex", "value": "^\\+1" } |
{
"query": {
"policy": {
"allOf": [
{ "check": { "claim": "identity.age", "operator": ">=", "value": 21 } },
{ "check": { "claim": "identity.country", "operator": "==", "value": "US" } }
]
}
}
}
| Operator | Description |
|---|---|
allOf | AND - all conditions must pass |
anyOf | OR - at least one condition must pass |
not | NOT - negate the result |
{
"query": {
"policy": {
"allOf": [
{ "check": { "claim": "kyc.passed", "operator": "==", "value": true } },
{
"policy": {
"anyOf": [
{ "check": { "claim": "financial.net_worth", "operator": ">=", "value": 1000000 } },
{ "check": { "claim": "financial.income", "operator": ">=", "value": 200000 } }
]
}
}
]
}
}
}
{
"query": {
"projections": [
{ "claim": "identity.email", "lens": "pluck" },
{ "claim": "identity.country", "lens": "pluck" }
]
}
}
| Lens | Description |
|---|---|
pluck | Extract single value at path |
pick | Extract subset of object fields |
at | Array index access |
{
"type": "predicate",
"passed": true,
"evaluatedAt": "2026-01-16T12:00:00.000Z",
"evidence": {
"claimsUsed": [
{ "path": "identity.age", "value": 25, "credentialId": "cred_123" }
],
"checkResults": [
{
"claim": "identity.age",
"operator": ">=",
"expectedValue": 18,
"actualValue": 25,
"passed": true
}
]
},
"expiresAt": "2026-02-16T12:00:00.000Z"
}
{
"type": "projection",
"data": {
"identity.email": "user@example.com",
"identity.country": "US"
},
"evaluatedAt": "2026-01-16T12:00:00.000Z",
"claimsUsed": [
{ "path": "identity.email", "value": "user@example.com" },
{ "path": "identity.country", "value": "US" }
],
"expiresAt": "2026-02-16T12:00:00.000Z"
}
| Category | Example Claims |
|---|---|
identity | identity.age, identity.email, identity.country_of_residence |
kyc | kyc.passed, kyc.document_country, kyc.last_updated_at |
financial | financial.net_worth, financial.bank_balance, financial.loan_balance |
identity:read - Access to basic identity claimsidentity:date_of_birth - Access to age-related claimsfinancial:net_worth - Access to net worth dataThe query to evaluate
Request body for query evaluation.
The query to evaluate. Can be a simple check or compound policy.
Show child attributes
Query evaluation result
Response from predicate query evaluation.