QATS HELP CENTER · API & AUTOMATION

Create and protect an API key

Permissions, expiry, and safe key replacement.

Open Trading API All guides
Before you start

Select the intended account and permissions. Keys last 30 days; the secret is displayed once and must stay in your integration’s secret store.

ON THIS SCREENFind the highlighted controls Click to enlarge
What to look for

Select a numbered step to zoom straight to that control.

Illustrative QATS screen from a test account. Your keys and accounts will differ.
01 / 04

Choose the environment and account

  1. Open Profile & settings → External connections → Bots and API → Trading API. For virtual testing, open Sandbox account → Keys & connections → Trading API and use Create sandbox key. Purchased-account keys have a separate Create API key button under Your keys.

  2. On Configure, confirm the Trading account ID and enter a recognisable Key name, such as the name of one bot.

  3. One key belongs to one account. Switching the selected account in the dashboard does not move an existing key to that account.

ON THIS SCREENFind the highlighted controls Click to enlarge
What to look for

Select a numbered step to zoom straight to that control.

Unsubmitted local QA dialog for a virtual account. No API credential was issued or exposed.
02 / 04

Set permissions and allowed addresses

  1. Choose Read only for monitoring market data, account state, orders, positions, and fills. Choose Read and trade only when the integration must place, amend, cancel, or close trades.

  2. Allowed addresses is optional. Enter up to five plain IPv4 or IPv6 addresses separated by commas, using the public outbound address of the server that will call QATS. Do not enter a hostname or CIDR range.

  3. An empty address field allows requests from any address with the key. A restricted key is refused from other addresses; your browser address may differ from your bot server’s address.

  4. Choose Continue. Bybit native accounts offer read-only QATS keys; their trading happens on Bybit.

ON THIS SCREENFind the highlighted controls Click to enlarge
What to look for

Select a numbered step to zoom straight to that control.

Unsubmitted local QA configuration with Read only selected. The example does not authorise trading.
03 / 04

Confirm and save the secret once

  1. On Confirm, check Name, Trading account, Permissions, Allowed addresses, and Valid for. Regular API keys last 30 days; the TradingView webhook expiry is a separate setting.

  2. Choose Create API key only when the settings are correct. On Save key, copy the API key into your server’s secret store and keep the matching Base URL.

  3. Tick I have saved the key in a secure place, then choose Done. After leaving this screen the secret cannot be retrieved. Never include it in browser code, a repository, a URL, screenshots, or support messages.

  4. Send the key as an Authorization: Bearer header over HTTPS. Check an account-read response before sending any write, and retain a unique Idempotency-Key for each intended command.

ON THIS SCREENFind the highlighted controls Click to enlarge
What to look for

Select a numbered step to zoom straight to that control.

Unsubmitted confirmation for a fictional read-only monitor on a virtual QA account. The final creation button was not pressed.
04 / 04

Replace, revoke, or respond to exposure

  1. For planned rotation, create a replacement for the same environment and account, update your server secret, and test a read before resuming commands.

  2. If a previous command has an uncertain outcome, recover it through its original connection before revoking that connection or retrying through a new key. A replacement connection does not recover the original command.

  3. Under Your keys, choose Revoke for the old purchased-account key, check the confirmation, and choose Revoke key. Sandbox keys have Revoke sandbox key under API sandbox. An expired key requires replacement.

  4. Revocation blocks subsequent requests and closes the key’s market streams. It does not cancel working orders or close positions. Manage exposure in the terminal separately.

  5. If the secret was exposed, stop the integration and revoke the affected key promptly. Review orders and positions, then create a replacement and contact support with IDs and redacted errors.

WHEN YOU NEED A HAND

Common questions

I lost the secret. Can QATS show it again?

Create a replacement key, update and test your integration, then revoke the old connection. The original secret cannot be retrieved.

Does revoking a key close positions?

No. Revocation blocks subsequent requests and closes its market streams. Review and cancel working orders or close exposure in the terminal if that is what you need.

My IP-restricted key works in the browser but not on my bot server.

The allowed address must match the public outbound address of the calling server. Your browser and server can use different addresses. Create a replacement with the correct restriction; never send the secret to support.

Can a replacement key recover a command sent with the old key?

Recover an uncertain command through its original connection before planned rotation. Do not resend through a replacement key as though it were the same command. If the old key is no longer usable, reconcile current orders, fills and positions before another write.

CHECK YOUR RESULT

You’re done when…

Your key has the intended account and permissions, and its secret is stored privately outside source code.

If this does not match what you see, use Common questions above or contact support with the page and account details.
NEXT STEP

Continue in QATS

Open the relevant screen to follow the steps in this guide.

Open Trading API
KEEP EXPLORING

Related guides

All topics
API & automationSend your first API orderSelect an environment, check instrument limits, and verify execution.API & automationRecover after an API timeoutResolve an uncertain command without accidentally duplicating an order.API & automationCreate a free API sandboxTest an integration on a separate account with virtual funds.
Still need help?

Tell us where you got stuck. Never share passwords or access keys.