# Quickstart

> Make a Techvia TMS API key and read your first loads in five minutes with curl, JavaScript or Python.

Source: https://techvia.software/docs/tms/quickstart/

You need a Techvia TMS workspace with API access (see the [overview](/docs/tms/)) and admin rights in it.

## 1. Make a key

1. Open **Settings > API keys** in the TMS app and name the key.
2. Tick the scopes: `loads.read` and `directory.read` are enough for this page. See [scopes](/docs/tms/concepts/authentication/) for the rest.
3. Optionally set an expiry date, then copy the key. It starts with `tms_` and is shown **once**. Store it in your secret manager; Techvia keeps only a hash and cannot show it again.

Put it in an environment variable. Never put a key in a URL or query string, and never commit it.

```bash
export TMS_KEY=tms_YOUR_KEY
```

## 2. Check your key

`GET /api/public/v1/me` answers for any valid key, with no scope needed.

**curl**

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

**JavaScript**

```js
const res = await fetch('https://tms-api.techvia.software/api/public/v1/me', {
  headers: { Authorization: `Bearer ${process.env.TMS_KEY}` },
});
console.log(await res.json());
```

**Python**

```python

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

```json
{
  "tenantName": "Acme Logistics", "keyName": "Zapier", "scopes": ["loads.read", "loads.write", "billing.read"], "expiresAt": null,
  "quota": { "meter": "api.requests", "used": 1204, "limit": 10000, "remaining": 8796, "resetsAt": "2026-12-01T00:00:00+00:00" },
  "rateLimits": [
    { "scope": "key", "limit": 60, "windowSeconds": 60 },
    { "scope": "workspace", "limit": 120, "windowSeconds": 60 },
    { "scope": "ip", "limit": 3000, "windowSeconds": 60 }
  ]
}
```

`quota` is your workspace's monthly request quota. `rateLimits` are the limits your requests meet ([rate limits](/docs/tms/concepts/rate-limits/)). `/me`
uses no quota, so it still answers when the quota is used up; it does count against the rate limits.

A `401` means the key is missing, malformed, unknown, revoked or expired. See [Errors](/docs/tms/concepts/errors/).

## 3. Read your first loads

`GET /api/public/v1/loads` needs `loads.read` and returns the newest loads first.

**curl**

```bash
curl -H "Authorization: Bearer $TMS_KEY" \
  "https://tms-api.techvia.software/api/public/v1/loads?pageSize=2"
```

**JavaScript**

```js
const res = await fetch('https://tms-api.techvia.software/api/public/v1/loads?pageSize=2', {
  headers: { Authorization: `Bearer ${process.env.TMS_KEY}` },
});
const { items, hasMore } = await res.json();
console.log(items.map((l) => `${l.loadNumber} ${l.status}`), hasMore);
```

**Python**

```python

res = requests.get(
    "https://tms-api.techvia.software/api/public/v1/loads",
    params={"pageSize": 2},
    headers={"Authorization": f"Bearer {os.environ['TMS_KEY']}"},
)
body = res.json()
print([f"{l['loadNumber']} {l['status']}" for l in body["items"]], body["hasMore"])
```

The answer is `{ "items": [...], "page", "pageSize", "total", "hasMore", "sort" }`. A new workspace starts with one sample load (number `SAMPLE-1`, `isSample: true`). All filters and the full response are in the [Loads guide](/docs/tms/guides/loads/).

## Next steps

- Create a load: [Loads guide](/docs/tms/guides/loads/) and always send an [`Idempotency-Key`](/docs/tms/concepts/idempotency/).
- Pick a job: [use cases](/docs/tms/use-cases/).
- Let an AI do it: [Use with your AI](/docs/tms/ai/).
- Stay inside the [rate limits](/docs/tms/concepts/rate-limits/): 60 requests a minute per key.
