Authorization header. This page says
which key to use, what each one reaches, and how to keep it safe. Read it before you store your
first key.
Bearer, and then the key, here a sandbox Venue key. A missing,
malformed, expired or revoked key is refused with 401, and so is a key on a route outside its own,
such as a Trading API key on /api/pre-registration/. A Venue key that doesn’t carry the scope a
route needs is refused with 403, before anything is read.
Choose your key
There are four keys, and each reaches its own set of routes.- Use a Venue key when your server runs a venue: its configuration, the accounts it issues, its usage and its webhooks, and routing its own traders’ orders.
- Use a Connect API key when your server runs a Connect app, your own trading interface: it creates Connect links, and reads your traders’ accounts and routes their orders.
- Use a Trading API key for programmatic trading on the accounts of the person who owns the key: market data, orders and account state.
- Use a pre-registration key only to pre-register traders for Connect in the trdrs trading app.
Use a Venue key
A Venue key (trdrs_vk_…) reaches the routes under /api/venues/{venueId}/… for one venue
in one environment. With trader:read or trader:trade, it also reaches the account, market and
trading routes on your own traders’ accounts, to read them and route their orders, and each request
names the trader in x-trdrs-trader. Route your traders’ orders
shows how. A key made in the back office carries every one of these scopes, and each route names
the scope it needs:
Venue keys lists the routes behind each scope.
You create and revoke Venue keys on the API keys page of your installed back office, as an owner
of the venue it operates. You give each key a name and a lifetime, and it stops
working when that time ends, so create its replacement before then. It also stops working when
it’s revoked, or when the owner who created it stops being an owner. A sandbox key starts
trdrs_vk_sandbox_ and a production key
trdrs_vk_production_, and neither works in the other environment. No key can create another key.
The hosted back office calls the same venue operations with a signed-in session, at
/api/back-office/venues/{venueId}/…. Those session routes are in the OpenAPI document but not in
this reference, because a key can’t call them. Your backend uses the Venue key routes.
Use a Connect API key
A Connect app’s backend holds the app’s Connect API key (trdrs_ck_…), which the Connect dashboard
calls an API key. It creates, reads and closes Connect links for your traders under
/api/connect/links. Naming a trader in x-trdrs-trader, it reads that trader’s accounts and
market data and routes their orders on the account, market and trading routes. It reaches your own
traders, and your team runs your tiles, white-label paper, team and bill in the Connect dashboard.
A key has a name and an expiry, and carries exactly what your trading interface needs. An owner of
your app creates and revokes keys in the Connect dashboard’s API keys, chooses each key’s
lifetime from 60 seconds to 365 days, and sees its token once. A sandbox key starts
trdrs_ck_sandbox_ and a production key trdrs_ck_production_, and neither works in the other
environment. An owner creates production keys after your app’s Connect pass opens its production,
while the pass’s certificate stands. Open production
shows how.
A key stops working when it expires or is revoked, or when the owner who created it stops being an
owner. Keep it on your server: a request that carries it with a cookie or a browser’s Origin is
refused as credential_not_allowed. The Connect quickstart creates
one, and Route your traders’ orders shows each request.
Use a Trading API key
A Trading API key (trdrs_sk_…) reaches /api/market/, /api/instruments, /api/news,
/api/calendar, /api/trading/ and /api/account/, for the accounts its owner holds.
It’s a credential for a server, not a login.
Everything else a signed-in trader can do, such as journals, alerts, scripts and preferences, stays
behind the session, and a Trading API key can’t reach it. The route families above are a fixed
list, and every other route refuses a key, so a leaked key exposes only what that list allows.
In the OpenAPI document this key’s security scheme is named tradingApiKey.
Use a pre-registration key
A pre-registration key looks exactly like a Trading API key (trdrs_sk_…) but reaches only
/api/pre-registration/ outside the venue routes: Connect pre-registration and a venue’s conformance
runs. Everything a venue does with its accounts goes through the venue routes, with a Venue key, and a
Connect app runs its conformance from the Connect dashboard.
A pre-registration key can’t trade, read a trader’s account or fetch market data, and a Trading API
key is refused on /api/pre-registration/. Nothing in the key string tells you which of the two you
hold, so store them under different names.
Keep sessions for people
A person signed in to the trading app or the back office carries a session cookie. It runs their own trading, their key management and the back office. Your integration uses a key, never a browser’s session.Read market data from a browser
A chart in your web app can read market data straight from trdrs, without your server passing every request along. Market data routes admit browser requests from origins you register with us. Two rules keep this safe:- Only market data routes admit a registered origin. Trading and account routes always need a key, sent from your server.
- If a request carries an
Originheader, that origin must be registered, even when a valid key is attached. A key excuses a missingOrigin, never an unregistered one.
Get your keys
Sandbox keys are free and self-service. Create Venue keys on the API keys page of your installed back office, pre-registration keys on the hosted API keys page, and Trading API keys in sandbox API access. Create a Connect API key in your app’s Connect dashboard. Choose your quickstart takes you to the walkthrough for your key. Sandbox Trading API and pre-registration keys starttrdrs_sk_sandbox_ and expire after 30 days.
You can hold three of them at a time and create five in an hour. A pre-registration key acts for a
venue you own. When you own none, the key starts an unlisted draft company, and the first venue you
create takes it over.
In production, a verified owner creates Venue keys on the API keys page of a back office installed
with TRDRS_ENVIRONMENT=production and connected to the production venue.
Production Trading API and pre-registration keys come with your commercial agreement, one per scope
per environment, and trdrs issues them. Profile API access lists and revokes Trading API keys, and the hosted
API keys page lists and revokes pre-registration keys.
Keep keys safe
A key is shown once, when you create it. For Trading API and pre-registration keys we store only a SHA-256 hash, so nothing in our database can be turned back into a working key. A Venue key and a Connect API key are stored as a hash too, and also kept encrypted, so that retrying a creation with the sameIdempotency-Key returns the same key.
- Put a new key straight into your secret manager.
- Don’t commit it, log it, or send it to a browser or a mobile app. If a key ever reaches one, treat it as public and revoke it.
- Give each environment its own key, so you can revoke one without touching the other.
- If a key may have leaked, revoke it where you created it and create a new one. The old key stops working on its next request.