Warddocs
API

POST /api/v1/decide

POST https://api.mandatelabs.ai/api/v1/decide
X-API-Key: ward_live_...            (or Authorization: Bearer <token>)
Idempotency-Key: <your operation id>   optional
Content-Type: application/json

Body

Field Type Description
input object, required The capability's input (see each capability)
type string payment, intent, agent, screen, document, statement, ato, credit, merchant, kyc; inferred when omitted
model string Release id or alias; default ward-latest (Models)
subject_ref string ≤ 128 Your customer id (Subject memory)
subject_consent boolean You attest the customer consented; default false
session_id string ≤ 64 Groups calls of one review or chat (Sessions)
policy_baseline string Which of your policy baselines to cite; default default
async boolean Answer 202 with a job (Async)

Response 200

The decision envelope. 202 with a job when async is true.

{
  "id": "dec_01JC4Z8M2V",
  "object": "decision",
  "model": "ward-1.4.6",
  "components": {"statement_reader": "stm-reader-4", "statement_matrix": "stm-matrix-7", "screening": "screen-4"},
  "type": "statement",
  "created": 1793640000,
  "decision": "STEP_UP",
  "band": "medium",
  "score": 0.47,
  "score_kind": "heuristic",
  "signals": ["STM_PASS_THROUGH", "STM_FAN_IN"],
  "typologies": ["M12"],
  "needs": [{"field": "profile.monthly_income", "why": "Inflows are read against the declared income"}],
  "subject": null,
  "session_id": "case_771",
  "result": {"risk": {"band": "medium", "score": 0.47}, "signals": [], "flagged": [], "checks": {}},
  "context": {"window_tokens": 1000000, "used_tokens": 18422, "remaining_tokens": 981578, "used_pct": 1.84, "balance_usd": 412.33},
  "latency_ms": 412.6,
  "timing": {"inference_ms": 388.1, "total_ms": 412.6}
}

Errors

402 insufficient_balance, 403 account_suspended, 404 (capability not enabled), 409 idempotency_key_reused / in_progress, 413 call_too_large / window_full, 422 VALIDATION_ERROR / unknown_model / needs_mapping, 429 RATE_LIMITED. See Errors and limits.

Endpoint Does
GET /api/v1/decide/{id} The stored decision record (outputs only) with its feedback
GET /api/v1/decide/{id}/evidence Evidence pack
POST /api/v1/decide/{id}/feedback Feedback
GET /api/v1/sessions/{session_id} Decisions of a session