Documentation

DecisionLens API

Integrate compliance-as-a-query into your AI agents. Get started in minutes with our REST API.

Quick Start

1. Get your API key

Sign up for a free account to get your API key. No credit card required.

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/evaluate
GET/v1/policies
GET/v1/policies/:slug
GET/v1/usage
GET/v1/health

Base URL: https://api.decisionlens.dev

Request Format

The /v1/evaluate endpoint accepts the following parameters:

ParameterTypeDescription
policy_contextstringPolicy slug to evaluate against
decision_typestringType of decision being made
caseobjectContext data for the decision
proposed_actionstringOptional: proposed action to evaluate

Response Format

Every response includes these fields:

FieldTypeDescription
verdictstringAPPROVE, DENY, REVIEW, or ESCALATE
confidencenumberConfidence score (0.0 - 1.0)
reasoning_chainarrayStep-by-step reasoning for the verdict
explainability_textstringHuman-readable explanation
request_idstringUnique 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.