Creating your API keys
All you need to know about creating your API keys
Creating your API keys
To create your API key, please follow these steps:
- Sign in to your Kuna account;
- Open Settings and navigate to API keys tab;
- Name your API key, e.g. "View only" ;
- Select the types of permissions assigned to the API key;
- Add a list of IP addresses, which are allowed to use the API key. You can do that after the key creation, as well;
- Click Create an API key button to complete.
We provide three keys when you generate a new API key:
We recommend creating different API keys for trading and withdrawal operations. Never share your API key and secret key with anyone!
The reasoning behind two authorization options
"Why 3 keys for one API key instance?", you might ask.
We view those by the tasks at hand you may have, whether it is rapid exploration/testing or building a production-ready system:
- The single API key allows you to quickly test new features and endpoints, both manually and during development.
Simple authorization using request headers, less effort to implement. - The public and secret key pair is a more secure way of operating your production environment.
It requires each transaction to be signed with the help of a private key.
Thus, harder to test manually and needs more efforts to be implemented during development.
Of course, it is up to you to decide which option suits your current needs better.
In the How to call private endpoints section we describe how to authenticate using both methods.
Setting the right permissions
You may grant certain or all permissions to your API keys.
Below you may find more information regarding each permission and endpoints that work with each.
The more permissions a key has, the more operations it can be used for.
It is a good practice to split permissions between various API keys. This improves security and redundancy of your operations.
Endpoints that work with Only reading
permissions:
Private endpoints | Description |
---|---|
/v4/private/me | View your account info |
/v4/private/getBalance | View your wallet balances |
/v4/order/private/active | View your active orders |
/v4/order/private/history | View your order history |
/v4/trade/private/history | View your trades history |
/v4/order/private/details | View details of a single order |
/v4/order/private/{id}/trades | View trades by order id |
/v4/deposit/private/crypto/address | Find a constant crypto address for deposit |
/v4/deposit/private/crypto/generateAddress | Generate a constant crypto address for deposit |
/v4/deposit/private/crypto/getMerchantAddress | Find temporary crypto addresses (Available only for Merchant) |
/v4/deposit/private/crypto/generateMerchantAddress | Generate a temporary crypto address for deposit (Available only for Merchant) |
/v4/deposit/private/preRequest | View info about deposit payment methods by currency name |
/v4/deposit/private/history | View deposit history |
/v4/deposit/private/details/{depositId} | View deposit details by id |
/v4/withdraw/private/preRequest | View info about withdrawal methods by currency name |
/v4/withdraw/private/history | View withdraw history |
/v4/withdraw/private/details/{withdrawId} | View withdraw details by id |
/v4/kuna-code/{id} | View Kuna Code details by id |
/v4/kuna-code/{code}/check | Check Kuna Code by the first 5 symbols |
/v4/kuna-code/issued-by-me | View history of created Kuna Сodes |
/v4/kuna-code/redeemed-by-me | View history of activated Kuna Сodes |
/v4/kuna-code/redeem | Activate a Kuna Code |
Endpoints that work with You can trade
permission include all for Only reading
plus the following:
Endpoints | Description |
---|---|
/v4/order/private/create | Create a new order |
/v4/order/private/cancel | Cancel a single order |
/v4/order/private/cancel/multi | Cancel multiple orders |
Endpoints that work with You can withdraw funds
permission include all for Only reading
plus the following:
Endpoints | Description |
---|---|
/v4/withdraw/private/create | Create a withdraw |
/v4/kuna-code | Create a new Kuna Code |
Whitelisting IP addresses
To further improve the security of your account, we recommend whitelisting IPs of your servers, so that your keys may only be used by trusted machines.
In case such API key is attempted to be used by a machine with a non-whitelisted IP will not be executed by the service.
- To whitelist IPs for an existing API key, please open the API keys tab, find the API key in question and click Whitelisted IPs ✏ button next to it:
- To whitelist IPs when creating a new API key, please click Create ✏ button for the IP whitelist field:
- The modal is the same and receives inputs of IP addresses, separated by comma if several.
Click Save list once completed:
Updated about 1 year ago