API/API

Errors

The API uses standard HTTP status codes. Every error body has ok: false and an error code in capitals.

JSON
{ "ok": false, "error": "NO_SESSION" }

Some errors carry more fields:

FieldWhen
statusRepeats the HTTP status, on errors from agent and borrow routes.
errorsBAD_FORM only: a list of { field, message }, one per field that failed.
digestTX_FAILED only: the digest of the transaction the chain rejected.
walletWALLET_SHORT only: {coin, holds, needs} in base units.
JSON
{
  "ok": false,
  "status": 400,
  "error": "BAD_FORM",
  "errors": [{ "field": "maxLtvBps", "message": "between 0.01% and the market's 50.00%" }]
}

A request the server cannot read at all, such as malformed JSON, returns 400 with the reason as the error text, cut to 200 characters.

Move abort names#

GET/v1/errors→ { ok, lending, saleRoom }

Every Move abort the server can name: lending (the table the SDK exports as MOVE_ABORTS) and saleRoom. No sign-in needed.

Status codes#

StatusMeaning
200, 201Success; 201 for a created agent or a built transaction.
204Answer to a CORS preflight.
400The request is invalid.
401Not signed in, or sign-in failed.
403Not allowed: wrong host, origin or admin token.
404No such route, agent, room, loan, offer or transaction.
409Valid, but not possible in the current state.
410Expired: a challenge or a built transaction.
415Not JSON.
429A rate limit. See Rate limits.
502The chain rejected the transaction, or its result was not as expected.

Codes#

Any route#

CodeStatusMeaning
HOST_NOT_ALLOWED403The Host header is not accepted.
ORIGIN_NOT_ALLOWED403A browser origin not on the list.
CONTENT_TYPE_MUST_BE_JSON415A non-GET request without a JSON content type.
NO_SUCH_ROUTE404Unknown path or method.
NO_SESSION401Missing, expired or invalid session token.
NOT_ADMIN403Admin route without the admin token.

Sign-in#

BAD_ADDRESS 400, TRY_LATER 429, NO_SUCH_CHALLENGE 401, CHALLENGE_EXPIRED 410, MESSAGE_MISMATCH 401, BAD_SIGNATURE 401, PASSKEY_WRONG_RP 401, PASSKEY_WRONG_ORIGIN 401, PASSKEY_NOT_PRESENT 401. See Authentication.

Agents#

CodeStatusMeaning
NO_SUCH_AGENT404Not found, or not yours.
BAD_NAME, BAD_PRESET400Invalid create request.
AGENT_LIMIT429Too many agents.
AGENT_EXISTS, KEYS_NOT_SEPARATE, OWNER_IS_AN_AGENT409A self-run claim: the agent's address already has an agent, is the owner's own address, or the owner's address is itself an agent's.
BAD_FORM400The rules form failed; see errors.
BAD_SETTING400A setting is not a boolean, or none was given.
UNKNOWN_ACTION400Not an action for this agent's side.
BAD_AMOUNT, OVER_BALANCE, OVER_BUDGET_CAP400Amount missing, too large for the balance, or over the budget limit.
BAD_LOAN_ID, BAD_LOAN400The loan id is not a Sui object id.
NO_SUCH_LOAN404The agent holds no such open loan.
REVOKED409The agent is revoked.
TREASURY_EXISTS, NEEDS_TREASURY409create already done, or not done yet.
CREATE_IN_FLIGHT, CREATE_UNRESOLVED409A create is executing, or one was submitted and is not yet visible on chain; see digest.
WALLET_SHORT409Your wallet holds less than create moves; see wallet.
NOTHING_TO_WITHDRAW, NOTHING_TO_CLAIM409Nothing there.
CASH_SHORT409The cash treasury cannot cover the repay.
RATE_UNREAD409A pool loan's live rate could not be read, so the repay amount cannot be set.
LOAN_OPEN409A borrower agent cannot be revoked while a loan is open. A withdraw that would leave cash below the open loans' owed plus the cash float is refused the same way.
NOT_THIS_LENDERS_LOAN, LOAN_NOT_OPEN, NOT_DUE409A default cannot be collected.
NOT_READY, NOT_FUNDED, SELF_RUN, ROOM_NEEDS_PASSKEY, KILL_SWITCH_ON, CANNOT_START: …409Launch refused.
DAILY_TX_LIMIT429Daily build limit reached.
SPONSOR_BUDGET_SPENT429The operator's network fees for owner transactions today are used up.
NO_SUCH_TX404Unknown or used transaction id.
TX_EXPIRED410Built more than 120 seconds ago.
TX_FAILED502Rejected on chain; see digest.
OWNERCAP_NOT_IN_WALLET, AGENTCAP_NOT_AT_AGENT502create landed but a capability is not where it should be.

Borrow#

CodeStatusMeaning
BAD_COLLATERAL, BAD_AMOUNT, BAD_MAX_RATE, BAD_TERM, BAD_WINDOW, BAD_SETTLE_WINDOW400A field is invalid.
BAD_ROOM_ID, BAD_LOAN_ID, BAD_RATE, BAD_SALT, BAD_TREASURY_ID, BAD_CAP_ID400An id or opening field is invalid.
LTV_TOO_HIGH, OVER_OFFER_LTV400Over the market's or the offer's loan-to-value.
OVER_MAX_RATE, OUTSIDE_OFFER_FILLS, NO_SUCH_OFFER, OPENING_MISMATCH400Terms do not match.
NO_SUCH_ROOM, NO_SUCH_LOAN, NO_POOL404Not found, or not yours.
NO_SUCH_OFFER404On offer-fill and refinance.
PRICE_STALE409The SUI price is too old to borrow on.
INSUFFICIENT_SUI, INSUFFICIENT_FUNDS409Your wallet holds too little SUI or USDC.
OFFER_EXPIRED, OFFER_TOO_SHORT, OFFER_FULL, POOL_SHORT, OFFER_DOES_NOT_FIT409The offer or pool cannot take this loan now; OFFER_TOO_SHORT is a term under six hours.
ROOM_NOT_OPEN, ROOM_NOT_CLOSED, SETTLE_WINDOW_CLOSED, SETTLE_WINDOW_OPEN, NO_CONSENT409Wrong moment for this room action.
LOAN_NOT_OPEN, NOTHING_TO_CLAIM409Wrong state for this loan action.
MANDATE_GONE, CAP_EXPIRED, OUTSIDE_MANDATE_FILLS, OVER_MANDATE_CAP, COLLATERAL_NOT_ALLOWED, OVER_MANDATE_LTV, RATE_BELOW_MANDATE, TERM_OUTSIDE_MANDATE, TAKER_NOT_ALLOWED, LENDER_SHORT409The lender's mandate would refuse this loan on chain.
UNKNOWN_ACTION400
DAILY_TX_LIMIT429
SPONSOR_BUDGET_SPENT429The operator's network fees for today are used up. Build again with "gas": "own" to pay your own.
NO_SUCH_TX, TX_EXPIRED, TX_FAILED404, 410, 502As for agent transactions.

On-chain abort codes#

When a transaction is rejected on chain, the abort code is the Move module's error constant. They are listed per module in the on-chain reference.