# Guide for fleets and partners

You are a fleet, a telematics or maintenance provider, or a technology partner that works with a company's equipment and people. In every call below, `{partnercode}` is the **fleet's** code.

```bash
export CC=https://carriercloud.ai
export KEY="Authorization: Bearer YOUR_API_KEY"
export P=MIST
```

## 1. Inventory the fleet

```bash
curl "$CC/v1/partner/$P/tractors?page=1" -H "$KEY"
curl "$CC/v1/partner/$P/drivers?page=1"  -H "$KEY"
curl "$CC/v1/partner/$P/carriers?page=1" -H "$KEY"
```

These lists come from the platform's search index: PascalCase summaries, 100 per page, `404 No tractors found.` when a page is empty. Keep the identifiers:

- Tractor `DataGUID` → `id` and `tractorguid`
- Driver `ID` → `driverid`
- Carrier `ID` → `carrierid`

Single-item reads return the richer camelCase actors with maintenance and notes:

```bash
curl "$CC/v1/partner/$P/tractors/$TRACTORGUID" -H "$KEY"
curl "$CC/v1/partner/$P/tractors/byNumber/1412" -H "$KEY"
curl "$CC/v1/partner/$P/trailers/byNumber/5531" -H "$KEY"
curl "$CC/v1/partner/$P/carriers/$CARRIERID" -H "$KEY"
```

Fields the platform has no value for are omitted rather than returned as null.

## 2. Maintain equipment

Create and update tractors and trailers with the platform's PascalCase field names. Statuses and types must be codes from the partner's option lists:

```bash
curl "$CC/v1/partner/$P/options/tractorstatuses" -H "$KEY"

curl -X POST "$CC/v1/partner/$P/tractors" -H "$KEY" \
  -H "Content-Type: application/json" \
  -d '{ "TractorNumber": "1413", "TractorStatus": "Available", "Make": "Freightliner", "Model": "Cascadia", "Year": 2024,
        "LicensePlateNumber": "PWX8813", "LicenseState": "OH", "SerialNumber": "1FUJGLDR5CSBH1235" }'

curl -X PUT "$CC/v1/partner/$P/trailers/$TRAILERID" -H "$KEY" \
  -H "Content-Type: application/json" \
  -d '{ "TrailerStatus": "loaded" }'
```

- `201` returns the created record; `200` the updated one.
- `207 { "errorMessages": [...], "card": {...} }` means the record was saved but some submitted fields were skipped because of your role.
- `422 Invalid TractorStatus` (plain text) means the code is not in the partner's list.
- `DELETE .../tractors/{id}` and `DELETE .../trailers/{id}` answer `204`.

## 3. Hours of service

```bash
curl "$CC/v1/partner/$P/drivers/hos/2026-10-01" -H "$KEY"
```

Returns the duty-status records for the fleet's drivers on that calendar date. The operation is [gated](/docs/environments#gated-operations) at the moment; ask for it when you request a key if your integration depends on it.

## 4. Telematics history

Positions for a tractor since a point in time, newest first, 100 per call:

```bash
curl "$CC/v1/partner/$P/tractors/$TRACTORGUID/positions?startdate=2026-10-01T00:00:00Z" -H "$KEY"
```

```json
{
  "positions": [
    { "EquipmentType": 3, "EquipmentId": "1412", "PosDateTime": "2026-10-01T13:42:10.000Z",
      "Latitude": "40.99600", "Longitude": "-83.65000", "Speed": 62, "SpeedUnit": "mph",
      "PosDescription": "3.2mi S of Findlay, OH" }
  ],
  "moreAvailable": false
}
```

When `moreAvailable` is true, move `startdate` forward to the newest `PosDateTime` you have and call again.

Daily performance summaries from the connected ELD (idle time, over-speed events, fuel, hard braking) come from:

```bash
curl "$CC/v1/partner/$P/tractors/$TRACTORGUID/Event" -H "$KEY"
```

Each element is a `PerformanceEvent` with about 65 numeric fields; the reference documents them. Fields the provider does not report are null.

## 5. Push instead of pull

Register webhooks for `gps` and `truckperformance` on the `truck` object type, and `hos` on `driver`, to receive events as they happen. See [Webhooks](/docs/webhooks/overview).

## 6. Geocoding utilities

Three helpers that need only your key, no partner code:

```bash
curl "$CC/v1/utility/geocode/search?text=28000%20Oregon%20Rd%20Perrysburg%20OH" -H "$KEY"
curl "$CC/v1/utility/geocode/reverse?point.lat=41.5335&point.lon=-83.6236" -H "$KEY"
curl "$CC/v1/utility/geocode/structured?address=28000%20Oregon%20Rd&locality=Perrysburg&region=OH&postalcode=43551&country=USA" -H "$KEY"
```

Each returns a single `ZoneActor` (`Description`, `Address1`, `City`, `State`, `ZipCode`, `Country`, `Latitude`, `Longitude`). A `500` means no match scored above the confidence threshold; make the query more specific.

## Errors you will see

| Response | Meaning |
|---|---|
| `404 No tractors found.` | Empty page or no match; stop paging. |
| `422 Invalid TractorStatus` | Use a code from the partner's status list. |
| `207` with `errorMessages` | Saved without the listed fields. |

See the [error catalog](/docs/concepts/errors).
