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_urlprobes the vendor's own endpoint. A typed one receives the key, so it must be publichttpsor an in-cluster host the environment lists; anything else is refused with10001(domain83) before anything is sent. use_config: trueis 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
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Content-Type | Required. application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
provider | string | Yes | Provider key: cryptocompare or coinmarketcap |
api_key | string | No | API key to probe with |
base_url | string | No | API base URL. Empty means the vendor's own endpoint |
timeout | integer | No | Request timeout in seconds, 0 or greater |
use_config | boolean | No | Must 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
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether a positive price came back for the sample symbol |
latency_ms | integer | Duration of the lookup in milliseconds |
sample_symbol | string | The symbol looked up: ETH |
price | string | Price of the sample symbol in USD, decimal string. "0" when ok is false |
error | string | Only when ok is false: why the lookup failed |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | 10015 | Validation failed (provider missing, negative timeout) — see details. Also: unsupported provider key, or use_config: true |
| 400 | 10001 | The typed base_url is refused: not https, does not resolve, or resolves to a private or metadata address (domain 83) |
| 403 | 10005 | The caller is not the platform owner (domain 2) |
See Errors for the error format and common codes.