Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Case Sections

Use This When

Use this page when a case workspace needs to save one part of a case at a time.

What You Will Build

You will build section updates for smaller forms, safer autosave, and clearer review screens.

What Must Already Be True

  • A durable case exists.
  • The UI knows the current case_id.
  • The product can decide which sections are visible to each role.

API Contract

Endpoint:

PATCH /api/v1/kyc-cases/{case_id}/sections/{section_name}

Body:

{
  "payload": {}
}

Common section names:

export type KycSectionName =
  | "service_context"
  | "end_user_identity"
  | "contact_verification"
  | "identity_document_verification"
  | "address_verification"
  | "screening"
  | "risk_assessment"
  | "decision"
  | "user_facing_summary"
  | "restricted_compliance_notes";

export async function patchKycSection(
  client: KycApiClient,
  caseId: string,
  sectionName: KycSectionName,
  payload: Record<string, unknown>
) {
  return client.patch<{ principal: string; section: unknown }>(
    `/api/v1/kyc-cases/${encodeURIComponent(caseId)}/sections/${sectionName}`,
    { payload }
  );
}

UI States

SectionTypical screen
end_user_identityIdentity details and subject profile.
contact_verificationEmail, phone, and contact checks.
identity_document_verificationDocument review status.
address_verificationResidence and proof-of-address status.
screeningScreening evidence and match review.
risk_assessmentRisk rationale and review notes.
user_facing_summaryCustomer-safe explanation.
restricted_compliance_notesInternal-only compliance notes.

Implementation Steps

  1. Split the case workspace into section components.
  2. Give each section its own draft, saving, saved, and error states.
  3. Save one section at a time.
  4. Refresh the case or section data after a successful save.
  5. Hide restricted sections from customer-facing routes.
  6. Keep backend authorization as the enforcement point.

Checkpoint

  • A section save updates only that part of the case.
  • Restricted sections are hidden from customer-facing routes.
  • Frontend role gating improves usability, while backend authorization remains the enforcement point.

Common Mistakes

  • Submitting the entire case for every small edit.
  • Assuming hidden frontend fields are a security control.
  • Saving restricted notes from customer routes.
  • Losing unsaved form state after a section error.