Skip to main content

Test Spot Quote Connection

Builds a temporary provider from the submitted configuration and looks up one sample price, ETH in USD. Nothing is saved and no cache is touched. The stored configuration is not used: send the API key you want to test.

  • An empty base_url probes the vendor's own endpoint. A typed one receives the key, so it must be public https or an in-cluster host the environment lists; anything else is refused with 10001 (domain 83) before anything is sent.
  • use_config: true is refused: there is no built-in configuration to test against.

A probe that fails is still a 200, with ok: false and the reason in error. A provider that answers without a usable price is also ok: false.

Platform owner only. The caller's node must be the platform root node; any other caller is refused with 403 / 10005.

Required permission: spot-quote-provider:update

Request​

POST /v2/admin/spot-quote-providers/test

Headers​

NameDescription
AuthorizationRequired. Bearer <access_token>
Content-TypeRequired. application/json

Body​

FieldTypeRequiredDescription
providerstringYesProvider key: cryptocompare or coinmarketcap
api_keystringNoAPI key to probe with
base_urlstringNoAPI base URL. Empty means the vendor's own endpoint
timeoutintegerNoRequest timeout in seconds, 0 or greater
use_configbooleanNoMust be omitted or false; true is refused

Example​

curl --request POST \
--url '{{baseUrl}}/v2/admin/spot-quote-providers/test' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"provider": "coinmarketcap",
"api_key": "<coinmarketcap_api_key>",
"base_url": "",
"timeout": 30
}'

Response​

{
"ok": true,
"latency_ms": 264,
"sample_symbol": "ETH",
"price": "3412.57"
}

Response Fields​

FieldTypeDescription
okbooleanWhether a positive price came back for the sample symbol
latency_msintegerDuration of the lookup in milliseconds
sample_symbolstringThe symbol looked up: ETH
pricestringPrice of the sample symbol in USD, decimal string. "0" when ok is false
errorstringOnly when ok is false: why the lookup failed

Errors​

StatusCodeDescription
40010015Validation failed (provider missing, negative timeout) — see details. Also: unsupported provider key, or use_config: true
40010001The typed base_url is refused: not https, does not resolve, or resolves to a private or metadata address (domain 83)
40310005The caller is not the platform owner (domain 2)

See Errors for the error format and common codes.