Check OAuth API key existence
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. Use the endpoint before redirecting the user to the OAuth API key flow — when a key already exists, skip the redirect and surface the appropriate message to the user.
Required scope: apikeys.read.
Region availability: The endpoint is available on the global server (https://whitebit.com) only.
GET
/
oauth2
/
api-key
/
info
Check OAuth API key existence
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. 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 exists for this (user, OAuth2 client) pair. | 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. |
- Call the endpoint before redirecting the user to the OAuth authorization screen. Skipping the redirect when a key already exists avoids a flow the platform rejects.
- 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.
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?