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:
| Field | When |
|---|---|
| status | Repeats the HTTP status, on errors from agent and borrow routes. |
| errors | BAD_FORM only: a list of { field, message }, one per field that failed. |
| digest | TX_FAILED only: the digest of the transaction the chain rejected. |
| wallet | WALLET_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#
| Status | Meaning |
|---|---|
| 200, 201 | Success; 201 for a created agent or a built transaction. |
| 204 | Answer to a CORS preflight. |
| 400 | The request is invalid. |
| 401 | Not signed in, or sign-in failed. |
| 403 | Not allowed: wrong host, origin or admin token. |
| 404 | No such route, agent, room, loan, offer or transaction. |
| 409 | Valid, but not possible in the current state. |
| 410 | Expired: a challenge or a built transaction. |
| 415 | Not JSON. |
| 429 | A rate limit. See Rate limits. |
| 502 | The chain rejected the transaction, or its result was not as expected. |
Codes#
Any route#
| Code | Status | Meaning |
|---|---|---|
HOST_NOT_ALLOWED | 403 | The Host header is not accepted. |
ORIGIN_NOT_ALLOWED | 403 | A browser origin not on the list. |
CONTENT_TYPE_MUST_BE_JSON | 415 | A non-GET request without a JSON content type. |
NO_SUCH_ROUTE | 404 | Unknown path or method. |
NO_SESSION | 401 | Missing, expired or invalid session token. |
NOT_ADMIN | 403 | Admin 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#
| Code | Status | Meaning |
|---|---|---|
NO_SUCH_AGENT | 404 | Not found, or not yours. |
BAD_NAME, BAD_PRESET | 400 | Invalid create request. |
AGENT_LIMIT | 429 | Too many agents. |
AGENT_EXISTS, KEYS_NOT_SEPARATE, OWNER_IS_AN_AGENT | 409 | A 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_FORM | 400 | The rules form failed; see errors. |
BAD_SETTING | 400 | A setting is not a boolean, or none was given. |
UNKNOWN_ACTION | 400 | Not an action for this agent's side. |
BAD_AMOUNT, OVER_BALANCE, OVER_BUDGET_CAP | 400 | Amount missing, too large for the balance, or over the budget limit. |
BAD_LOAN_ID, BAD_LOAN | 400 | The loan id is not a Sui object id. |
NO_SUCH_LOAN | 404 | The agent holds no such open loan. |
REVOKED | 409 | The agent is revoked. |
TREASURY_EXISTS, NEEDS_TREASURY | 409 | create already done, or not done yet. |
CREATE_IN_FLIGHT, CREATE_UNRESOLVED | 409 | A create is executing, or one was submitted and is not yet visible on chain; see digest. |
WALLET_SHORT | 409 | Your wallet holds less than create moves; see wallet. |
NOTHING_TO_WITHDRAW, NOTHING_TO_CLAIM | 409 | Nothing there. |
CASH_SHORT | 409 | The cash treasury cannot cover the repay. |
RATE_UNREAD | 409 | A pool loan's live rate could not be read, so the repay amount cannot be set. |
LOAN_OPEN | 409 | A 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_DUE | 409 | A default cannot be collected. |
NOT_READY, NOT_FUNDED, SELF_RUN, ROOM_NEEDS_PASSKEY, KILL_SWITCH_ON, CANNOT_START: … | 409 | Launch refused. |
DAILY_TX_LIMIT | 429 | Daily build limit reached. |
SPONSOR_BUDGET_SPENT | 429 | The operator's network fees for owner transactions today are used up. |
NO_SUCH_TX | 404 | Unknown or used transaction id. |
TX_EXPIRED | 410 | Built more than 120 seconds ago. |
TX_FAILED | 502 | Rejected on chain; see digest. |
OWNERCAP_NOT_IN_WALLET, AGENTCAP_NOT_AT_AGENT | 502 | create landed but a capability is not where it should be. |
Borrow#
| Code | Status | Meaning |
|---|---|---|
BAD_COLLATERAL, BAD_AMOUNT, BAD_MAX_RATE, BAD_TERM, BAD_WINDOW, BAD_SETTLE_WINDOW | 400 | A field is invalid. |
BAD_ROOM_ID, BAD_LOAN_ID, BAD_RATE, BAD_SALT, BAD_TREASURY_ID, BAD_CAP_ID | 400 | An id or opening field is invalid. |
LTV_TOO_HIGH, OVER_OFFER_LTV | 400 | Over the market's or the offer's loan-to-value. |
OVER_MAX_RATE, OUTSIDE_OFFER_FILLS, NO_SUCH_OFFER, OPENING_MISMATCH | 400 | Terms do not match. |
NO_SUCH_ROOM, NO_SUCH_LOAN, NO_POOL | 404 | Not found, or not yours. |
NO_SUCH_OFFER | 404 | On offer-fill and refinance. |
PRICE_STALE | 409 | The SUI price is too old to borrow on. |
INSUFFICIENT_SUI, INSUFFICIENT_FUNDS | 409 | Your wallet holds too little SUI or USDC. |
OFFER_EXPIRED, OFFER_TOO_SHORT, OFFER_FULL, POOL_SHORT, OFFER_DOES_NOT_FIT | 409 | The 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_CONSENT | 409 | Wrong moment for this room action. |
LOAN_NOT_OPEN, NOTHING_TO_CLAIM | 409 | Wrong 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_SHORT | 409 | The lender's mandate would refuse this loan on chain. |
UNKNOWN_ACTION | 400 | |
DAILY_TX_LIMIT | 429 | |
SPONSOR_BUDGET_SPENT | 429 | The operator's network fees for today are used up. Build again with "gas": "own" to pay your own. |
NO_SUCH_TX, TX_EXPIRED, TX_FAILED | 404, 410, 502 | As 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.