Refresh token
The information on this page is applicable to Production environment of the system. Authorization in Test environment comes with some differences. For details about authorization in Test environment, see the corresponding article.
Refresh token is a long-term token created by API user after successfully authorizing in Developer Account and binding a Trading Account to it.
The role of this token is to update the short-term Access token used for authorization of API requests made by a user.
Refresh token allows creating Access tokens that give access to the system equivalent to using a login and password of a trading account. Keep it private.
Viewing and managing tokens
The only option to manage Refresh tokens available to the user is to use the API Access Tokens page.
Created tokens are displayed on the page in a list with the following information about each token:
- Token value. By default, it is hidden. Click the `Show' button to display it in the open view
- Token creation date
- Token expiration date
- Token status. For expired and manually revoked tokens the actual status
Revoked
is displayed, for valid tokens - the buttonRevoke token
is displayed.
The list does not support pagination, so it is not recommended to unnecessarily create a large number of Refresh tokens, even though their quantity is not limited by the system.
The list displays all Refresh tokens created on behalf of the bound trading account, regardless of which developer account they were created by.
Developer accounts “Developer_1” and “Developer_2” with the same trading account created a token each. As a result, both tokens will be displayed in the list for both developers.
The same goes for token revocation — it will be revoked for a trading account, not a specific developer account.
“Developer_1” sees the token created by “Developer_2” for himself in the list and revokes it. As a result, the token has been revoked for both developers.
So, all tokens of a trading account are shared by all API users using that trading account.
Creating token
To create a new Refresh token, follow the steps below:
- Log in to the Developer Portal and go to the API Access Tokens page
- Click the
Create Token
button to create a new Refresh token - Click the
Show
button to view the created token
Received token will be valid for 1 year from the date of creation, unless revoked earlier.
Use the received Refresh token to create the Access token required to authorize requests to the system.
Revoking token
If the Refresh token has been compromised or lost its use before the expiration date, it is recommended to revoke it to reduce security risks.
Revocation of a Refresh token can be done on the same page where it was previously created.
To revoke a Refresh token, follow the steps below:
- Log in to the Developer Portal and go to the API Access Tokens page
- Find the token to be revoked in the list
- Click
Revoke Token
.
Revoking a Refresh token will result in the termination of all Access tokens created with it.
Features and limitations
Please note the following features and restrictions when creating and using Refresh tokens:
- Token expiration time is limited to 1 year from the moment of creation
- Each token grants access to all contracts of the specified trading account. It is not possible to issue a token for an individual market
- Created token is available for all developer accounts to which the trading account used to create it is bound.
- Created tokens can be manually revoked at any time before their expiration date
- Revoked token cannot be restored to a working state. It is not possible to temporarily suspend the validity of a token
- When a Refresh token is revoked, all Access tokens created with it will also be terminated
What's next?
Additionally, we recommend reading the following related articles:
- Description of Access tokens
- Specifics of authorization in Test environment
- Guide for HTTP API
- Guide for WebSocket API
- Quick Start Guide for Production environment
- Quick Start Guide for Test environment