Plenty of small brokerages have one person who is “the computer person”: an owner’s nephew, an ops lead who writes spreadsheet macros, or a part-time developer. If that is you, a TMS API key lets you stop retyping the same loads. A script, a Zapier flow or an n8n workflow can create loads and quotes in your TMS directly.
This guide covers how API keys work in Techvia TMS, which scope does what, and a few working examples. It is written for someone comfortable with curl and JSON, but a broker can follow the logic.
What a TMS API key is
An API key is a long secret string that lets software, not a person, sign in to your TMS and do a limited set of things. Techvia TMS uses it as a Bearer token:
Authorization: Bearer tms_...
Facts worth knowing before you start:
- API access comes with the Pro AI plan ($99 per month per workspace, 30-day trial). On other plans it can be switched on per workspace; ask your account contact.
- A workspace admin makes the key in Settings, API keys. You name it, tick its scopes, and optionally set an expiry date.
- The full key is shown once. It starts with
tms_. Techvia stores only a hash and cannot show it again. Put it in a secret manager or an environment variable, never in a spreadsheet or a Git repo. - A key belongs to one workspace and sees only that workspace’s data.
- Revoke any time. Revoking takes effect on the next request.
If the person who made a key stops being an admin, the key stops working. That is deliberate.
Scopes: give each key only what it needs
A scope is a permission box you tick when you make the key.
| Scope | What it allows |
|---|---|
loads.read | List loads, read one load, list a load’s documents and open them |
loads.write | Create and change a load: status, notes, stop times, carrier assignment |
billing.read | Adds the customer rate, final rate and other charges to load responses |
directory.read | Read customers, carriers, drivers, trucks, trailers, dispatchers, facilities |
directory.write | Create and update customers, carriers and facilities |
loads.rates | Set the customer rate and other charges on a load, every quote call, and rate documents (RateCon, CarrierInvoice) |
Two points about loads.rates. Every quote call needs it, because a quote is money. And it never reaches invoices, settlements or payments; no scope does.
A sensible set of keys for a small brokerage:
- Load-board import script:
loads.write,directory.read. It cannot see rates. - Reporting dashboard:
loads.read,billing.read. It cannot change anything. - Quote helper:
loads.read,directory.read,loads.rates.
Make one key per tool. When one misbehaves you revoke that key and the others carry on.
The same functions as MCP tools
The REST API and the MCP connector are twins. Each AI tool has a REST endpoint with the same name, scope and rules, and one key works on both. If you want to talk to your TMS in chat instead of scripting it, start with what MCP means for a TMS. For a worked example of the chat route, see pricing a lane with Claude.
| REST call | MCP tool | Scope |
|---|---|---|
GET /loads | search_loads | loads.read |
POST /loads | create_load | loads.write |
PATCH /loads/{id}/status | update_load_status | loads.write |
GET /quotes | list_quotes | loads.rates |
POST /quotes | create_quote | loads.rates |
PATCH /quotes/{id}/status | set_quote_status | loads.rates |
POST /quotes/{id}/convert | convert_quote_to_load | loads.rates |
All paths sit under https://tms-api.techvia.software/api/public/v1. The developer reference lists every endpoint, tool and scope, and there is an OpenAPI 3 file you can import into Postman or a code generator.
Example 1: check the key
Always start here. GET /me returns your workspace, key name, scopes, expiry, and quota used. It does not use quota.
curl -H "Authorization: Bearer $TMS_KEY" \
https://tms-api.techvia.software/api/public/v1/me
If you get a 401, the key is wrong, revoked, expired, or API access is off. The body is the same for every reason.
Example 2: create a quote
This needs loads.rates. Replace the customer id with one from GET /customers.
curl -X POST -H "Authorization: Bearer $TMS_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"customerId":"<customer-uuid>","originCity":"Dallas","originState":"TX","destCity":"Atlanta","destState":"GA","quotedRate":2200.00}' \
https://tms-api.techvia.software/api/public/v1/quotes
You get a 201 and the new Draft quote, including its rowVersion. The quote response also carries suggestedRate, the TMS’s own suggestion from your lane history. It is read-only: you cannot send it.
A blacklisted or inactive customer, an inactive dispatcher, or an inactive facility is refused with a 422.
Example 3: mark it Won, then convert it to a load
Changing a status needs the rowVersion from your last read of the quote. If someone else changed the quote since, you get a 409 and read it again. That stops two people overwriting each other.
curl -X PATCH -H "Authorization: Bearer $TMS_KEY" \
-H "Content-Type: application/json" \
-d '{"status":"Won","rowVersion":2}' \
https://tms-api.techvia.software/api/public/v1/quotes/$ID/status
curl -X POST -H "Authorization: Bearer $TMS_KEY" \
https://tms-api.techvia.software/api/public/v1/quotes/$ID/convert
Conversion has conditions. The quote must be Won, have a pickup or delivery date, and both ends of the lane must be facilities in your workspace (originFacilityId, destFacilityId). A lane of only city and state is not converted by a key; a person does that in the app. Converting twice gives one load: 201 the first time, then 200 with AlreadyConverted. The returned load never includes the rate. For the by-hand version of this flow, see how to quote a lane and turn a won quote into a load.
Retry safely with idempotency keys
Networks drop. If your script times out after sending a create, it cannot know whether the load exists. Send an Idempotency-Key header (any unique text up to 255 characters) on creates. Send the same key and the same request again and you get the first answer back, with no second record. Reuse a key for a different request and you get a 422.
Use a fresh UUID per logical job and store it with the job. The MCP tools use a client_request_id argument for the same purpose.
Limits you will hit
- 60 requests per minute per key.
- 120 requests per minute per workspace, all keys together. More keys do not raise this.
- Monthly quota: 100,000 requests on Pro AI, shared across all keys, resetting on the 1st (UTC).
Over a limit you get a 429 with a Retry-After header. Wait that many seconds.
What a key can never do
A key cannot delete records, cannot make payments, invoices or settlements, and cannot set a load to Cancelled, TONU, Completed or Invoiced. Invoiced loads keep their customer, rate, charges, references and stops. Carrier cost and margin are never returned, and changes made through a key show in the load’s history as “API key: name”, so you can see what your script did. More in what an AI assistant can see and change in your TMS.
Good first projects
- Create loads from a customer’s emailed or spreadsheet orders, with the work-order number as a duplicate check.
- Pull this week’s loads into a sheet or Power BI.
- Post a daily “uncovered loads” list to a team chat.
- Add check-call notes from a phone or messaging flow.
FAQ
Do I need Pro AI to use the API?
API access comes with Pro AI ($99 per month per workspace, 30-day trial). On other plans it can be switched on per workspace by asking.
Can I use Zapier, n8n or Power BI?
Yes. Anything that can send an HTTPS request with an Authorization header can use the REST API. n8n also has an MCP Client Tool node for the MCP side. Claude, or any MCP/API tool, works.
What happens if my key leaks?
Revoke it in Settings, API keys. It stops on the next request. Make a new one with the same scopes. Keep keys out of Git and shared sheets.
Why did my create return 409?
A duplicate (for example the same work-order number for that customer) or a stale rowVersion. The response says which. For duplicates, canOverride tells you whether you may send it again with allowDuplicate: true and a new idempotency key.
Can a key see what I pay carriers?
No. Carrier cost, carrier charges and margin are never returned to a key.
Ready to try it? Start from the Pro AI page and keep the developer reference open.