API Key permissions (roles)¶
Terminology
- UI Type — the capabilities you select when creating a key (Read only, Spot trade, Wallet).
- Docs Required Type — the capability an endpoint needs. OpenAPI operations state this on each operation.
A key may carry multiple roles (comma-separated integers). When role auth is enabled:
- A key that is only Read only (
0) may call any signed read endpoint (it is not limited to a single domain). - A key with Spot trade / Wallet must include the matching role for that domain. Write endpoints reject pure Read only keys.
- Common endpoints have no domain
*Onlyflag: Read only, Spot trade, and Wallet keys may all call them.
| Role | Value | UI label | Typical use |
|---|---|---|---|
| READ_ONLY | 0 | Read only | Read-only access to signed query endpoints across trading, common, and wallet (not write ops). Public / market-data APIs need no key. |
| TRADE | 2 | Spot trade | Place / cancel orders; also query orders/trades; listenKey |
| CRYPTO_WALLET | 4 | Wallet | Withdraw; also deposit address / history / config |
Missing required role → UNSUPPORTED_OPERATION (-1020). Check the key's Type in API management. Each REST operation also states Required Type in its OpenAPI description (for example Spot trade (Read only OK for GET)).
Creating keys¶
API keys are created in the web app (not via a public REST endpoint):
- Enable Authenticator app (2FA) under Security — required before you can create keys.
- Open Security → API management → Manage (under account security settings).
- Click Create API key.
You can create up to 10 keys per account (after identity verification).
Name¶
A label you choose for your own reference.
Type¶
| Option | Maps to role | Notes |
|---|---|---|
| Read only | 0 |
Mutually exclusive with Spot trade / Wallet |
| Spot trade | 2 |
Can combine with Wallet |
| Wallet | 4 |
Can combine with Spot trade |
Selecting Read only disables Spot trade / Wallet. Selecting Spot trade or Wallet disables Read only. Spot trade and Wallet may be multi-selected together.
IP address restrictions¶
Configured in the same Create API key dialog:
| Key type | Allowed options |
|---|---|
| Read only | Unrestricted (not recommended) or Bind IP whitelist |
| Spot trade / Wallet | Bind IP whitelist only |
When binding a whitelist:
- Enter a single IPv4 address, a CIDR range (e.g.
203.0.113.0/24), or allow-all via a whitelist that is exactly0.0.0.0. - In the Create API key dialog, separate multiple entries with
;. The gateway stores and matches entries as a comma-separated list (the web app converts;to,on submit). 0.0.0.0/0is an IPv4 CIDR that allows all IPv4 sources only; it does not match IPv6 clients and is not equivalent to a whitelist of exactly0.0.0.0.
Production keys must not use allow-all
A whitelist of exactly 0.0.0.0 disables IP binding for every source. Use only for local or tightly controlled testing.
Existing keys show the bound addresses in the IP address column of the API management table.
IP whitelist¶
The gateway matches the key whitelist against the client IP obtained from infrastructure (edge / load balancer injection on the request path). Until that IP matches the key's whitelist (or the key is Unrestricted, which is only available for Read only), all signed endpoints and key-only endpoints (including userDataStream) return -2017 (IP_NOT_IN_WHITELIST).
| Entry | Effect |
|---|---|
Specific IP (e.g. 203.0.113.10) |
Allows that source address only |
CIDR (e.g. 203.0.113.0/24) |
Allows addresses in that range (same address family only) |
Exactly 0.0.0.0 (entire whitelist) |
Allow-all — any source IP |
0.0.0.0/0 |
IPv4 CIDR allow-all for IPv4 sources only; IPv6 clients do not match |
First-time setup: if every call returns -2017, add the public egress IP of your trading hosts under Bind IP whitelist. Use GET /openapi/v1/user/ip to see the IP the gateway currently associates with the request. See also error code -2017.
HTTP methods¶
Public REST uses GET and POST only. Cancel / listenKey keepalive / close use dedicated POST paths (see the matrix below).
Per-endpoint role matrix (AU public)¶
- Paths below are the canonical versioned public paths.
- Legacy aliases (for example wallet paths missing
/v1) are not listed.
Market quote paths under /openapi/quote/v1 and public spot metadata (ping / time / exchangeInfo / pairs / user/ip) require no API key or signature — OpenAPI marks them Required Type: — (no API key).
Required Type in the tables matches the OpenAPI operation description. Spot trade / Wallet alone unlock their own domain; Common accepts Read only, Spot trade, or Wallet; pure Read only also unlocks the read rows under Spot trade and Wallet.
Trading¶
| Method | Path | Auth | Required Type |
|---|---|---|---|
GET |
/openapi/v1/historyOrders |
HMAC | Spot trade (Read only OK for GET) |
GET |
/openapi/v1/myTrades |
HMAC | Spot trade (Read only OK for GET) |
GET |
/openapi/v1/openOrders |
HMAC | Spot trade (Read only OK for GET) |
GET |
/openapi/v1/order |
HMAC | Spot trade (Read only OK for GET) |
POST |
/openapi/v1/order |
HMAC | Spot trade |
POST |
/openapi/v1/order/cancel |
HMAC | Spot trade |
POST |
/openapi/v1/order/cancelAll |
HMAC | Spot trade |
POST |
/openapi/v1/order/cancelReplace |
HMAC | Spot trade |
Common¶
| Method | Path | Auth | Required Type |
|---|---|---|---|
GET |
/openapi/account/v3/crypto-accounts |
HMAC | Common (Read only / Spot trade / Wallet) |
GET |
/openapi/v1/account |
HMAC | Common (Read only / Spot trade / Wallet) |
GET |
/openapi/v1/asset/tradeFee |
HMAC | Common (Read only / Spot trade / Wallet) |
GET |
/openapi/v1/asset/transaction/history |
HMAC | Common (Read only / Spot trade / Wallet) |
User data stream¶
| Method | Path | Auth | Required Type |
|---|---|---|---|
POST |
/openapi/v1/userDataStream |
API key only | Spot trade (Read only OK) |
POST |
/openapi/v1/userDataStream/update |
API key only | Spot trade (Read only OK) |
POST |
/openapi/v1/userDataStream/close |
API key only | Spot trade (Read only OK) |
Crypto wallet¶
| Method | Path | Auth | Required Type |
|---|---|---|---|
GET |
/openapi/wallet/v1/config/getall |
HMAC | Wallet (Read only OK for GET) |
GET |
/openapi/wallet/v1/deposit/address |
HMAC | Wallet (Read only OK for GET) |
GET |
/openapi/wallet/v1/deposit/addresses |
HMAC | Wallet (Read only OK for GET) |
GET |
/openapi/wallet/v1/deposit/history |
HMAC | Wallet (Read only OK for GET) |
POST |
/openapi/wallet/v1/withdraw/apply |
HMAC | Wallet |
GET |
/openapi/wallet/v1/withdraw/history |
HMAC | Wallet (Read only OK for GET) |