Skip to main content
Create a Venue key so your own backend can run your venue: issue accounts, set rules, move money, read results and route your own traders’ orders. A Venue key belongs to one venue in one environment and carries every Venue scope, and each call names the scope it needs. Use this page when you set up a backend or the back office for the first time, or when you want to know what a key can call. By the end you have a key stored on your server and know which calls it can make.

Create a key

Open API keys in your installed back office. Name the key and choose its lifetime. The key stops working when its lifetime ends, so create its replacement before then. The key is shown once, so store it on your server straight away. trdrs keeps it encrypted and hashed, never in plain text. Revoke removes a key. A key made there carries every Venue scope, for the venue that back office operates. A production venue’s keys are made in a back office installed with TRDRS_ENVIRONMENT=production and connected to it. A sandbox key starts trdrs_vk_sandbox_ and a production key starts trdrs_vk_production_. Neither works in the other environment. Creating and revoking keys happens only in the signed-in back office. No key can create another key.
A key keeps working only while the person who created it is an owner of your organization. If they leave or become an editor, every call with their keys is refused. Create keys from an owner account that stays with your organization.

See what each scope opens

Each call names the scope it needs. A call with a key that doesn’t carry that scope is refused with 403 permission_denied before anything is read or written. Every call rechecks the key’s venue, environment, scopes, expiry and revocation, and whether its creator is still an owner, at the moment it runs.

Keep the key on your server

A Venue key configures your venue, so anyone who holds it can change your rules or move your money. Keep it in your server’s environment or secret store. Don’t put it in browser code, a mobile app or a public repository. Building your own trading interface rather than running a venue? A Connect app calls the Connect API with an API key of its own, which the Connect quickstart creates.

Use the signed-in session in the hosted back office

The same venue calls exist under two prefixes. Your backend calls /api/venues/{venueId}/... with the key. The hosted back office calls /api/back-office/venues/{venueId}/... with the signed-in person’s session instead. Both run the same checks and give the same answers; only the credential differs. A write from a browser without a trusted Origin is refused with 403 origin_not_allowed. A session request that carries a Venue key in an Authorization header is refused with 401 session_required, so a key never stands in for a session.

Make the calls that need a person

Some calls come before a venue exists or are about people rather than the venue, so a key can’t make them. They take your signed-in trdrs session: The installed Back Office makes these calls with your individual verified email session. It keeps the upstream session cookies in server memory and checks your current permissions on each call. Back Office describes installation and sign-in. A key that has lost a scope isn’t fixed by signing in, and a signed-in person who isn’t an owner isn’t fixed by creating a key.

Pick the right key

Most venues need only a Venue key. Keep a pre-registration key as well only if you pre-register traders.

Test it end to end

  1. Create a sandbox key on the back office’s API keys page.
  2. Read your venue with it. You get 200.
  3. Revoke the key on the same page and read the venue again. You get 401 venue_key_required.

Next steps

Run a venue

Use the key to set up instruments, pricing, groups and stages.

Back-office tool

Install the back office on your own server with its own key.