Create Case
Creates a new case for organizing files, analyses, and results related to a crash or legal matter.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Descriptive name for the case |
clientName | string | No | Name of the client associated with this case |
organizationId | string | No | ID 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 identifiername: Case nameclientName: Client name (if provided)organizationId: Organization ID (if associated)status: Case status (typically "active")creatorId: ID of the API key or user that created the casecreated: Creation timestamp (Unix seconds)updated: Last modification timestamp (Unix seconds)
Examples
- Go
- TypeScript
import (
"context"
"github.com/silentwitness/go-sdk"
)
// Basic case
response, err := silentwitness.Cases.Create(ctx, &silentwitness.CreateCaseRequest{
Name: "Smith v. Johnson",
})
// With client name
response, err := silentwitness.Cases.Create(ctx, &silentwitness.CreateCaseRequest{
Name: "Smith v. Johnson",
ClientName: silentwitness.String("Jane Smith"),
})
// With organization
orgID := "org_abc123"
response, err := silentwitness.Cases.Create(ctx, &silentwitness.CreateCaseRequest{
Name: "Smith v. Johnson",
ClientName: silentwitness.String("Jane Smith"),
OrganizationId: &orgID,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Created: %s (ID: %s)\n", response.Case.Name, response.Case.Id)
import { createCase } from "@silentwitness/typescript-sdk";
// Basic case
const response = await createCase({
name: "Smith v. Johnson"
});
// With client name
const response = await createCase({
name: "Smith v. Johnson",
clientName: "Jane Smith"
});
// With organization
const response = await createCase({
name: "Smith v. Johnson",
clientName: "Jane Smith",
organizationId: "org_abc123"
});
console.log(`Created: ${response.case.name} (ID: ${response.case.id})`);
Errors
| Code | Description |
|---|---|
INVALID_ARGUMENT | Missing required name field |
UNAUTHENTICATED | Invalid or missing API key |