svalin
All docs pages

API and agents

Errors

Every error is JSON, with a plain message and a stable code.

The shape of an error

{
  "error": "Route not found.",
  "code": "not_found",
  "hint": "GET / lists every endpoint."
}

error is for people, code is for programs, and hint, when there is one, says what to do next.

Statuses and codes

StatusCodeMeaning
400invalid_addressinvalid_payerchain_mismatchinvalid_amountinvalid_contractamount_needs_paid_routeThe request is wrong. Fix it and send it again.
401missing_keyinvalid_keyunknown_keykey_endedThe key is missing, not known or has ended. Send a valid key, or leave the header out and pay per call.
402Payment is required. See Paying per call.
404not_foundunknown_plantrusted_tokennear_not_acceptedThere is no such route or pass, or the token is one Svalin values others against, so it has no grade.
409other_planThis key is on another plan. Renew it on its own plan.
422token_addressThis is a token, not a wallet. For a NEAR token, the answer carries its grade.
429demo_limit_reachedpro_daily_limitkey_used_uptoo_many_requeststoo_many_refused_keysA limit was reached. Daily calls come back at 00:00 UTC; Retry-After says when to try a free route again.
500internal_errorSomething failed on Svalin’s side.
501chain_not_supportedThis instance does not cover that chain.
502upstream_unavailableupstream_errorA data provider did not answer. Try again in a minute.
503upstream_rate_limitedpayments_not_configuredfacilitator_unavailablekeys_unavailablecheckout_busyA service is busy or not available. Try again shortly.

Failed calls are not charged

Bad input is rejected before any payment, and a call that fails is never settled. A call made with a pass that fails is not counted.