ThinkLP
TheftCase API

Involved Vehicles

Serverhttps://yourorg.my.salesforce.com/services/apexrest/ThinkSDK/thinklp/api/v1

Attach and detach the vehicles involved in a case.


Attach a vehicle to a Theft Case by license plate

POST
https://yourorg.my.salesforce.com/services/apexrest/ThinkSDK/thinklp/api/v1
/theft-cases/{caseId}/involved-vehicles

Stores the vehicle as the incident reported it: plate, plateState and any of vin, year, make, model, color, style and description are written to the involvement itself, and no canonical Vehicle is ever created. A plate or VIN never links a Vehicle, because linking is a deliberate step an investigator takes: the involvement links a Vehicle only when vehicleId names one. The reported details are stored whether or not a Vehicle is linked. An id in the body is ignored: the request always adds a new involvement. A vehicleId that names no Vehicle returns 422 NATURAL_KEY_NOT_FOUND with the field and value that failed. A plateState outside the supported list returns 400 INVARIANT_VIOLATION naming plateState. involvementId is the caller-minted identifier of the involvement, and the attach is idempotent on it: repeating an attach whose involvementId is already stored on this case writes nothing and returns 200 with the stored involvement and replayed: true, and the rest of the repeated body is ignored. An involvementId already stored on another case returns 409 DUPLICATE_INVOLVEMENT_ID, and an uuid carried by more than one case returns 409 AMBIGUOUS_UUID. The change is written all or nothing; if any write fails, every row written so far is rolled back. The response body is read back after the write commits; if that read fails the request returns 500 although the attach was written, and repeating the attach returns the stored involvement.

Attach a vehicle to a Theft Case by license plate › path Parameters

caseId
​string · required

Salesforce Investigation record Id of the parent theft case, or the uuid of the Incident it was reported from. An Incident uuid names the Theft Case that Incident is in. A value that is neither returns 400 BAD_REQUEST, and one that names no case returns 404 NOT_FOUND. An uuid carried by more than one case returns 409 AMBIGUOUS_UUID, and an org whose active mapping carries no uuid column returns 400 INVARIANT_VIOLATION for an uuid.

Attach a vehicle to a Theft Case by license plate › Request Body

plate
​string · required

License plate number. Required.

plateState
​string | null

Plate-issuing state abbreviation, stored with the plate. It never causes a Vehicle to be linked.

vin
​string | null · maxLength: 17

Vehicle identification number as reported, stored as free text. It never links a Vehicle.

year
​string | null · maxLength: 4

Vehicle model year as reported.

make
​string | null

Vehicle make as reported.

model
​string | null

Vehicle model as reported.

color
​string | null

Vehicle color as reported.

style
​string | null

Vehicle body style as reported.

description
​string | null

Free-text description of the vehicle.

vehicleId
​string | null · salesforce-id

Existing canonical Vehicle to link. The only way this route links a Vehicle; a plate never does.

involvementId
​string | null · maxLength: 36

Caller-minted identifier of this involvement, reused unchanged on retry. At most 36 characters. Immutable after create.

notes
​string | null

Case-side context notes for the new junction.

Attach a vehicle to a Theft Case by license plate › Responses

OK — the involvementId was already stored on this case. The stored involvement is returned with replayed: true and nothing was written.

One involved-vehicle link on a theft case, carried in the `involvedVehicles` array. The involvement stores the vehicle as the incident reported it, in `plate`, `plateState`, `vin`, `year`, `make`, `model`, `color`, `style` and `description`, and may also link a canonical Vehicle through `vehicleId`; the link never replaces what was reported. The top-level detail fields report only what the involvement itself stores, so a body read from the API and sent back unchanged writes nothing derived from the Vehicle onto the involvement. vehiclePreview carries the linked Vehicle's own details on reads, and the API ignores it on writes. A null vehiclePreview on the response means no Vehicle is linked, or signals graceful degradation when the referenced Vehicle is deleted, archived, or FLS-stripped. At least one of `vehicleId` or a reported detail must be supplied. A reported detail with no column on the involvement (for example `externalId`) is rejected with `400 INVARIANT_VIOLATION` naming the property, never silently dropped.
replayed
​boolean · enum · required

Always true: the attach was a repeat and wrote nothing.

Enum values:
id
​string | null · salesforce-id

Salesforce record id of the Investigation_Vehicle__c junction row, assigned by Salesforce on insert. Null on POST cascade entry (new junction). Differs from involvementId, which the caller mints.

involvementId
​string | null · maxLength: 36

Caller-minted identifier of this involvement (for example a UUID v4), reused unchanged on retry. Stored on the junction's unique ThinkLPId column, which holds at most 36 characters, and returned on every read. Immutable after create: an update that sends a different value for a stored involvement returns 400 IMMUTABLE_FIELD; a value that differs only in case is the same value, and the stored spelling is kept. A value already held by another involvement, on this case or any other, or repeated inside one request, returns 409 DUPLICATE_INVOLVEMENT_ID; the comparison ignores case.

vehicleId
​string · salesforce-id

Canonical Vehicle id. Optional: link a Vehicle only when you know it. An id that names no Vehicle returns 422 NATURAL_KEY_NOT_FOUND. A reported plate or VIN never sets it. Immutable after create.

plate
​string | null

Plate number as reported. Stored on the involvement and returned on read.

plateState
​string | null

Issuing state for the plate, as reported. A state outside the supported list returns 400 INVARIANT_VIOLATION naming plateState.

vin
​string | null · maxLength: 17

Vehicle identification number as reported, stored as free text. Not unique on the involvement, and never links a Vehicle.

make
​string | null

Vehicle make as reported.

model
​string | null

Vehicle model as reported.

year
​string | null · maxLength: 4

Vehicle model year as reported, carried as a string.

color
​string | null

Vehicle color as reported.

style
​string | null

Vehicle body style as reported.

description
​string | null

Free-text description of the vehicle.

externalId
​string | null

Source-system identifier for the vehicle. The default involvement has no column for it, so a value sent on write is rejected with 400 INVARIANT_VIOLATION unless the org maps it.

notes
​string | null

Case-side mutable context for the junction.

​VehiclePreviewDto | null · readOnly

Read-only preview of the referenced Vehicle. Returned as null when no Vehicle is linked, or when the underlying Vehicle is deleted, archived, or FLS-stripped.


Detach involved vehicles from a Theft Case

DELETE
https://yourorg.my.salesforce.com/services/apexrest/ThinkSDK/thinklp/api/v1
/theft-cases/{caseId}/involved-vehicles

Detaches the involved vehicles named by involvementIds, the caller-minted ids, or by ids, the involvement row ids, without deleting the canonical Vehicle records. Sending both, or neither, returns 400 BAD_REQUEST. An id that does not belong to the case surfaces as 404 NOT_FOUND. The change is written all or nothing; if any write fails, every row written so far is rolled back. The case is loaded first, so the caller needs read access to it, and a failure reading it or a record it links to returns that error before anything is removed.

Detach involved vehicles from a Theft Case › path Parameters

caseId
​string · required

Salesforce Investigation record Id of the parent theft case, or the uuid of the Incident it was reported from. An Incident uuid names the Theft Case that Incident is in. A value that is neither returns 400 BAD_REQUEST, and one that names no case returns 404 NOT_FOUND. An uuid carried by more than one case returns 409 AMBIGUOUS_UUID, and an org whose active mapping carries no uuid column returns 400 INVARIANT_VIOLATION for an uuid.

Detach involved vehicles from a Theft Case › query Parameters

involvementIds
​string

Comma-separated caller-minted involvementId values of the involvements to detach, compared without regard to case. Send either involvementIds or ids, not both. An id that is not on the case returns 404 NOT_FOUND and nothing is removed.

ids
​string

Comma-separated InvolvedVehicleId values. Send either ids or involvementIds, not both.

Detach involved vehicles from a Theft Case › Responses

No Content — junctions detached.

No data returned

PUT
https://yourorg.my.salesforce.com/services/apexrest/ThinkSDK/thinklp/api/v1
/theft-cases/{caseId}/involved-vehicles/link

Links a stored involved vehicle to an existing canonical Vehicle, named by vehicleId, by vin, or by plate with plateState, and returns the updated involved vehicle. caseId in the path is a Salesforce id or an Incident uuid. Intake never looks a Vehicle up, because a plate match is a guess at identity; an investigator confirms it through this route. An org that stores involved vehicles inline has no Vehicle to link, so the route refuses every key, vehicleId, vin and plate, with 400 INVARIANT_VIOLATION naming inline storage, before any key is looked up. Linking never creates a canonical record and never changes one, and the reported details on the involved vehicle are kept as they are. Linking an involved vehicle to the record it already names writes nothing. A key that names no record returns 422 NATURAL_KEY_NOT_FOUND with the field and value that failed; a natural key that names several returns 422 NATURAL_KEY_AMBIGUOUS with the matching ids. A plateState outside the supported list matches no Vehicle, so a plate sent with one returns 422 NATURAL_KEY_NOT_FOUND with field plate. Send no key, or more than one of vehicleId, vin and plate, and the request returns 400 INVARIANT_VIOLATION; a plate is sent with its plateState. A caseId that names nothing, or an involvementId the case does not hold, returns 404 NOT_FOUND. The change is written all or nothing. The ids in an ambiguous answer are for Salesforce-side callers; a caller outside Salesforce settles the ambiguity with a more specific natural key.

caseId
​string · required

Salesforce Investigation record Id of the parent theft case, or the uuid of the Incident it was reported from. An Incident uuid names the Theft Case that Incident is in. A value that is neither returns 400 BAD_REQUEST, and one that names no case returns 404 NOT_FOUND. An uuid carried by more than one case returns 409 AMBIGUOUS_UUID, and an org whose active mapping carries no uuid column returns 400 INVARIANT_VIOLATION for an uuid.

involvementId
​string · required

The caller-minted identifier of the stored involved vehicle on this case, compared without regard to case. It names the involved vehicle to link; a value the case does not hold returns 404 NOT_FOUND.

vehicleId
​string · salesforce-id

Salesforce id of the canonical Vehicle to link.

vin
​string

VIN of the canonical Vehicle to link, matched ignoring case and surrounding spaces.

plate
​string

Plate of the canonical Vehicle to link, matched within plateState. Send it with plateState.

plateState
​string

State that issued plate. Send it with plate.

replace
​boolean

Set true to replace a different record the involved vehicle already names. Without it, an involved vehicle already linked to a different record returns 409 ALREADY_LINKED.

Default: false
oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · requires: vehicleId
type = object · requires: vin
type = object · requires: plate, plateState
Properties for Variant 1:
vehicleId
​string · salesforce-id · required

Salesforce id of the canonical Vehicle to link.

involvementId
​string

The caller-minted identifier of the stored involved vehicle on this case, compared without regard to case. It names the involved vehicle to link; a value the case does not hold returns 404 NOT_FOUND.

vin
​string

VIN of the canonical Vehicle to link, matched ignoring case and surrounding spaces.

plate
​string

Plate of the canonical Vehicle to link, matched within plateState. Send it with plateState.

plateState
​string

State that issued plate. Send it with plate.

replace
​boolean

Set true to replace a different record the involved vehicle already names. Without it, an involved vehicle already linked to a different record returns 409 ALREADY_LINKED.

Default: false

OK — the updated involved vehicle. Linking to the record the involved vehicle already names returns 200 and changes nothing.

One involved-vehicle link on a theft case, carried in the `involvedVehicles` array. The involvement stores the vehicle as the incident reported it, in `plate`, `plateState`, `vin`, `year`, `make`, `model`, `color`, `style` and `description`, and may also link a canonical Vehicle through `vehicleId`; the link never replaces what was reported. The top-level detail fields report only what the involvement itself stores, so a body read from the API and sent back unchanged writes nothing derived from the Vehicle onto the involvement. vehiclePreview carries the linked Vehicle's own details on reads, and the API ignores it on writes. A null vehiclePreview on the response means no Vehicle is linked, or signals graceful degradation when the referenced Vehicle is deleted, archived, or FLS-stripped. At least one of `vehicleId` or a reported detail must be supplied. A reported detail with no column on the involvement (for example `externalId`) is rejected with `400 INVARIANT_VIOLATION` naming the property, never silently dropped.
id
​string | null · salesforce-id

Salesforce record id of the Investigation_Vehicle__c junction row, assigned by Salesforce on insert. Null on POST cascade entry (new junction). Differs from involvementId, which the caller mints.

involvementId
​string | null · maxLength: 36

Caller-minted identifier of this involvement (for example a UUID v4), reused unchanged on retry. Stored on the junction's unique ThinkLPId column, which holds at most 36 characters, and returned on every read. Immutable after create: an update that sends a different value for a stored involvement returns 400 IMMUTABLE_FIELD; a value that differs only in case is the same value, and the stored spelling is kept. A value already held by another involvement, on this case or any other, or repeated inside one request, returns 409 DUPLICATE_INVOLVEMENT_ID; the comparison ignores case.

vehicleId
​string · salesforce-id

Canonical Vehicle id. Optional: link a Vehicle only when you know it. An id that names no Vehicle returns 422 NATURAL_KEY_NOT_FOUND. A reported plate or VIN never sets it. Immutable after create.

plate
​string | null

Plate number as reported. Stored on the involvement and returned on read.

plateState
​string | null

Issuing state for the plate, as reported. A state outside the supported list returns 400 INVARIANT_VIOLATION naming plateState.

vin
​string | null · maxLength: 17

Vehicle identification number as reported, stored as free text. Not unique on the involvement, and never links a Vehicle.

make
​string | null

Vehicle make as reported.

model
​string | null

Vehicle model as reported.

year
​string | null · maxLength: 4

Vehicle model year as reported, carried as a string.

color
​string | null

Vehicle color as reported.

style
​string | null

Vehicle body style as reported.

description
​string | null

Free-text description of the vehicle.

externalId
​string | null

Source-system identifier for the vehicle. The default involvement has no column for it, so a value sent on write is rejected with 400 INVARIANT_VIOLATION unless the org maps it.

notes
​string | null

Case-side mutable context for the junction.

​VehiclePreviewDto | null · readOnly

Read-only preview of the referenced Vehicle. Returned as null when no Vehicle is linked, or when the underlying Vehicle is deleted, archived, or FLS-stripped.