Getting started›Authentication
Authentication
Secret keys, scopes, IP allowlists and rate limits.
Secret keys
Send your secret key on every request, as Authorization: Bearer sk_test_…, or as the username of HTTP Basic with no password (curl -u sk_test_…:).
sk_test_keys work against the sandbox,https://sandbox-api.solacefi.co/platform/v1, on real testnets.sk_live_keys work againsthttps://api.solacefi.co/platform/v1and move real money. You make them in the console's Live once Solace has verified your business and opened live mode.
Keep keys on your server. A key in a browser or a mobile app can be read by anyone who has it.
curl https://sandbox-api.solacefi.co/platform/v1/assets \
-H "Authorization: Bearer $SOLACE_KEY"const res = await fetch('https://sandbox-api.solacefi.co/platform/v1/assets', { method: 'GET', headers: { Authorization: `Bearer ${process.env.SOLACE_KEY}`, }, }); const data = await res.json();
Scopes
A key can do everything, or only what you give it when you make it:
end_users— create, read and update end users, and restrict them (read:end_usersreads only).wallets— open wallets; read wallets and balances (read:wallets).swaps— quote and execute swaps.withdrawals— make and read withdrawals (read:withdrawals).read:transactions— read balance movements.transfers— make and read transfers, and record end users' identities (read:transfers).payouts— save payout destinations; quote, make and read bank payouts (read:payouts).buys— open naira accounts; price, place, cancel and read naira buys (read:buys).settings— read and change your settings.
A call the key isn't scoped for is refused with 403 (permission).
Allowlists, rotation, limits
- A key can be limited to IP addresses you list; a call from anywhere else is refused with 403.
- Rotating a key in the console gives you a new secret at once, and the old one keeps working for 24 hours while you switch.
- Each key may make 1,200 requests a minute. Past that, calls are refused with 429 (
rate_limit) until the minute is up.