API Token (api_token)

This call manages API tokens

Auth Scope(s): admin

api_token(delete_token: Optional[str] = None, new_token: Optional[str] = None, new_token_scopes: Optional[List] = None, valid_for_current_ip_only: Optional[int] = None, passthrough: Optional[Any] = None, req_id: Optional[int] = None) → int
Parameters:
  • delete_token (Optional[str]) – [Optional] The token to remove.
  • new_token (Optional[str]) – [Optional] The name of the created token.
  • new_token_scopes (Optional[List]) – [Optional] List of permission scopes to provide with the token.
  • valid_for_current_ip_only (Optional[int]) – [Optional] If you set this parameter during token creation, then the token created will only work for the IP address that was used to create the token
  • passthrough (Optional[Any]) – [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
  • req_id (Optional[int]) – [Optional] Used to map request to response.
Returns:

req_id

Return type:

int

Example

binary.api.api_token(
    new_token='Token example'
    new_token_scopes=['admin', 'read', 'trade']
)