Skip to content

Latest commit

 

History

History
603 lines (348 loc) · 19.7 KB

UserApi.md

File metadata and controls

603 lines (348 loc) · 19.7 KB

\UserApi

All URIs are relative to https://localhost/api/v1

Method HTTP request Description
UserCancelWithdrawal Post /user/cancelWithdrawal Cancel a withdrawal.
UserCheckReferralCode Get /user/checkReferralCode Check if a referral code is valid.
UserConfirm Post /user/confirmEmail Confirm your email address with a token.
UserConfirmEnableTFA Post /user/confirmEnableTFA Confirm two-factor auth for this account. If using a Yubikey, simply send a token to this endpoint.
UserConfirmWithdrawal Post /user/confirmWithdrawal Confirm a withdrawal.
UserDisableTFA Post /user/disableTFA Disable two-factor auth for this account.
UserGet Get /user Get your user model.
UserGetAffiliateStatus Get /user/affiliateStatus Get your current affiliate/referral status.
UserGetCommission Get /user/commission Get your account's commission status.
UserGetDepositAddress Get /user/depositAddress Get a deposit address.
UserGetMargin Get /user/margin Get your account's margin status. Send a currency of "all" to receive an array of all supported currencies.
UserGetWallet Get /user/wallet Get your current wallet information.
UserGetWalletHistory Get /user/walletHistory Get a history of all of your wallet transactions (deposits, withdrawals, PNL).
UserGetWalletSummary Get /user/walletSummary Get a summary of all of your wallet transactions (deposits, withdrawals, PNL).
UserLogout Post /user/logout Log out of BitMEX.
UserLogoutAll Post /user/logoutAll Log all systems out of BitMEX. This will revoke all of your account's access tokens, logging you out on all devices.
UserMinWithdrawalFee Get /user/minWithdrawalFee Get the minimum withdrawal fee for a currency.
UserRequestEnableTFA Post /user/requestEnableTFA Get secret key for setting up two-factor auth.
UserRequestWithdrawal Post /user/requestWithdrawal Request a withdrawal to an external wallet.
UserSavePreferences Post /user/preferences Save user preferences.
UserUpdate Put /user Update your password, name, and other attributes.

UserCancelWithdrawal

Transaction UserCancelWithdrawal($token)

Cancel a withdrawal.

Parameters

Name Type Description Notes
token string

Return type

Transaction

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserCheckReferralCode

float64 UserCheckReferralCode($referralCode)

Check if a referral code is valid.

If the code is valid, responds with the referral code's discount (e.g. 0.1 for 10%). Otherwise, will return a 404.

Parameters

Name Type Description Notes
referralCode string [optional]

Return type

float64

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserConfirm

AccessToken UserConfirm($token)

Confirm your email address with a token.

Parameters

Name Type Description Notes
token string

Return type

AccessToken

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserConfirmEnableTFA

bool UserConfirmEnableTFA($token, $type_)

Confirm two-factor auth for this account. If using a Yubikey, simply send a token to this endpoint.

Parameters

Name Type Description Notes
token string Token from your selected TFA type.
type_ string Two-factor auth type. Supported types: 'GA' (Google Authenticator), 'Yubikey' [optional]

Return type

bool

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserConfirmWithdrawal

Transaction UserConfirmWithdrawal($token)

Confirm a withdrawal.

Parameters

Name Type Description Notes
token string

Return type

Transaction

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserDisableTFA

bool UserDisableTFA($token, $type_)

Disable two-factor auth for this account.

Parameters

Name Type Description Notes
token string Token from your selected TFA type.
type_ string Two-factor auth type. Supported types: 'GA' (Google Authenticator) [optional]

Return type

bool

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserGet

User UserGet()

Get your user model.

Parameters

This endpoint does not need any parameter.

Return type

User

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserGetAffiliateStatus

[]Affiliate UserGetAffiliateStatus()

Get your current affiliate/referral status.

Parameters

This endpoint does not need any parameter.

Return type

[]Affiliate

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserGetCommission

[]UserCommission UserGetCommission()

Get your account's commission status.

Parameters

This endpoint does not need any parameter.

Return type

[]UserCommission

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserGetDepositAddress

string UserGetDepositAddress($currency)

Get a deposit address.

Parameters

Name Type Description Notes
currency string [optional] [default to XBt]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserGetMargin

Margin UserGetMargin($currency)

Get your account's margin status. Send a currency of "all" to receive an array of all supported currencies.

Parameters

Name Type Description Notes
currency string [optional] [default to XBt]

Return type

Margin

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserGetWallet

Wallet UserGetWallet($currency)

Get your current wallet information.

Parameters

Name Type Description Notes
currency string [optional] [default to XBt]

Return type

Wallet

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserGetWalletHistory

[]Transaction UserGetWalletHistory($currency)

Get a history of all of your wallet transactions (deposits, withdrawals, PNL).

Parameters

Name Type Description Notes
currency string [optional] [default to XBt]

Return type

[]Transaction

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserGetWalletSummary

[]Transaction UserGetWalletSummary($currency)

Get a summary of all of your wallet transactions (deposits, withdrawals, PNL).

Parameters

Name Type Description Notes
currency string [optional] [default to XBt]

Return type

[]Transaction

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserLogout

UserLogout()

Log out of BitMEX.

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserLogoutAll

float64 UserLogoutAll()

Log all systems out of BitMEX. This will revoke all of your account's access tokens, logging you out on all devices.

Parameters

This endpoint does not need any parameter.

Return type

float64

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserMinWithdrawalFee

float64 UserMinWithdrawalFee($currency)

Get the minimum withdrawal fee for a currency.

This is changed based on network conditions to ensure timely withdrawals. During network congestion, this may be high. The fee is returned in the same currency.

Parameters

Name Type Description Notes
currency string [optional] [default to XBt]

Return type

float64

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserRequestEnableTFA

bool UserRequestEnableTFA($type_)

Get secret key for setting up two-factor auth.

Use /confirmEnableTFA directly for Yubikeys. This fails if TFA is already enabled.

Parameters

Name Type Description Notes
type_ string Two-factor auth type. Supported types: 'GA' (Google Authenticator) [optional]

Return type

bool

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserRequestWithdrawal

Transaction UserRequestWithdrawal($currency, $amount, $address, $otpToken, $fee)

Request a withdrawal to an external wallet.

This will send a confirmation email to the email address on record, unless requested via an API Key with the withdraw permission.

Parameters

Name Type Description Notes
currency string Currency you're withdrawing. Options: `XBt` [default to XBt]
amount float32 Amount of withdrawal currency.
address string Destination Address.
otpToken string 2FA token. Required if 2FA is enabled on your account. [optional]
fee float64 Network fee for Bitcoin withdrawals. If not specified, a default value will be calculated based on Bitcoin network conditions. You will have a chance to confirm this via email. [optional]

Return type

Transaction

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserSavePreferences

User UserSavePreferences($prefs, $overwrite)

Save user preferences.

Parameters

Name Type Description Notes
prefs string
overwrite bool If true, will overwrite all existing preferences. [optional] [default to false]

Return type

User

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserUpdate

User UserUpdate($firstname, $lastname, $oldPassword, $newPassword, $newPasswordConfirm, $username, $country, $pgpPubKey)

Update your password, name, and other attributes.

Parameters

Name Type Description Notes
firstname string [optional]
lastname string [optional]
oldPassword string [optional]
newPassword string [optional]
newPasswordConfirm string [optional]
username string Username can only be set once. To reset, email support. [optional]
country string Country of residence. [optional]
pgpPubKey string PGP Public Key. If specified, automated emails will be sentwith this key. [optional]

Return type

User

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]