# Getting Started

The ThinkLP APIs let you create, retrieve, and update theft cases and the
people, vehicles, and items involved in them. They run on the Salesforce
platform. They are organized into five domains:

| Domain          | Base path      | Use it to                                        |
| --------------- | -------------- | ------------------------------------------------ |
| **Theft Cases** | `/theft-cases` | Manage cases and the records involved in them.   |
| **Vehicles**    | `/vehicles`    | Manage canonical vehicles. Find one by plate.    |
| **Persons**     | `/persons`     | Manage canonical people. Search the directory.   |
| **Items**       | `/items`       | Manage canonical items. Find one by SKU.         |
| **Locations**   | `/locations`   | Load and update locations by id. No create path. |

A sixth surface, **Insights** (`/insights`), creates cases from ThinkLP Frontier
point-of-sale transactions. It ships in a separate package, so your org may not
have it. See the [API reference](../overview.md) for its endpoints.

## Base URL

All endpoints live under a single versioned base URL. Replace the host with your
org's My Domain:

```
https://{instance}.my.salesforce.com/services/apexrest/ThinkSDK/thinklp/api/v1
```

## Make your first call

**1. Get an access token** (see [Authentication](./authentication.md) for
details):

```bash
curl -X POST 'https://acme.my.salesforce.com/services/oauth2/token' \
  -d 'grant_type=client_credentials' \
  -d 'client_id=YOUR_CLIENT_ID' \
  -d 'client_secret=YOUR_CLIENT_SECRET'
```

**2. Retrieve a theft case** by its Salesforce record ID:

```bash
curl 'https://acme.my.salesforce.com/services/apexrest/ThinkSDK/thinklp/api/v1/theft-cases?id=a0nXXXXXXXXXXXXXXX' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```

The response is an **envelope**: `detail` carries the record, and `fieldSpecs`
carries per-field metadata you can use to render and validate a form:

```json
{
	"detail": {
		"id": "a0nXXXXXXXXXXXXXXX",
		"narrative": "...",
		"investigationType": "External Theft"
	},
	"fieldSpecs": [
		{
			"name": "investigationType",
			"label": "Investigation Type",
			"type": "picklist",
			"required": true,
			"readOnly": false,
			"section": "Details",
			"options": [
				{ "label": "External Theft", "value": "External Theft" },
				{ "label": "Internal Theft", "value": "Internal Theft" }
			]
		}
	]
}
```

Every domain returns this same `{ detail, fieldSpecs }` shape on retrieve,
create, and update. See [Field metadata](./field-metadata.md) for the full
`fieldSpecs` contract.

## Next steps

- [Authentication](./authentication.md) — tokens and authorization in detail.
- [Conventions](./conventions.md) — response shapes, IDs, search, pagination,
  and dates.
- [Field metadata](./field-metadata.md) — render and validate forms from
  `fieldSpecs`.
- [Errors](./errors.md) — the error envelope and what each code means.
- Explore each domain's reference for the full list of operations.
