Documentation
DecisionLens API
Integrate compliance-as-a-query into your AI agents. Get started in minutes with our REST API.
Quick Start
2. Make your first request
Use the /v1/evaluate endpoint to get a compliance verdict.
cURL
curl -X POST https://api.decisionlens.dev/v1/evaluate \
-H "Authorization: Bearer dl_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"policy_context": "compliance_standard_v1",
"decision_type": "action_approval",
"case": {
"action_type": "data_access",
"user_role": "analyst",
"data_classification": "sensitive"
},
"proposed_action": "APPROVE"
}'3. Handle the response
Every response includes a verdict,confidence score, and a complete reasoning_chain for audit purposes.
JSON Response
{
"request_id": "eval_8x7k2m9p",
"verdict": "APPROVE",
"confidence": 0.97,
"risk_score": 0.12,
"risk_flags": [],
"reasoning_chain": [
{
"step": 1,
"check": "User role verification",
"result": "PASS",
"logic": "User role 'analyst' is authorized for sensitive data access"
},
{
"step": 2,
"check": "Data classification check",
"result": "PASS",
"logic": "Analyst role permitted for 'sensitive' classification"
}
],
"explainability_text": "Action approved: User role is authorized for this data classification level.",
"matched_policy": "compliance_standard_v1",
"processing_time_ms": 47
}API Endpoints
POST
/v1/evaluateGET
/v1/policiesGET
/v1/policies/:slugGET
/v1/usageGET
/v1/healthBase URL: https://api.decisionlens.dev
Request Format
The /v1/evaluate endpoint accepts the following parameters:
| Parameter | Type | Description |
|---|---|---|
policy_context | string | Policy slug to evaluate against |
decision_type | string | Type of decision being made |
case | object | Context data for the decision |
proposed_action | string | Optional: proposed action to evaluate |
Response Format
Every response includes these fields:
| Field | Type | Description |
|---|---|---|
verdict | string | APPROVE, DENY, REVIEW, or ESCALATE |
confidence | number | Confidence score (0.0 - 1.0) |
reasoning_chain | array | Step-by-step reasoning for the verdict |
explainability_text | string | Human-readable explanation |
request_id | string | Unique ID for audit trail |
Code Example
Python
import requests
response = requests.post(
"https://api.decisionlens.dev/v1/evaluate",
headers={
"Authorization": "Bearer dl_live_xxx",
"Content-Type": "application/json"
},
json={
"policy_context": "compliance_standard_v1",
"decision_type": "action_approval",
"case": {
"action_type": "data_access",
"user_role": "analyst",
"data_classification": "sensitive"
}
}
)
result = response.json()
print(f"Verdict: {result['verdict']}")
print(f"Confidence: {result['confidence']}")
print(f"Explanation: {result['explainability_text']}")Authentication
All API requests require authentication via a Bearer token in the Authorization header:
Authorization: Bearer dl_live_your_api_key
Get your API key by signing up for a free account.
Ready to get started?
Sign up for a free account and get your API key in seconds.