Documentation

REST API Reference

Public DecisionsLayer APIs for logging decisions, attaching outcomes, reading decision history, and pulling analytics for production integrations.

Authentication

Base URL: https://api.decisionslayer.com. Public integration endpoints use a workspace API key.

headers.httphttp
X-API-Key: dl_live_...
Content-Type: application/json
Intentionally omitted. Account auth, password recovery, workspace administration, billing, Stripe webhooks, workspace configuration, and UI helper endpoints are not part of the public landing API reference.

Decisions and Outcomes

POST/api/v1/decisions

Logs a decision. external_decision_id is idempotent within a tenant.

Request example

Log a transaction review decisionbash
curl -X POST "$BASE_URL/api/v1/decisions" \
  -H "X-API-Key: $DL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "external_decision_id": "txn-review-2026-0001",
    "decision_type": "transaction_review",
    "subject": {
      "type": "transaction",
      "id": "txn_123"
    },
    "decision": {
      "action": "review",
      "status": "final"
    },
    "actors": [
      {
        "type": "model",
        "id": "risk-v5",
        "version": "5.2.1"
      }
    ],
    "evidence": [
      {
        "type": "score",
        "key": "risk_score",
        "value": "0.82"
      }
    ],
    "context": {
      "channel": "mobile",
      "region": "US"
    },
    "inputs": {
      "amount": 250,
      "currency": "USD"
    },
    "metadata": {
      "source_system": "payments-api"
    },
    "occurred_at": "2026-05-08T10:00:00Z"
  }'
GET/api/v1/decisions

Lists decisions. Common filters include decision_type, subject_type, subject_id, action, status, actor_type, actor_id, evidence_type, evidence_key, outcome_type, date_from, date_to, page, and page_size.

List recent transaction reviewsbash
curl "$BASE_URL/api/v1/decisions?decision_type=transaction_review&subject_type=transaction&page_size=25" \
  -H "X-API-Key: $DL_API_KEY"
GET/api/v1/decisions/{id}

Gets one decision with actors, evidence, context, inputs, metadata, and attached outcomes.

Get one decisionbash
curl "$BASE_URL/api/v1/decisions/$DECISION_ID" \
  -H "X-API-Key: $DL_API_KEY"
POST /api/v1/decisions/{id}/outcomes

Attaches an outcome when the DecisionsLayer decision ID is known.

Attach review resultbash
curl -X POST "$BASE_URL/api/v1/decisions/$DECISION_ID/outcomes" \
  -H "X-API-Key: $DL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "external_outcome_id": "outcome-2026-0001",
    "outcome_type": "review_result",
    "outcome_value": "approved",
    "payload": {
      "review_queue": "manual-tier-1",
      "reviewer_id": "agent_42"
    },
    "occurred_at": "2026-05-08T10:04:00Z"
  }'
POST/api/v1/outcomes

Attaches an outcome by external_decision_id or by subject reference.

Attach by external decision IDbash
curl -X POST "$BASE_URL/api/v1/outcomes" \
  -H "X-API-Key: $DL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "external_decision_id": "txn-review-2026-0001",
    "external_outcome_id": "outcome-2026-0001",
    "outcome_type": "review_result",
    "outcome_value": "approved",
    "payload": {
      "review_queue": "manual-tier-1"
    },
    "occurred_at": "2026-05-08T10:04:00Z"
  }'
Attach by subjectbash
curl -X POST "$BASE_URL/api/v1/outcomes" \
  -H "X-API-Key: $DL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": {
      "type": "transaction",
      "id": "txn_123"
    },
    "decision_type": "transaction_review",
    "outcome_type": "chargeback",
    "outcome_value": "not_fraud",
    "payload": {
      "case_id": "cb_789"
    },
    "occurred_at": "2026-05-12T15:30:00Z"
  }'
GET /api/v1/subjects/{subjectType}/{subjectId}/timeline

Returns decision and outcome history for a subject.

Get subject timelinebash
curl "$BASE_URL/api/v1/subjects/transaction/txn_123/timeline" \
  -H "X-API-Key: $DL_API_KEY"

Analytics and Observability

GET /api/v1/analytics/dashboard

Returns high-level dashboard metrics.

Get dashboard metricsbash
curl "$BASE_URL/api/v1/analytics/dashboard" \
  -H "X-API-Key: $DL_API_KEY"
GET /api/v1/analytics/effectiveness

Returns effectiveness metrics by evidence, actor, and latency.

Get effectiveness metricsbash
curl "$BASE_URL/api/v1/analytics/effectiveness" \
  -H "X-API-Key: $DL_API_KEY"
GET /api/v1/observability/summary

Returns current observability summary metrics.

Get observability summarybash
curl "$BASE_URL/api/v1/observability/summary?decision_type=transaction_review" \
  -H "X-API-Key: $DL_API_KEY"
GET /api/v1/observability/evidence

Returns evidence usage and quality metrics.

Get evidence metricsbash
curl "$BASE_URL/api/v1/observability/evidence?evidence_key=risk_score" \
  -H "X-API-Key: $DL_API_KEY"
GET /api/v1/observability/actors

Returns actor-level observability metrics.

Get model actor metricsbash
curl "$BASE_URL/api/v1/observability/actors?actor_type=model" \
  -H "X-API-Key: $DL_API_KEY"
GET /api/v1/observability/latency

Returns decision and outcome latency metrics.

Get latency metricsbash
curl "$BASE_URL/api/v1/observability/latency?decision_type=transaction_review" \
  -H "X-API-Key: $DL_API_KEY"

Decision Intelligence

These endpoints are available when the workspace plan includes Decision Intelligence.

GET /api/v1/decisions/{id}/quality

Returns quality details for one decision.

Get decision qualitybash
curl "$BASE_URL/api/v1/decisions/$DECISION_ID/quality" \
  -H "X-API-Key: $DL_API_KEY"
GET /api/v1/intelligence/quality-summary

Returns quality summary metrics.

Get quality summarybash
curl "$BASE_URL/api/v1/intelligence/quality-summary?decision_type=transaction_review" \
  -H "X-API-Key: $DL_API_KEY"
GET /api/v1/intelligence/evidence-correlation

Returns correlations between evidence and outcomes.

Get evidence correlationbash
curl "$BASE_URL/api/v1/intelligence/evidence-correlation?decision_type=transaction_review" \
  -H "X-API-Key: $DL_API_KEY"
GET /api/v1/intelligence/compare/actors

Compares decision actors.

Compare model actorsbash
curl "$BASE_URL/api/v1/intelligence/compare/actors?decision_type=transaction_review" \
  -H "X-API-Key: $DL_API_KEY"
GET /api/v1/intelligence/patterns

Returns detected decision and quality patterns.

Get patternsbash
curl "$BASE_URL/api/v1/intelligence/patterns?decision_type=transaction_review" \
  -H "X-API-Key: $DL_API_KEY"