# List trucks

> GET /api/public/v1/trucks, scope directory.read. Techvia TMS public API v1 reference.

Source: https://techvia.software/docs/tms/reference/trucks/list-trucks/

`GET /api/public/v1/trucks`

**Scope:** `directory.read`. **MCP tool:** `list_trucks`. Rules and edge cases: [Trucks guide](/docs/tms/guides/directory/).

## Parameters

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `search` | query | string | no |  |
| `page` | query | integer | no | Default `1` |
| `pageSize` | query | integer | no | Default `50` |

## Responses

| Status | Meaning | Body |
|---|---|---|
| `200` | OK | `PagedResultOfPublicTruck` |
| `422` | Unprocessable Entity | `ProblemDetails` |

### `200` body

| Field | Type | Notes |
|---|---|---|
| `items` | PublicTruck[] |  |
| `items[].id` | string (uuid) |  |
| `items[].unitNumber` | string |  |
| `items[].type` | string |  |
| `items[].status` | enum AssetStatus | One of `Active`, `Inactive`, `InMaintenance`, `OutOfService` |
| `items[].currentDriverName` | string |  |
| `page` | integer |  |
| `pageSize` | integer |  |
| `total` | integer |  |
| `hasMore` | boolean |  |
| `sort` | SortSpec[] |  |
| `sort[].field` | string |  |
| `sort[].dir` | string |  |

Errors are RFC 7807 problem details; see [Errors](/docs/tms/concepts/errors/).

**Example request**

**curl**

```bash
curl "https://tms-api.techvia.software/api/public/v1/trucks" \
  -H "Authorization: Bearer $TMS_KEY"
```

**JavaScript**

```js
const res = await fetch(`https://tms-api.techvia.software/api/public/v1/trucks`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.TMS_KEY}`,
  },
});
if (!res.ok) throw new Error(await res.text());
console.log(await res.json());
```

**Python**

```python

res = requests.request(
    "GET",
    f"https://tms-api.techvia.software/api/public/v1/trucks",
    headers={"Authorization": f"Bearer {os.environ['TMS_KEY']}"},
)
res.raise_for_status()
print(res.json())
```

**Example response** `200`

```json
{
  "items": [
    {
      "id": "01a20943-7a10-7c11-8a2e-000000000020",
      "unitNumber": "T-101",
      "type": "SleeperCab",
      "status": "Active",
      "currentDriverName": "Sam Lee"
    }
  ],
  "page": 1,
  "pageSize": 50,
  "total": 1,
  "hasMore": false,
  "sort": []
}
```

<p class="ep-caption">Illustrative values.</p>
