API Reference

Cases

Investigation case management (theft, fraud) - maps to ThinkLP__Investigation__c

Cases — List Cases

  • Method/Path: GET /incidents
  • Summary: List Cases
  • Operation ID: listIncidents
  • Auth: bearerAuth (OAuth 2.0)

Description:

Retrieve cases with optional filtering (AND logic across all filters).

Date Filters (ISO 8601, open-ended ranges supported):

  • lastModifiedDateFrom / lastModifiedDateTo - Filter by LastModifiedDate
  • createdDateFrom / createdDateTo - Filter by CreatedDate
  • Formats: YYYY-MM-DD (date only) or YYYY-MM-DDTHH:mm:ssZ (full datetime)
  • Open-ended: Can specify only 'from' or only 'to' (or both)

Text Filters (exact match, case-sensitive):

  • incidentType - Incident type (e.g., "Theft", "Fraud")
  • investigationType - Investigation type (e.g., "External Theft")
  • status - Case status (e.g., "Open", "Closed")

Filter Combination: All filters are optional and combined with AND logic.

Example:

?lastModifiedDateFrom=2025-10-01&status=Open&incidentType=Theft

Returns all Theft incidents with Open status modified on/after Oct 1, 2025.

Parameters

NameInTypeRequiredDescriptionNotes
API-Versionheaderstring✅ YesAPI versionDefault: 1.0
lastModifiedDateFromquerystring (date-time)❌ NoFilter by LastModifiedDate >= (ISO 8601)Example: 2025-10-01 or 2025-10-01T00:00:00Z
lastModifiedDateToquerystring (date-time)❌ NoFilter by LastModifiedDate <= (ISO 8601)-
createdDateFromquerystring (date-time)❌ NoFilter by CreatedDate >= (ISO 8601)-
createdDateToquerystring (date-time)❌ NoFilter by CreatedDate <= (ISO 8601)-
incidentTypequerystring❌ NoExact match incident type (case-sensitive)Examples: Theft, Fraud
investigationTypequerystring❌ NoExact match investigation type (case-sensitive)Examples: External Theft, Internal Theft
statusquerystring❌ NoExact match status (case-sensitive)Examples: Open, Closed

Request Body

None

Responses

StatusContent-TypeDescription
200application/jsonList of cases (summary view)
400application/jsonInvalid input
401application/jsonInvalid/missing authentication
429application/jsonRate limit exceeded
500application/jsonUnexpected server error

Response Schema (200 OK)

Array of objects with the following structure:

[
  {
    "id": "a0lAw000004PBXSIA4",
    "incident_type": "Theft",
    "investigation_type": "External Theft",
    "incident_number": "C-20",
    "location_number": "LOC-1001",
    "location_id": "001Aw00000iaXKJIA2",
    "narrative": "Multiple suspects involved in organized retail theft",
    "status": "New",
    "total_estimated_value": 509.97,
    "incident_local_date": "2024-10-06",
    "incident_local_time": "14:30:00.000Z",
    "report_local_date": "2024-10-06",
    "report_local_time": "15:00:00.000Z",
    "police_department": null,
    "police_report_number": null,
    "police_officer_name": null,
    "concealment_method": null,
    "concealment_location": null,
    "uuid": "10eb033f-3ff9-4cc6-b151-ece9cd417314",
    "last_modified_date": "2025-11-04T16:45:34.000Z"
  }
]

Examples

Success Response (200):

[
  {
    "last_modified_date": "2025-11-04T16:45:34.000Z",
    "concealment_location": null,
    "concealment_method": null,
    "uuid": "10eb033f-3ff9-4cc6-b151-ece9cd417314",
    "police_officer_name": null,
    "police_report_number": null,
    "police_department": null,
    "report_local_time": "15:00:00.000Z",
    "report_local_date": "2024-10-06",
    "incident_local_time": "14:30:00.000Z",
    "incident_local_date": "2024-10-06",
    "total_estimated_value": 0.00,
    "status": "New",
    "narrative": "Multiple suspects involved in organized retail theft",
    "location_id": null,
    "location_number": null,
    "incident_number": "C-20",
    "investigation_type": "External Theft",
    "incident_type": "Theft",
    "id": "a0lAw000004PBXSIA4"
  },
  {
    "last_modified_date": "2025-11-04T16:44:15.000Z",
    "concealment_location": null,
    "concealment_method": null,
    "uuid": "712ffe7c-927e-46b4-b8a7-9baef219986d",
    "police_officer_name": null,
    "police_report_number": null,
    "police_department": null,
    "report_local_time": null,
    "report_local_date": null,
    "incident_local_time": "09:15:00.000Z",
    "incident_local_date": "2025-11-01",
    "total_estimated_value": 4520.00,
    "status": "In Progress",
    "narrative": null,
    "location_id": "001Aw00000iaXKJIA2",
    "location_number": "LOC-1001",
    "incident_number": "C-0",
    "investigation_type": "External",
    "incident_type": "Burglary",
    "id": "a0lAw000004PFb3IAG"
  }
]

Error Response (400 - Invalid Date):

{
  "error": "Invalid date format: invalid-date-format",
  "message": "Invalid input data.",
  "success": false
}

Error Response (401 - Session Expired):

[
  {
    "message": "Session expired or invalid",
    "errorCode": "INVALID_SESSION_ID"
  }
]

Notes

  • Filters use AND logic (all provided filters must match)
  • Date filters support open-ended ranges (only from or only to)
  • Text filters are case-sensitive exact matches
  • Returns summary view (excludes nested persons/vehicles/items)

Cases — Create Case

  • Method/Path: POST /incidents
  • Summary: Create Case
  • Operation ID: createIncident
  • Auth: bearerAuth (OAuth 2.0)

Parameters

NameInTypeRequiredDescriptionNotes
API-Versionheaderstring✅ YesAPI versionDefault: 1.0
Sourceheaderstring❌ NoData source for special processingEnum: FlockSafety

Request Body

Content-Type: application/json Required: ✅ Yes

Field Categories:

Read-Only Fields (Ignored if Sent):

  • incident_number - AutoNumber field (format: C-{number})
  • total_estimated_value - Roll-up from Case Items
  • total_recovered_value - Roll-up from recovered Case Items
  • Audit fields: created_date, last_modified_date, etc.

Date/Time Handling:

  • Preferred: incident_local_date + incident_local_time (separate fields)
  • Alternative: incident_date_time (ISO 8601 combined)
  • Default: If only date provided, time = midnight

Location Fields (Lookup Precedence):

  • location_number - External identifier (for lookup)
  • location_id - Direct Salesforce ID
  • Rule: If both provided, location_id takes precedence

Value Fields:

  • initial_case_value - Writable estimate at creation
  • Total case value auto-calculated from Case Items (read-only)

Key Fields:

FieldTypeRequiredDescriptionMax LengthNotes
incident_typestring❌ NoIncident type-Example: Organized Retail Crime
investigation_typestring❌ NoInvestigation type-Example: External Theft
narrativestring❌ NoCase narrative32000-
statusstring❌ NoCase status-Example: New
location_idstring❌ NoLocation Salesforce ID-Pattern: ^[a-zA-Z0-9]{15,18}$
incident_local_datestring (date)❌ NoIncident date (YYYY-MM-DD)-Example: 2024-10-06
incident_local_timestring❌ NoIncident time (local)-Pattern: HH:mm:ss.SSSZ, Example: 14:30:00.000Z
stagestring❌ NoCase stage (writeOnly)-Accepted in POST/PATCH, never returned in GET
sourcestring❌ NoCase source (writeOnly)-Accepted in POST/PATCH, never returned in GET
involved_personsarray❌ NoNested persons-Array of CreatePerson objects
vehiclesarray❌ NoNested vehicles-Array of CreateVehicle objects
stolen_itemsarray❌ NoNested items-Array of CreateItem objects

Example (Minimal):

{
  "incident_type": "Organized Retail Crime",
  "incident_local_date": "2024-11-09",
  "narrative": "Minimal case creation",
  "status": "New"
}

Example (Complex with Nested Entities):

{
  "incident_type": "Organized Retail Crime",
  "investigation_type": "External Theft",
  "incident_local_date": "2024-11-09",
  "incident_local_time": "14:30:00.000Z",
  "narrative": "Multiple suspects involved",
  "status": "New",
  "stage": "Investigation",
  "priority": "High",
  "case_owner": "John Smith",
  "investigator": "Jane Doe",
  "involved_persons": [
    {
      "first_name": "John",
      "last_name": "Doe",
      "person_type": "Suspect",
      "date_of_birth": "1985-05-15",
      "address": "123 Main St",
      "city": "Austin",
      "state": "TX",
      "postal_code": "78701"
    }
  ],
  "vehicles": [
    {
      "make": "TOYOTA",
      "model": "CAMRY",
      "year": "2020",
      "license_plate": "ABC123",
      "license_state": "CA"
    }
  ],
  "stolen_items": [
    {
      "description": "Nike Air Max Shoes",
      "quantity": 2,
      "retail_price": 129.99,
      "upc": "123456789012"
    }
  ]
}

Responses

StatusContent-TypeDescription
201application/jsonResource created successfully
400application/jsonInvalid input
401application/jsonInvalid/missing authentication
429application/jsonRate limit exceeded
500application/jsonUnexpected server error

Response Schema (201 Created)

{
  "id": "a0lAw000003eO6lIAE",
  "success": true,
  "message": "Incident created successfully",
  "attributes": {
    "type": "ThinkLP__Investigation__c",
    "url": "/services/apexrest/ThinkLP/incidents/a0lAw000003eO6lIAE"
  },
  "created_entity_ids": {
    "involved_persons": ["a0mAw000001XyZ1IAK"],
    "vehicles": ["a0nAw000002AbC3IAK"],
    "stolen_items": ["a0oAw000003DeF5IAK"]
  }
}

Examples

Success Response (201 - Simple):

{
  "id": "a0lAw000003eO6lIAE",
  "success": true,
  "message": "Incident created successfully",
  "attributes": {
    "type": "ThinkLP__Investigation__c",
    "url": "/services/apexrest/ThinkLP/incidents/a0lAw000003eO6lIAE"
  }
}

Success Response (201 - Complex with Nested Entities):

{
  "id": "a0lAw000003eO6lIAE",
  "success": true,
  "message": "Incident created successfully",
  "attributes": {
    "type": "ThinkLP__Investigation__c",
    "url": "/services/apexrest/ThinkLP/incidents/a0lAw000003eO6lIAE"
  },
  "created_entity_ids": {
    "involved_persons": ["a0mAw000001XyZ1IAK"],
    "vehicles": ["a0nAw000002AbC3IAK"],
    "stolen_items": ["a0oAw000003DeF5IAK"]
  }
}

Notes

  • Supports atomic creation of case with nested entities in single request
  • Source header triggers special processing (e.g., FlockSafety for ALPR data)
  • WriteOnly fields (stage, source, outcome, etc.) accepted in POST but never returned in GET
  • Returns Location header with created resource URL

Cases — Get Case

  • Method/Path: GET /incidents/{incidentId}
  • Summary: Get Case
  • Operation ID: getIncidentById
  • Auth: bearerAuth (OAuth 2.0)

Description:

Retrieve case with all nested entities (persons, vehicles, items).

Parameters

NameInTypeRequiredDescriptionNotes
incidentIdpathstring✅ YesSalesforce case IDPattern: ^[a-zA-Z0-9]{15,18}$, Example: a0lAw000003eO6lIAE
API-Versionheaderstring✅ YesAPI versionDefault: 1.0

Request Body

None

Responses

StatusContent-TypeDescription
200application/jsonCase with nested entities (detail view)
401application/jsonInvalid/missing authentication
404application/jsonResource not found
429application/jsonRate limit exceeded
500application/jsonUnexpected server error

Response Schema (200 OK)

Extends CaseSummary with nested entities:

{
  "id": "a0lAw000004UCO3IAO",
  "incident_type": "Organized Retail Crime",
  "investigation_type": "External Theft",
  "incident_number": "C-74",
  "narrative": "Updated narrative with additional evidence...",
  "status": "Closed",
  "total_estimated_value": 509.97,
  "incident_local_date": "2024-11-09",
  "incident_local_time": "14:30:00.000Z",
  "uuid": "62203c91-2e4c-440f-8508-30b0c7c21144",
  "last_modified_date": "2025-11-11T19:06:39.000Z",
  "involved_persons": [
    {
      "id": "a0kAw0000042FQUIA2",
      "name": "IC-110",
      "incident_id": "a0lAw000004UCO3IAO",
      "first_name": "Michael",
      "last_name": "Johnson",
      "person_type": "Suspect",
      "date_of_birth": "1990-03-20",
      "email": "[email protected]",
      "phone_number": "555-987-6543",
      "address": {
        "addressLine1": null,
        "addressLine2": null,
        "city": null,
        "state": null,
        "zipCode": null,
        "country": null
      }
    }
  ],
  "vehicles": [
    {
      "id": "a0kAw0000042H2VIAU",
      "name": "IC-109",
      "incident_id": "a0lAw000004UCO3IAO",
      "make": "TOYOTA",
      "model": "CAMRY",
      "year": "2020",
      "color": "Blue",
      "license_plate": "ABC123",
      "license_state": "CA"
    }
  ],
  "stolen_items": [
    {
      "id": "a09Aw00000FQYrpIAH",
      "name": "CI-41",
      "incident_id": "a0lAw000004UCO3IAO",
      "category": "Clothing",
      "description": "Nike Air Max Shoes",
      "quantity": 2,
      "retail_price": 129.99,
      "upc": "123456789012"
    }
  ]
}

Examples

Success Response (200):

See #/components/examples/ActualCaseDetail for full example (lines 1808-1931 of spec).

Error Response (404 - Not Found):

{
  "error": "Incident not found: 000000000000000AAA",
  "message": "Resource not found.",
  "success": false
}

Notes

  • Returns full case detail including all nested persons, vehicles, and items
  • Address fields returned as nested object with camelCase keys (addressLine1, zipCode, etc.)

Cases — Update Case

  • Method/Path: PATCH /incidents/{incidentId}
  • Summary: Update Case
  • Operation ID: updateIncident
  • Auth: bearerAuth (OAuth 2.0)

Description:

Partial update - only send fields to change. Omitted fields remain unchanged.

Null Handling: Send null to explicitly clear a field value. Nested Entities: To update persons/vehicles/items, use dedicated child endpoints.

Parameters

NameInTypeRequiredDescriptionNotes
incidentIdpathstring✅ YesSalesforce case IDPattern: ^[a-zA-Z0-9]{15,18}$
API-Versionheaderstring✅ YesAPI versionDefault: 1.0

Request Body

Content-Type: application/json Required: ✅ Yes

PATCH Semantics:

  • Omitted fields: Preserved (not modified)
  • Null values: Clear the field (set to null in database)
  • Provided values: Update the field
  • ReadOnly fields: Ignored if sent (incident_number, total_estimated_value, audit fields)

Key Fields (all optional):

FieldTypeDescriptionMax Length
incident_typestringIncident type-
investigation_typestringInvestigation type-
narrativestringCase narrative32000
statusstringCase status-
location_idstringLocation Salesforce ID-
incident_local_datestring (date)Incident date-
incident_local_timestringIncident time-
stagestringCase stage (writeOnly)-
sourcestringCase source (writeOnly)-

Example:

{
  "status": "In Progress",
  "narrative": "Updated narrative with new evidence",
  "priority": "High"
}

Responses

StatusContent-TypeDescription
200application/jsonResource updated successfully
400application/jsonInvalid input
401application/jsonInvalid/missing authentication
404application/jsonResource not found
429application/jsonRate limit exceeded
500application/jsonUnexpected server error

Response Schema (200 OK)

{
  "id": "a0lAw000003eO6lIAE",
  "success": true,
  "message": "Incident updated successfully",
  "attributes": {
    "type": "ThinkLP__Investigation__c",
    "url": "/services/apexrest/ThinkLP/incidents/a0lAw000003eO6lIAE"
  }
}

Examples

Success Response (200):

{
  "id": "a0lAw000003eO6lIAE",
  "success": true,
  "message": "Incident updated successfully",
  "attributes": {
    "type": "ThinkLP__Investigation__c",
    "url": "/services/apexrest/ThinkLP/incidents/a0lAw000003eO6lIAE"
  }
}

Notes

  • True PATCH semantics: only send fields to update
  • Send null to explicitly clear a field
  • Cannot update nested entities (use child endpoints)
  • ReadOnly fields ignored if sent