ThinkLP
ThinkLP API

ErrorEnvelope

The body every failure returns
​object · required

Incident

category
​string · const · required

The Incident category. It selects the Loss Prevention shape.

Const value: loss_prevention
​object · required

When the Incident happened, local to the location. A date and, when known, a time of day.

location_number
​string · minLength: 1 · required

The Location Number the business uses. It resolves to one location. A leading apostrophe or dropped leading zeros still match. A report with an apprehension needs the exact Location Number.

id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required

The Incident id, a UUID that the caller mints. The caller reuses it on every retry. The API trims it and folds it to lowercase.

​object[] · required

The people involved in the Incident, each under the id the caller minted. An involvement made outside this API has no such id and is not listed.

​object[] · required

The items involved in the Incident, each under the id the caller minted.

​object[] · required

The vehicles involved in the Incident, each under the id the caller minted.

incident_number
​string · required

The number people quote for the Incident, for example C-68.

offender_type
​string · enum

Who committed the Incident. Omit it when unknown, and then any listed Incident Type is valid. The Salesforce system of record refuses an Incident with no Offender Type with 422 INCIDENT_NOT_SUPPORTED_BY_SYSTEM_OF_RECORD.

Enum values:
internal
external
incident_type
​string · minLength: 1

The kind of Incident, as a key from GET /v1/incidents/options. Keys are the same for every tenant, but clients read them from the options and do not hard-code them. A key that does not apply to the Offender Type gets 422 INCIDENT_TYPE_NOT_ALLOWED. When the Offender Type is unknown, any listed key is valid. Omit it when unknown.

narrative
​string · minLength: 1

The free-text account of the Incident. Omit it when there is none.

​object

The estimated loss from the Incident. Omit it when unknown.

​object

How the theft happened: a primary Theft Method and an optional secondary. An unknown key, a missing primary, or a secondary equal to the primary gets 422 INCIDENT_RULE_VIOLATED with rule theft_method_not_allowed. Omit it when unknown. A stored method that has no key is left out on load.

concealment_device
​string · minLength: 1 · maxLength: 64

The device used to conceal the goods, as a key from concealment_devices in GET /v1/incidents/options. An unknown key gets 422 INCIDENT_RULE_VIOLATED with rule concealment_device_not_allowed. Omit it when unknown.

register_number
​string · maxLength: 80 · pattern: ^[^\p{Cc}\p{Cf}]*$

The register the goods passed, under the domain key register_number from the tenant case mapping. A blank value is left out. This is never a Salesforce field name. A value longer than 80 characters, or with a control or invisible format character such as a zero-width joiner, is a bad request. The refusal is on purpose: an invisible character must not make a blank value count as a register number. A mapping that does not define the key gets 422 INCIDENT_RULE_VIOLATED with rule register_number_not_defined. A mapping that requires it, when the report leaves it out, gets rule register_number_required. A value the org cannot store gets 422 INCIDENT_NOT_SUPPORTED_BY_SYSTEM_OF_RECORD with reason register_number.

entry_point
​string

How the offender got in, in free text of at most 100 characters, such as a door or a window. Any Incident can have one. A blank value is left out. A longer value gets 422 INCIDENT_RULE_VIOLATED with rule invalid_field. Weapon and injury detail goes in the narrative. Omit it when unknown.

​object

The Law Enforcement Detail: whether the police were called and, when they were, the facts about the call. A load returns it whenever the answer was recorded.

reported_at
​string · date-time · pattern: ^(?:(?:\d\d[2468][04…

When the system of record received the Incident. It is absent when the system of record keeps no reported time.

​object | null

The system the Incident came from and its id there, or null for an Incident made here or one that carries no reference. The API always sends it.

IncidentOptions

The values `POST /v1/incidents` validates against: the valid Incident Types (key and label) for each Offender Type, the Roles, the Theft Methods, the Concealment Devices, the license states, the item categories, and the tenant's customer fields.
​object · required

The valid Incident Types, keyed by Offender Type. They are the ThinkLP Loss Prevention list, which is the same for every tenant. A type that applies to both Offender Types appears under each. Send an entry's key as incident_type. Clients read keys here and do not hard-code them.

roles
​string[] · required

Every Role a person can be reported as playing in an Incident.

Enum values:
suspect
primary_suspect
witness
reporter
law_enforcement
other
​object[] · required

The valid Theft Methods. Send a key as theft_method.primary or theft_method.secondary. Clients read keys here and do not hard-code them.

​object[] · required

The valid Concealment Devices. Send a key as concealment_device. Clients read keys here and do not hard-code them.

​object[] · required

The states and provinces that can issue a plate, as key and label. Send a key as the state of an involved vehicle. Clients read keys here and do not hard-code them.

​object[] · required

The valid item categories. Send a key as the category of an involved item. Clients read keys here and do not hard-code them.

​object[] · required

The tenant's customer fields, in the order the case mapping gives them. Each key is the domain property key from the tenant case mapping, never a Salesforce field name. This is the one part of the options read from the system of record. It is empty when the tenant has no system of record, when the org defines none, or when the org cannot be reached. The register number has its own field, so it is never listed here.

Pagination

Where the page sits in the whole result
total
​integer · min: 0 · max: 9007199254740991

The number of matches

next_cursor
​string · minLength: 1

The cursor of the next page, absent on the last

page
​integer · min: 1 · max: 9007199254740991

The number of this page, from 1

page_size
​integer · min: 1 · max: 9007199254740991

The most matches a page holds

has_more
​boolean

Whether matches remain after this page

ReportIncidentRequest

category
​string · const · required

The Incident category. It selects the Loss Prevention shape.

Const value: loss_prevention
​object · required

When the Incident happened, local to the location. A date and, when known, a time of day.

location_number
​string · minLength: 1 · required

The Location Number the business uses. It resolves to one location. A leading apostrophe or dropped leading zeros still match. A report with an apprehension needs the exact Location Number.

id
​string · uuid · required

The Incident id. The caller mints this UUID and reuses it on every retry, so a retry names the same Incident.

offender_type
​string · enum

Who committed the Incident. Omit it when unknown, and then any listed Incident Type is valid. The deprecated value both also means unknown. The Salesforce system of record refuses an Incident with no Offender Type with 422 INCIDENT_NOT_SUPPORTED_BY_SYSTEM_OF_RECORD.

Enum values:
internal
external
both
incident_type
​string · minLength: 1

The kind of Incident, as a key from GET /v1/incidents/options. Keys are the same for every tenant, but clients read them from the options and do not hard-code them. A key that does not apply to the Offender Type gets 422 INCIDENT_TYPE_NOT_ALLOWED. When the Offender Type is unknown, any listed key is valid. Omit it when unknown.

narrative
​string · minLength: 1

The free-text account of the Incident. Omit it when there is none.

​object

The estimated loss from the Incident. Omit it when unknown.

​object

How the theft happened: a primary Theft Method and an optional secondary. An unknown key, a missing primary, or a secondary equal to the primary gets 422 INCIDENT_RULE_VIOLATED with rule theft_method_not_allowed. Omit it when unknown. A stored method that has no key is left out on load.

concealment_device
​string · minLength: 1 · maxLength: 64

The device used to conceal the goods, as a key from concealment_devices in GET /v1/incidents/options. An unknown key gets 422 INCIDENT_RULE_VIOLATED with rule concealment_device_not_allowed. Omit it when unknown.

register_number
​string · maxLength: 80 · pattern: ^[^\p{Cc}\p{Cf}]*$

The register the goods passed, under the domain key register_number from the tenant case mapping. A blank value is left out. This is never a Salesforce field name. A value longer than 80 characters, or with a control or invisible format character such as a zero-width joiner, is a bad request. The refusal is on purpose: an invisible character must not make a blank value count as a register number. A mapping that does not define the key gets 422 INCIDENT_RULE_VIOLATED with rule register_number_not_defined. A mapping that requires it, when the report leaves it out, gets rule register_number_required. A value the org cannot store gets 422 INCIDENT_NOT_SUPPORTED_BY_SYSTEM_OF_RECORD with reason register_number.

entry_point
​string

How the offender got in, in free text of at most 100 characters, such as a door or a window. Any Incident can have one. A blank value is left out. A longer value gets 422 INCIDENT_RULE_VIOLATED with rule invalid_field. Weapon and injury detail goes in the narrative. Omit it when unknown.

​object

The Law Enforcement Detail: whether the police were called and, when they were, the facts about the call. A load returns it whenever the answer was recorded.

​object[] · maxItems: 100

The people involved in the Incident, at most 100.

Default: []
​object[] · maxItems: 100

The items involved in the Incident, at most 100.

Default: []
​object[] · maxItems: 100

The vehicles involved in the Incident, at most 100.

Default: []
​object

The system this Incident came from and its id there. A second report with the same source and id answers 200 with the first Incident and creates no second one. A report made while the first is still being filed gets 409 EXTERNAL_REFERENCE_IN_FLIGHT with Retry-After; retry it. Omit it for an Incident made here.

​object

The values of the tenant's customer fields. Each key is the domain property key from the tenant case mapping, as customer_fields[].key in GET /v1/incidents/options names it, and never a Salesforce field name. Each value is text. Values are trimmed, and a blank value is left out. A key that does not match ^[A-Za-z][A-Za-z0-9_]{0,79}$, the key register_number, a value longer than 32768 characters, or more than 50 entries gets 422 INCIDENT_RULE_VIOLATED with rule invalid_field and field customer_fields. A key the mapping does not define gets rule customer_field_not_defined, and a required field left out gets rule customer_field_required, both with field customer_fields. A value the org cannot store gets 422 INCIDENT_NOT_SUPPORTED_BY_SYSTEM_OF_RECORD with reason customer_field. After any of those three refusals, read the options again. An API instance remembers the fields for up to 5 minutes, so that read can still return the old list for a while.

ReportIncidentResult

The result of reporting an Incident.
id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required

The id of the reported Incident.

incident_number
​string

Not returned for a Loss Prevention incident: its number is given by the system of record, so read the incident to see it.

audit.assignment.get.v1_audits_assignable-users.response

​object[]
user_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
display_name
​string · required
email
​string | null · required
role_code
​string | null · required

audit.assignment.patch.v1_audits_by-id.body

notes
​string | null
auditor_user_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-…
​object

audit.assignment.patch.v1_audits_by-id_lead.body

user_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required

audit.assignment.post.v1_audits.body

template_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
location_hierarchy_node_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
auditor_user_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-…
​
​
due_date
​string | null · date · pattern: ^(?:(?:\d\d[2468][04…
notes
​string | null

audit.assignment.post.v1_audits.response

id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
tenant_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
template_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
template_version
​integer | null · min: -9007199254740991 · max: 9007199254740991 · required
program_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
schedule_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
location_hierarchy_node_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
location_path
​string | null · required
location_name
​string | null · required
auditor_name
​string | null · required
program_name
​string | null · required
template_category
​string | null · required

The originating template's category, resolved server-side from template_id. Null only when the audit has no template or the template has no category — a soft-deleted template still resolves, since the audit retains template_id.

auditor_user_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
name
​string · required
audit_number
​string | null · required
audit_type
​string | null · required
status
​string · enum · required
Enum values:
scheduled
in_progress
submitted
critical_fail
incomplete
score
​number | null · required
max_score
​number | null · required
passed
​boolean | null · required
scheduled_date
​string | null · required
completed_date
​string | null · required
due_date
​string | null · required
notes
​string | null · required
signature_url
​string | null · required
salesforce_id
​string | null · required
​object · required
created_at
​string · required
updated_at
​string · required
is_multi_auditor
​boolean
my_sections_complete
​boolean

audit.assignment.post.v1_audits_by-id_section-assignments_by-section-id_reassign.body

user_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required

audit.assignment.post.v1_audits_by-id_section-assignments_by-section-id_reassign.response

​object[] · required

audit.assignment.post.v1_audits_by-id_section-assignments_complete.body

​object[] · required
​object[]

audit.assignment.post.v1_audits_by-id_section-assignments_complete.response

​object[] · required
audit_status
​string · enum · required
Enum values:
scheduled
in_progress
submitted
critical_fail
incomplete

audit.scheduling.get.v1_audit-program-templates_by-id_impact.response

pending_audits
​integer · min: -9007199254740991 · max: 9007199254740991 · required
in_progress_audits
​integer · min: -9007199254740991 · max: 9007199254740991 · required
has_history
​boolean · required
one_off_pending_audits
​integer · min: -9007199254740991 · max: 9007199254740991 · required
manual_schedules
​integer · min: -9007199254740991 · max: 9007199254740991 · required
manual_pending_audits
​integer · min: -9007199254740991 · max: 9007199254740991 · required

audit.scheduling.get.v1_audit-schedules.response

id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
tenant_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
program_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
program_template_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
template_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
location_hierarchy_node_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
location_hierarchy_node_ids
​string[] · required
​object · required
resolved_user_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
schedule_type
​string · required
​object · required
next_due_date
​string | null · required
last_run_date
​string | null · required
start_date
​string | null · required
end_date
​string | null · required
status
​string · enum · required
Enum values:
active
inactive
source
​string · required
created_by
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
sort_order
​integer · min: -9007199254740991 · max: 9007199254740991 · required
created_at
​string · required
updated_at
​string · required
​object | null

audit.scheduling.patch.v1_audit-schedules_by-id.body

status
​string · enum
Enum values:
active
inactive
​object
​object
​object
next_due_date
​string | null
end_date
​string | null · date · pattern: ^(?:(?:\d\d[2468][04…
sort_order
​integer · min: -9007199254740991 · max: 9007199254740991
schedule_type
​string
location_hierarchy_node_ids
​string[] · minItems: 1
location_hierarchy_node_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-…

audit.scheduling.post.v1_audit-program-templates_by-id_activate.response

id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
tenant_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
program_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
template_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
active_template_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
sort_order
​integer · min: -9007199254740991 · max: 9007199254740991 · required
​object · required
status
​string · required
version
​integer · min: -9007199254740991 · max: 9007199254740991 · required
activated_at
​string | null · required
has_pending_changes
​boolean · required
​object | null · required

audit.scheduling.post.v1_audit-program-templates_by-id_deactivate.response

schedules_deactivated
​integer · min: -9007199254740991 · max: 9007199254740991 · required
audits_removed
​integer · min: -9007199254740991 · max: 9007199254740991 · required
audits_left_in_progress
​integer · min: -9007199254740991 · max: 9007199254740991 · required

audit.scheduling.post.v1_audit-program-templates_by-id_reactivate.response

schedules_reactivated
​integer · min: -9007199254740991 · max: 9007199254740991 · required

audit.scheduling.post.v1_audit-schedules.body

program_template_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
template_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
location_hierarchy_node_ids
​string[] · minItems: 1 · required
program_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-…
location_hierarchy_node_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-…
​object
​object
schedule_type
​string
​object
next_due_date
​string | null
start_date
​string · date · pattern: ^(?:(?:\d\d[2468][04…
end_date
​string | null · date · pattern: ^(?:(?:\d\d[2468][04…

audit.scheduling.post.v1_audit-schedules.response

id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
tenant_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
program_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
program_template_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
template_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
location_hierarchy_node_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
location_hierarchy_node_ids
​string[] · required
​object · required
resolved_user_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
schedule_type
​string · required
​object · required
next_due_date
​string | null · required
last_run_date
​string | null · required
start_date
​string | null · required
end_date
​string | null · required
status
​string · enum · required
Enum values:
active
inactive
source
​string · required
created_by
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
sort_order
​integer · min: -9007199254740991 · max: 9007199254740991 · required
created_at
​string · required
updated_at
​string · required
​object | null

audit.scheduling.post.v1_audit-schedules_by-id_run.response

id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
tenant_id
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
template_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
template_version
​integer | null · min: -9007199254740991 · max: 9007199254740991 · required
program_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
schedule_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
location_hierarchy_node_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
location_path
​string | null · required
location_name
​string | null · required
auditor_name
​string | null · required
program_name
​string | null · required
template_category
​string | null · required

The originating template's category, resolved server-side from template_id. Null only when the audit has no template or the template has no category — a soft-deleted template still resolves, since the audit retains template_id.

auditor_user_id
​string | null · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
name
​string · required
audit_number
​string | null · required
audit_type
​string | null · required
status
​string · enum · required
Enum values:
scheduled
in_progress
submitted
critical_fail
incomplete
score
​number | null · required
max_score
​number | null · required
passed
​boolean | null · required
scheduled_date
​string | null · required
completed_date
​string | null · required
due_date
​string | null · required
notes
​string | null · required
signature_url
​string | null · required
salesforce_id
​string | null · required
​object · required
created_at
​string · required
updated_at
​string · required
is_multi_auditor
​boolean
my_sections_complete
​boolean

audit.scheduling.post.v1_audit-section-library_by-id_cascade.response

updated
​integer · min: 0 · max: 9007199254740991 · required
already_current
​integer · min: 0 · max: 9007199254740991 · required
​object[] · required
needs_attention_count
​integer · min: 0 · max: 9007199254740991 · required
remaining
​integer · min: 0 · max: 9007199254740991 · required
complete
​boolean · required
stalled
​boolean · required

audit.scheduling.post.v1_audit-section-library_by-id_publish.response

​object · required

integration.get.v1_integration_check.response

tenant_id
​string · required
tenant_name
​string · required
user_id
​string · required
user_name
​string · required
key_name
​string · required
scopes
​string[] · required
expires_at
​string · required