API Reference

API Quickstart

Create a hosted intake session, redirect an applicant, and read the resulting case

Set your API base URL and key:

export KLAREFI_API_BASE_URL="https://api.klarefi.com"
export KLAREFI_API_KEY="sk_test_..."

Hosted Intake

Create a session when Klarefi should own the applicant-facing intake.

curl -X POST "$KLAREFI_API_BASE_URL/api/v1/sessions" \
  -H "Authorization: Bearer $KLAREFI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "case_type_id": "motor_claim",
    "idempotency_key": "session_claim_12345",
    "external_case_id": "claim_12345",
    "external_applicant_id": "applicant_789",
    "ttl_hours": 168,
    "locale": "nl"
  }'

The response contains a signed_url. Redirect the applicant there.

{
  "session_id": "550e8400-e29b-41d4-a716-446655440000",
  "signed_url": "https://app.klarefi.com/s/550e8400-e29b-41d4-a716-446655440000?token=...",
  "expires_at": "2026-01-22T10:30:00.000Z",
  "snippet": "<script>window.location.href=\"https://app.klarefi.com/s/...\";</script>",
  "idempotent_replay": false
}

For v1 hosted sessions, the session ID is also the case ID used by case reads.

curl "$KLAREFI_API_BASE_URL/api/v1/cases/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer $KLAREFI_API_KEY"

Advanced: Processing API

Use the Processing API only when Klarefi has enabled direct document submission for your pilot workspace.

curl -X POST "$KLAREFI_API_BASE_URL/api/v1/process" \
  -H "Authorization: Bearer $KLAREFI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: process_claim_12345_doc_1" \
  -d '{
    "document_url": "https://storage.example.com/claim-form.pdf",
    "case_type_id": "motor_claim",
    "external_case_id": "claim_12345",
    "trace_id": "trace_claim_12345"
  }'
{
  "case_id": "case_abc123",
  "doc_id": "doc_def456",
  "job_id": "job_ghi789",
  "status": "queued",
  "idempotent_replay": false
}

Poll events or rely on webhooks while the worker completes the intake.

curl "$KLAREFI_API_BASE_URL/api/v1/cases/case_abc123/events?after_cursor=0" \
  -H "Authorization: Bearer $KLAREFI_API_KEY"

When the case is ready, read the case package.

curl "$KLAREFI_API_BASE_URL/api/v1/cases/case_abc123/package" \
  -H "Authorization: Bearer $KLAREFI_API_KEY"

TypeScript SDK

The TypeScript SDK is not publicly published yet. Pilot teams should use the curl examples and OpenAPI reference unless Klarefi has granted private package access.

On this page