API Reference
The LetsCompl.ai gateway exposes a REST API for evaluating a JSON payload against a workspace's active rulesets.
Evaluation endpoint
POST https://api.letscompl.ai/api/v1/evaluate
Headers
Authorization: Bearer <YOUR_API_KEY>(required)Content-Type: application/json(required)
Request body fields
payload(object, required): the JSON action payload or tool-invocation arguments to evaluate.rules(array of strings, optional): restrict evaluation to this subset of rule keys instead of the workspace's full active policy. Omit to evaluate every active rule.pinnedVersions(object, optional): maps a rule key to a historical ruleset version number, for replaying a past policy decision instead of the currently enforced one.
The API does not redact the payload for you — redaction is a client-side feature of the SDKs (@letscomplai/sdk, letscomplai), which redact locally before the request is sent. If you call this endpoint directly (e.g. from curl or a language without an SDK), any PII/PHI you include in payload is sent as-is; redact it yourself first if needed.
Example request
BASHCode Block
curl -X POST https://api.letscompl.ai/api/v1/evaluate \
-H "Authorization: Bearer lc_live_8832a8..." \
-H "Content-Type: application/json" \
-d '{
"payload": {
"action": "wire_transfer",
"amount": 25000,
"recipient": "sanctioned-co"
}
}'Response fields
verdict:"approved","blocked", or"error".citation: for ablockedverdict,{ ruleId, ruleName, regulation, bundleRevision?, controlMappings? };nullotherwise.redactedPayload: the payload actually evaluated, with any PII/PHI tokens already applied by the caller.evaluations: per-rule results (pass,redact,flag,unsupported, orblock, each with the rule key and, forblock, the citation).unsupportedRules: rule keys that are active but have no registered evaluator; these are skipped, not blocked.policyScope:"full"when every active rule ran,"filtered"when the request'srulesfield restricted evaluation to a subset. A"filtered"response must never be treated as a complete compliance decision.evaluatedRules: the rule keys that actually ran, matchingpolicyScope.pinnedVersions: echoes back only the pins that were actually applied — a pin for a rule excluded by therulesfilter is dropped from both evaluation and this echo.latencyMs,llmUsed,piiRedacted,bundleRevision,dataAsOf,sdnDataAgeMs: supporting metadata: total evaluation latency, whether an LLM annotation step ran, whether the submitted payload had redaction tokens, the policy bundle revision, and sanctions-list freshness data where relevant.disclaimer: the exactLEGAL_DISCLAIMERstring fromlib/engine/disclaimer.ts, present on every response.error: present only whenverdictis"error"(e.g. a stale sanctions data source), describing why no verdict could be produced.
Example blocked response
JSONCode Block
{
"verdict": "blocked",
"citation": {
"ruleId": "sanctions_keyword",
"ruleName": "Sanctions Keyword Block",
"regulation": "31 CFR Chapter V - OFAC Sanctions Regulations"
},
"redactedPayload": {
"action": "wire_transfer",
"amount": 25000,
"recipient": "sanctioned-co"
},
"evaluations": [
{
"rule": "sanctions_keyword",
"result": "block",
"citation": {
"ruleId": "sanctions_keyword",
"ruleName": "Sanctions Keyword Block",
"regulation": "31 CFR Chapter V - OFAC Sanctions Regulations"
}
}
],
"unsupportedRules": [],
"policyScope": "full",
"evaluatedRules": ["sanctions_keyword"],
"disclaimer": "LetsCompl.ai is a technical enforcement tool, not a legal compliance service. Verdicts do not constitute legal advice."
}Example approved response
JSONCode Block
{
"verdict": "approved",
"citation": null,
"redactedPayload": { "action": "payout", "amount": 250 },
"evaluations": [{ "rule": "ftc_budget_cap", "result": "pass" }],
"unsupportedRules": [],
"policyScope": "full",
"evaluatedRules": ["ftc_budget_cap"],
"disclaimer": "LetsCompl.ai is a technical enforcement tool, not a legal compliance service. Verdicts do not constitute legal advice."
}Legal disclaimer
Every response includes the exact LEGAL_DISCLAIMER string defined in lib/engine/disclaimer.ts. Do not paraphrase or duplicate it elsewhere — reference the field.