Get Account
curl --request GET \
--url https://api.ondoperps.xyz/v1/account \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ondoperps.xyz/v1/account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ondoperps.xyz/v1/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ondoperps.xyz/v1/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ondoperps.xyz/v1/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ondoperps.xyz/v1/account")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"accountID": "10458932786832481",
"identifier": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
"authType": "web3",
"accountState": "open",
"withdrawalFeeUSD": "1",
"disabledFunctionality": {
"disableTransfers": false,
"disableWallet": false,
"disableBalance": false,
"disablePerps": false,
"disableAPIKeys": false,
"disableSubaccounts": true,
"disableNetworkLink": true,
"disableReferrals": true,
"disableAlphaStrategies": true,
"disableAlphaStrategiesCreation": true,
"disableWalletLogins": true,
"disableChat": true,
"disableMAC": true,
"disableBasisTradeAccounts": true
},
"termsVersion": 2,
"termsUnixSecs": 1704067200,
"privacyVersion": 1,
"privacyUnixSecs": 1704067200,
"marketingConsent": "accepted",
"subaccountsLimit": 256,
"cooldownPeriodSecs": 0,
"pointsState": 0
}
}{
"success": false,
"error": "Description of the error",
"error_code": "account_not_found"
}{
"success": false,
"error": "Description of the error",
"error_code": "auth_missing"
}{
"success": false,
"error": "Description of the error",
"error_code": "account_not_allowed"
}{
"success": false,
"error": "Description of the error",
"error_code": "too_many_requests"
}{
"success": false,
"error": "Description of the error",
"error_code": "unknown"
}Account
Get Account
Returns account information for the authenticated user.
GET
/
v1
/
account
Get Account
curl --request GET \
--url https://api.ondoperps.xyz/v1/account \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ondoperps.xyz/v1/account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ondoperps.xyz/v1/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ondoperps.xyz/v1/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ondoperps.xyz/v1/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ondoperps.xyz/v1/account")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"accountID": "10458932786832481",
"identifier": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
"authType": "web3",
"accountState": "open",
"withdrawalFeeUSD": "1",
"disabledFunctionality": {
"disableTransfers": false,
"disableWallet": false,
"disableBalance": false,
"disablePerps": false,
"disableAPIKeys": false,
"disableSubaccounts": true,
"disableNetworkLink": true,
"disableReferrals": true,
"disableAlphaStrategies": true,
"disableAlphaStrategiesCreation": true,
"disableWalletLogins": true,
"disableChat": true,
"disableMAC": true,
"disableBasisTradeAccounts": true
},
"termsVersion": 2,
"termsUnixSecs": 1704067200,
"privacyVersion": 1,
"privacyUnixSecs": 1704067200,
"marketingConsent": "accepted",
"subaccountsLimit": 256,
"cooldownPeriodSecs": 0,
"pointsState": 0
}
}{
"success": false,
"error": "Description of the error",
"error_code": "account_not_found"
}{
"success": false,
"error": "Description of the error",
"error_code": "auth_missing"
}{
"success": false,
"error": "Description of the error",
"error_code": "account_not_allowed"
}{
"success": false,
"error": "Description of the error",
"error_code": "too_many_requests"
}{
"success": false,
"error": "Description of the error",
"error_code": "unknown"
}Authorizations
BearerAuthApiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
Account info
Whether the request was successful
Example:
true
Error message, present only on failure
Example:
""
Semantic error code. See each endpoint's error responses for the specific codes it can return.
Deprecation notice, if applicable
Example:
""
Show child attributes
Show child attributes
⌘I