Before you begin

Make sure you have the following before you start:

RequirementDetails
CaseForge accountSign up at dashboard.caseforge.io. Free Sandbox tier is sufficient for this guide.
API keyGenerate one in Dashboard → Settings → API Keys. Use a Sandbox key (cf_sand_…) for this guide.
Python 3.9+ or Node.js 18+Check your version: python --version or node --version.
pip or npmIncluded with standard Python and Node.js installations.
⚠ Keep your API key secret

Never commit your API key to source control. Use an environment variable or a secrets manager. See Authentication for best practices.

Step 1 — Install the SDK

Install the CaseForge SDK using your package manager. The SDK has no additional system dependencies.

Shell
pip install caseforge-sdk

Requires Python 3.9 or later. If you use a virtual environment (recommended), activate it first: python -m venv .venv && source .venv/bin/activate

Shell
npm install @caseforge/sdk

Requires Node.js 18 or later. The package ships with TypeScript type definitions — no @types package needed.

Verify the installation by printing the SDK version:

Python
python -c "import caseforge; print(caseforge.__version__)"
# 2.0.0
Node.js
node -e "const cf = require('@caseforge/sdk'); console.log(cf.VERSION)"
// 2.0.0

Step 2 — Configure your API key

The SDK reads your API key from the CASEFORGE_API_KEY environment variable by default. Set it in your shell before running your code:

Shell
# macOS / Linux
export CASEFORGE_API_KEY="cf_sand_your_key_here"

# Windows PowerShell
$env:CASEFORGE_API_KEY = "cf_sand_your_key_here"

You can also pass the key directly when you create a client instance — useful when you're reading from your own secrets system:

Python
import caseforge

# Reads CASEFORGE_API_KEY automatically
client = caseforge.Client()

# Or supply the key explicitly
client = caseforge.Client(api_key="cf_sand_your_key_here")
Node.js
import CaseForge from '@caseforge/sdk';

// Reads CASEFORGE_API_KEY automatically
const client = new CaseForge();

// Or supply the key explicitly
const client = new CaseForge({ apiKey: 'cf_sand_your_key_here' });

Step 3 — Create your first case

With the client configured, you can create an AML case. The following example creates a transaction_monitoring case for a customer flagged for structuring activity:

Python
import caseforge

client = caseforge.Client()

# Create a case
case = client.cases.create(
    subject_id="cust_7a2b4c",       # Your customer ID
    case_type="transaction_monitoring",
    priority="high",
    summary="Structuring — 12 cash deposits below $10k in 30 days",
    tags=["structuring", "cash", "q1-2026"],
)

print(f"Case created: {case.id}")
print(f"Status: {case.status}")
print(f"Assigned to: {case.assigned_to}")
print(f"Created at: {case.created_at}")
Node.js
import CaseForge from '@caseforge/sdk';

const client = new CaseForge();

// Create a case
const aCase = await client.cases.create({
  subjectId:  'cust_7a2b4c',
  caseType:   'transaction_monitoring',
  priority:   'high',
  summary:    'Structuring — 12 cash deposits below $10k in 30 days',
  tags:       ['structuring', 'cash', 'q1-2026'],
});

console.log(`Case created: ${aCase.id}`);
console.log(`Status: ${aCase.status}`);
console.log(`Assigned to: ${aCase.assignedTo}`);

Step 4 — Understand the response

A successful cases.create() call returns a Case object. The key fields you'll use most:

JSON response
{
  "id":           "case_9x4m1z",
  "subject_id":   "cust_7a2b4c",
  "case_type":    "transaction_monitoring",
  "status":       "open",
  "priority":     "high",
  "summary":      "Structuring — 12 cash deposits below $10k in 30 days",
  "tags":         ["structuring", "cash", "q1-2026"],
  "assigned_to":  null,
  "created_at":   "2026-03-09T14:22:11Z",
  "updated_at":   "2026-03-09T14:22:11Z"
}
FieldTypeDescription
idstringUnique case identifier. Use this to retrieve, update, or close the case.
statusstringopen, in_review, escalated, closed, or sar_filed.
prioritystringlow, medium, high, or critical.
assigned_tostring | nullAnalyst ID if the case is assigned. null when unassigned.
created_atstring (ISO 8601)UTC timestamp. All timestamps in the API use ISO 8601 format.

Step 5 — Verify in the dashboard

Open Dashboard → Cases in the CaseForge web app. You'll see the case you just created appear at the top of the case queue with status Open. Click it to view the full detail view, assign it to an analyst, or start attaching transactions.

✓ You're set up

You've installed the SDK, configured authentication, and created your first case. Next, learn how to authenticate securely for production deployments, or explore the full code sample library.

Next steps