Skip to main content

Create Case

Creates a new case for organizing files, analyses, and results related to a crash or legal matter.

Parameters

ParameterTypeRequiredDescription
namestringNoCase name. Auto-generated from plaintiff/defendant names if not provided.
plaintiffNamestringYesPlaintiff name (injured party)
defendantNamestringYesDefendant name (at-fault party)
attorneyNamestringYesAttorney name handling the case
sidestringNoWhich party the attorney represents: plaintiff or defense. Defaults to plaintiff.
organizationIdstringNoID of the organization to associate this case with
info

Empty string organizationId values are treated as null (no organization).

Response

Returns the created case with:

  • id: Unique case identifier
  • name: Case name (auto-generated as "PlaintiffLastName v. DefendantLastName" if not provided)
  • plaintiffName: Plaintiff name
  • defendantName: Defendant name
  • attorneyName: Attorney name
  • side: Which party the attorney represents (plaintiff or defense)
  • organizationId: Organization ID (if associated)
  • status: Case status (typically "active")
  • creatorId: ID of the API key or user that created the case
  • created: Creation timestamp (Unix seconds)
  • updated: Last modification timestamp (Unix seconds)

Examples

import (
"context"
"github.com/silentwitness/go-sdk"
)

// Basic case with required fields only
response, err := silentwitness.Cases.Create(ctx, &silentwitness.CreateCaseRequest{
PlaintiffName: "Jane Smith",
DefendantName: "Bob Johnson",
AttorneyName: "Jane Doe, Esq.",
})
// Auto-generates name: "Smith v. Johnson"

// With custom name
response, err := silentwitness.Cases.Create(ctx, &silentwitness.CreateCaseRequest{
Name: "Smith v. Johnson - Auto Accident",
PlaintiffName: "Jane Smith",
DefendantName: "Bob Johnson",
AttorneyName: "Jane Doe, Esq.",
})

// With side and organization
orgID := "org_abc123"
side := "defense"
response, err := silentwitness.Cases.Create(ctx, &silentwitness.CreateCaseRequest{
PlaintiffName: "Jane Smith",
DefendantName: "Bob Johnson",
AttorneyName: "Jane Doe, Esq.",
Side: &side,
OrganizationId: &orgID,
})

if err != nil {
log.Fatal(err)
}

fmt.Printf("Created: %s (ID: %s)\n", response.Case.Name, response.Case.Id)

Errors

CodeDescription
INVALID_ARGUMENTMissing required fields (plaintiffName, defendantName, or attorneyName)
INVALID_ARGUMENTInvalid side value (must be plaintiff or defense)
UNAUTHENTICATEDInvalid or missing API key