Reference
Code samples
Ready-to-run examples for every major CaseForge operation. Every sample assumes CASEFORGE_API_KEY is set in the environment. Swap Python and Node.js using the language tabs.
Case management
Create a case
Python
import caseforge
client = caseforge.Client()
case = client.cases.create(
subject_id="cust_7a2b4c",
case_type="transaction_monitoring", # or "sanctions_screening", "kyc_review"
priority="high", # low | medium | high | critical
summary="Rapid fund movement across 8 accounts in 48h",
tags=["layering", "q1-2026"],
assigned_to="analyst_kj9x", # Optional — assign immediately
)
Node.js
import CaseForge from '@caseforge/sdk';
const client = new CaseForge();
const aCase = await client.cases.create({
subjectId: 'cust_7a2b4c',
caseType: 'transaction_monitoring',
priority: 'high',
summary: 'Rapid fund movement across 8 accounts in 48h',
tags: ['layering', 'q1-2026'],
assignedTo: 'analyst_kj9x',
});
cURL
curl -X POST https://api.caseforge.io/v2/cases \
-H "Authorization: Bearer $CASEFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject_id": "cust_7a2b4c",
"case_type": "transaction_monitoring",
"priority": "high",
"summary": "Rapid fund movement across 8 accounts in 48h",
"tags": ["layering", "q1-2026"]
}'
List open cases
Python
# List the 20 most recent open cases assigned to a specific analyst
cases = client.cases.list(
status="open",
assigned_to="analyst_kj9x",
limit=20,
sort="created_at:desc",
)
for c in cases:
print(f"{c.id} {c.priority:8} {c.summary[:60]}")
Node.js
const cases = await client.cases.list({
status: 'open',
assignedTo: 'analyst_kj9x',
limit: 20,
sort: 'created_at:desc',
});
for (const c of cases) {
console.log(c.id, c.priority, c.summary.slice(0, 60));
}
cURL
curl "https://api.caseforge.io/v2/cases?status=open&assigned_to=analyst_kj9x&limit=20&sort=created_at:desc" \
-H "Authorization: Bearer $CASEFORGE_API_KEY"
Update a case
Python
# Escalate a case and add a note
updated = client.cases.update(
"case_9x4m1z",
status="escalated",
priority="critical",
note="Escalated after second analyst review. SAR filing recommended.",
)
Node.js
const updated = await client.cases.update('case_9x4m1z', {
status: 'escalated',
priority: 'critical',
note: 'Escalated after second analyst review. SAR filing recommended.',
});
File a Suspicious Activity Report (SAR)
CaseForge SAR fields map directly to FinCEN Form 111. The SDK validates required fields before submission and returns a draft SAR for review.
Python
# Create a SAR draft linked to an existing case
sar = client.sars.create(
case_id="case_9x4m1z",
filing_institution="First National Bank",
filing_institution_ein="12-3456789",
subject_id="cust_7a2b4c",
activity_type="structuring",
narrative="Customer made 12 cash deposits totaling $98,500 between "
"2026-02-01 and 2026-03-01, each below the $10,000 CTR threshold. "
"The pattern is consistent with structuring to evade reporting.",
transaction_amount=98500.00,
transaction_start_date="2026-02-01",
transaction_end_date="2026-03-01",
)
print(f"SAR draft: {sar.id}, status: {sar.status}") # draft
# Submit the draft for compliance manager review
submitted = client.sars.submit(sar.id)
Node.js
const sar = await client.sars.create({
caseId: 'case_9x4m1z',
filingInstitution: 'First National Bank',
filingInstitutionEin: '12-3456789',
subjectId: 'cust_7a2b4c',
activityType: 'structuring',
narrative: 'Customer made 12 cash deposits totaling $98,500 ...',
transactionAmount: 98500.00,
transactionStartDate: '2026-02-01',
transactionEndDate: '2026-03-01',
});
console.log(sar.id, sar.status); // draft
const submitted = await client.sars.submit(sar.id);
cURL
curl -X POST https://api.caseforge.io/v2/sars \
-H "Authorization: Bearer $CASEFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"case_id": "case_9x4m1z",
"filing_institution": "First National Bank",
"filing_institution_ein": "12-3456789",
"subject_id": "cust_7a2b4c",
"activity_type": "structuring",
"transaction_amount": 98500.00,
"transaction_start_date": "2026-02-01",
"transaction_end_date": "2026-03-01",
"narrative": "Customer made 12 cash deposits..."
}'
Watchlist screening
Screen a customer or entity against all active CaseForge watchlists before onboarding or before processing a high-value transaction.
Python
# Screen an entity by name and date of birth
result = client.watchlists.screen(
name="John A. Doe",
date_of_birth="1978-04-22",
country="US",
)
if result.matched:
print(f"⚠ {len(result.matches)} match(es) found")
for match in result.matches:
print(f" List: {match.list_name}")
print(f" Score: {match.confidence_score:.0%}")
print(f" Reason: {match.designation_reason}")
else:
print("No matches found.")
Node.js
const result = await client.watchlists.screen({
name: 'John A. Doe',
dateOfBirth: '1978-04-22',
country: 'US',
});
if (result.matched) {
console.log(`⚠ ${result.matches.length} match(es) found`);
result.matches.forEach(m => {
console.log(` List: ${m.listName}, Score: ${(m.confidenceScore * 100).toFixed(0)}%`);
});
} else {
console.log('No matches found.');
}
Transaction search
Search a subject's transaction history to gather evidence for a case or to identify patterns that warrant a SAR.
Python
# Find all cash transactions between $8,000 and $9,999
txns = client.transactions.search(
subject_id="cust_7a2b4c",
transaction_type="cash_deposit",
amount_min=8000,
amount_max=9999,
date_from="2026-02-01",
date_to="2026-03-01",
limit=50,
)
print(f"Found {txns.total} transactions totaling ${sum(t.amount for t in txns):,.2f}")
for t in txns:
print(f" {t.date} ${t.amount:,.2f} {t.branch_id}")
Node.js
const txns = await client.transactions.search({
subjectId: 'cust_7a2b4c',
transactionType: 'cash_deposit',
amountMin: 8000,
amountMax: 9999,
dateFrom: '2026-02-01',
dateTo: '2026-03-01',
limit: 50,
});
const total = txns.reduce((s, t) => s + t.amount, 0);
console.log(`${txns.total} transactions totalling $${total.toLocaleString()}`);
cURL
curl "https://api.caseforge.io/v2/transactions/search" \
-X POST \
-H "Authorization: Bearer $CASEFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject_id": "cust_7a2b4c",
"transaction_type": "cash_deposit",
"amount_min": 8000,
"amount_max": 9999,
"date_from": "2026-02-01",
"date_to": "2026-03-01"
}'