curl --request GET \
--url https://whitebit.com/oauth2/api-key/info \
--header 'Authorization: Bearer <token>'import requests
url = "https://whitebit.com/oauth2/api-key/info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://whitebit.com/oauth2/api-key/info', 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://whitebit.com/oauth2/api-key/info",
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://whitebit.com/oauth2/api-key/info"
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://whitebit.com/oauth2/api-key/info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/oauth2/api-key/info")
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{
"data": {
"exists": true,
"isEnabled": true,
"externalId": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
{
"name": "trading",
"title": "Trading",
"urls": [
{
"url": "/v2/order",
"enable": true
}
]
}
]
}
}{
"data": {
"message": [
"Unauthorized."
]
}
}Check OAuth API key existence
The endpoint returns whether a partner-issued API key already exists for the authenticated user and OAuth2 client pair. The endpoint is Bearer-authenticated, so it is reachable only once the partner holds a token for that user: a returning partner calls it before redirecting the user again, while a first-time authorization reaches it only after the authorization code has been exchanged. When a key already exists, skip the redirect and surface the appropriate message to the user.
The endpoint reports absence through the payload, never through an error status. A key that was deleted, a key belonging to a different OAuth2 client, and a manually created key are all reported as exists: false with an empty permissions list. The only failure status is 401, which covers every problem with the token itself.
Required scope: apikeys.read.
Region availability: The endpoint is available on the global server (https://whitebit.com) only.
curl --request GET \
--url https://whitebit.com/oauth2/api-key/info \
--header 'Authorization: Bearer <token>'import requests
url = "https://whitebit.com/oauth2/api-key/info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://whitebit.com/oauth2/api-key/info', 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://whitebit.com/oauth2/api-key/info",
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://whitebit.com/oauth2/api-key/info"
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://whitebit.com/oauth2/api-key/info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/oauth2/api-key/info")
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{
"data": {
"exists": true,
"isEnabled": true,
"externalId": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
{
"name": "trading",
"title": "Trading",
"urls": [
{
"url": "/v2/order",
"enable": true
}
]
}
]
}
}{
"data": {
"message": [
"Unauthorized."
]
}
}Authentication
OAuth 2.0 Bearer token. Required scope:apikeys.read. The endpoint cannot be reached before the partner holds a token for the user, so a first-time integration calls it only after the authorization code has been exchanged. See Authentication. The endpoint is available on https://whitebit.com only.
Cache
No caching.Notes
Use the decision matrix below to interpret the(exists, isEnabled) response and choose the next action.
exists | isEnabled | Meaning | Recommended action |
|---|---|---|---|
false | false | No partner-issued API key is visible for this (user, OAuth2 client) pair — never created, deleted, owned by another client, or created manually. | Start the OAuth API key flow. |
true | true | An active partner-issued API key already exists. | Skip the OAuth API key flow. Surface “an active API key for this partner already exists” to the user. |
true | false | A disabled partner-issued API key exists (post-inactivity, awaiting user-side deletion). | Skip the OAuth API key flow. Ask the user to delete the disabled key from the WhiteBIT dashboard, then retry. |
- For a returning user whose token is still valid, call the endpoint before redirecting again — an existing key is reused rather than recreated, and a second creation attempt is rejected. See Returning users. For a first-time user no token exists yet, so the endpoint is reachable only after the authorization code has been exchanged.
- Disabled keys are not deletable through the OAuth2 partner endpoint. Disabled keys are removed by the user from the WhiteBIT dashboard.
- See Retrieve OAuth API key secret for the secret-fetch step and Delete OAuth API key for partner-initiated revocation.
- The
permissionsarray lists the permission groups the user granted on the consent screen — see Key permissions for the full permission model. When the user granted no permissions at all, the key is still created and the array comes back empty; the user deletes that key and re-runs the flow to grant a usable set.
Used in these guides
- Copy Trading — mirror a lead trader’s orders into followers’ own accounts via OAuth-issued keys.
- Fast API Key integration — OAuth-issued API keys created on behalf of end users.
Was this page helpful?