Skip to main content

Upsert Spot Quote Provider

Creates or updates a spot quote provider's configuration. Saving never changes which provider is active: a new provider is created inactive, and an existing one keeps its is_active. Use Activate Spot Quote Provider to switch.

api_key is nullable on purpose. You cannot read the key back, so a save that leaves it out must not erase it:

  • omitted or null keeps the stored key;
  • "" clears it;
  • any other string replaces it.

base_url, timeout and cache_ttl_seconds are always written as sent.

A stored key is only sent to the endpoint it was saved for. Changing base_url to another origin (including switching between an empty base_url, the vendor's own endpoint, and a typed one) while keeping the stored key is refused with 10015 naming api_key: send the key again.

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​

PUT /v2/admin/spot-quote-providers/{provider}

Parameters​

NameTypeInDescription
providerstringpathRequired. Provider key: cryptocompare or coinmarketcap

Headers​

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

Body​

FieldTypeRequiredDescription
api_keystring | nullNoVendor API key. null keeps the stored key, "" clears it
base_urlstringNoAPI base URL. Empty means the vendor's own endpoint
timeoutintegerNoRequest timeout in seconds, 0 or greater
cache_ttl_secondsintegerNoHow long fetched quotes are cached, 0 or greater. 0 means the provider client's default

Example​

curl --request PUT \
--url '{{baseUrl}}/v2/admin/spot-quote-providers/coinmarketcap' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"api_key": "<coinmarketcap_api_key>",
"base_url": "https://pro-api.coinmarketcap.com",
"timeout": 30,
"cache_ttl_seconds": 3600
}'

Response​

200 OK with the saved provider, masked as on List Spot Quote Providers.

{
"provider": "coinmarketcap",
"base_url": "https://pro-api.coinmarketcap.com",
"timeout": 30,
"cache_ttl_seconds": 3600,
"is_active": false,
"effective_active": false,
"api_key_set": true,
"api_key_last4": "b41d",
"configured": true,
"created_at": "2026-11-09T11:20:44.905Z",
"updated_at": "2026-11-09T11:20:44.905Z"
}

Errors​

StatusCodeDescription
40010015Validation failed (negative timeout or cache_ttl_seconds), unsupported provider key, or (with details naming api_key) a stored key that would move to a new endpoint
40310005The caller is not the platform owner (domain 2)

See Errors for the error format and common codes.