Error Codes

Canonical PAX API error catalog — 103 codes across 15 groups. All errors return the envelope {"error":{"code","message","trace_id","details?"}}. Auto-generated from packages/core/src/errors.ts on every deploy.

A subset of codes below are reserved or dormant — defined in the error catalog but not returned by the standard live surface today (MCP tooling, receiver-side webhook verification, and a few legacy codes retained for catalog stability). Endpoints that can actually return each code are listed on the per-endpoint OpenAPI page (/openapi). If you see an undocumented code in production, contact support with the trace_id.

Error response format

{
  "error": {
    "code":     "TIER_LIMIT_EXCEEDED",
    "message":  "order notional 50.00 exceeds tier max_order_usdt 10",
    "trace_id": "a98efc1d-7db7-4ee2-bba6-afe481418c11",
    "details":  { "tier": "sandbox", "cap": "10" }
  }
}

The HTTP status is bound to the code via the shared error catalog — the same code always returns the same status. Reference the trace_id when contacting support. Requests made with your own API keys or OAuth apps can be looked up by trace_id for 7 days in the Builder Portal (Ops > API request logs) or with GET /v1/builders/me/request-logs/{trace_id}.

400 — client errors

HTTPCodeDescription
400BAD_REQUESTMalformed request body or query
400VALIDATION_FAILEDPayload did not pass schema validation
200ORDER_REJECTEDOne order in POST /v1/orders/batch was rejected. error.reject_reason is the reason (the same value POST /v1/orders returns as reject_reason, for example insufficient_balance), error.message its detail, and data the rejection as POST /v1/orders returns it
400INVALID_FIELDA field broke a rule. For orders: size at most 6 decimal places, price between 0 and 1 with at most 4 decimal places, plain decimals only (no exponent form)
400BELOW_MIN_NOTIONALOrder value (size × price; MARKET orders: size) is below 1 USDT
400ABOVE_MAX_NOTIONALOrder value is above 100,000 USDT
400IDEMPOTENCY_KEY_MISSINGIdempotency-Key header required on writes
400IDEMPOTENCY_KEY_MALFORMEDIdempotency-Key must match [A-Za-z0-9_-]{8,128}
409IDEMPOTENCY_BODY_MISMATCHIdempotency key reused with different body
400URN_MALFORMEDIdentifier not a canonical URN
400URN_INVALID_DOMAINIdentifier URN domain unrecognized
400URN_INVALID_SLUGIdentifier URN slug malformed
400URN_SLUG_TOO_LONGIdentifier URN slug exceeds 128 chars
400ID_MALFORMEDIdentifier not a canonical prefixed id
400ID_INVALID_KINDIdentifier prefix unrecognized

401 — authentication

HTTPCodeDescription
401AUTH_REQUIREDMissing credentials
401AUTH_INVALIDCredentials rejected
401WRONG_ENV_KEYKey's environment prefix does not match the target environment — an sk_live_ key used against sandbox, or an sk_test_ key against production.
401TIMESTAMP_SKEWPresented PAX-TIMESTAMP is more than 300 seconds off the server clock. Sync via NTP and resend.
401NONCE_REUSEDPresented PAX-NONCE reused within its 600s TTL. Generate a fresh random nonce per request.
401SIGNATURE_INVALIDHMAC signature does not match the request. Recompute over timestamp\nnonce\nmethod\npath\nbody with your sk_live_… secret — see Auth → HMAC.
401TOKEN_EXPIREDOAuth access token expired
401TOKEN_REVOKEDOAuth access token revoked
401TOKEN_INVALIDOAuth access token could not be verified
400PKCE_INVALIDPKCE code_verifier did not match code_challenge
400AUTH_CODE_EXPIREDOAuth authorization code has expired
400AUTH_CODE_CONSUMEDOAuth authorization code has already been used
400REDIRECT_URI_MISMATCHredirect_uri does not match the value bound at authorize time
401REFRESH_TOKEN_REUSEDRefresh token reuse detected — token family revoked

403 — authorization

HTTPCodeDescription
403SCOPE_MISSINGRequired scope not present on credential
403WS_TOKEN_UNSUPPORTEDPOST /v1/ws/token: this credential is not bound to an API account
403ACCOUNT_SESSION_REQUIREDAccount actions (password change, signing out other sessions, 2FA, team, payout wallets and settings, withdrawals) need a signed-in Builder Portal session; API keys and third-party app tokens cannot perform them
403SCOPE_NOT_ALLOWEDRequested scope is not in the app allowed_scopes list
403STEP_UP_MFA_REQUIREDHigh-friction scope requires step-up MFA verification. When present, details.step_up names the factor to send: password (current_password) or totp (the 2FA code)
403STEP_UP_INVALIDThe 2FA code, recovery code or account password sent for a step-up was wrong or already used
403BUILDER_NOT_APPROVEDBuilder identity is not in approved status
403APP_NOT_APPROVEDApp is not in approved status
403APP_DISABLEDApp has been disabled by owner or admin
403ACCOUNT_MISMATCHuser_id must be omitted or equal the authenticated account
403DELEGATION_MISSINGon_behalf_of names an account that has no live (unrevoked, unexpired) approval for you: a trading-agent approval, or the user's app connection (pxu_...)
403JURISDICTION_BLOCKEDThis action is not permitted in this jurisdiction
403SANCTIONS_HITWallet address matches a sanctions list; registration or payout blocked
404SANDBOX_ONLYEndpoint only available in sandbox environment
404PROD_ONLYEndpoint disabled in sandbox environment

404

HTTPCodeDescription
404NOT_FOUNDResource not found (generic — route or record not present)
404MARKET_NOT_FOUNDMarket ID does not exist (specific — surfaces inside handlers that need a valid market before proceeding, e.g. subaccount transfer, MM quote creation, RFQ)

409 — conflict

HTTPCodeDescription
409ALREADY_EXISTSResource with that identifier already exists
409CONFLICTUniqueness constraint hit (e.g. same address registered on the same currency+network)
409STATE_CONFLICTRequested transition not valid from current state
409IDEMPOTENCY_IN_FLIGHTA prior request with the same key is still processing

422 — semantic

HTTPCodeDescription
422RISK_LIMIT_BREACHOrder would breach a configured risk limit
422BUILDER_FEE_ABOVE_CAPRequested builder_fee_bps exceeds apps.builder_fee_cap_bps
422MARKET_HALTEDMarket currently halted by circuit breaker
422MARKET_CLOSEDMarket is past close time
422PRICE_ALERT_LIMITThe builder account already has 100 active price alerts (POST /v1/price-alerts); cancel one first. See Price Alerts
422MARKET_NOT_APPROVEDreserved · not emitted. Legacy proposal-approval code. Markets are now created directly at status: open via POST /v1/composer/markets with no approval step, so no current path returns this.
422MARKET_TEMPLATE_UNKNOWNTemplate id not found
422MARKET_TEMPLATE_PARAM_INVALIDTemplate param failed validation
422ORACLE_ADAPTER_UNKNOWNOracle adapter not registered
422ORACLE_DISAGREEMENTOracle adapters disagreed beyond max deviation
422RESOLUTION_LOCKEDResolution challenge window still open
422DISPUTE_ALREADY_OPENA dispute is already open on this market
422ANTI_ABUSE_BLOCKEDTrade flagged by anti-abuse rules (wash/self/related-party)
422OPERATOR_AGREEMENT_MISSINGreserved · not emitted. Defined in the error catalog but returned by no current action — PredictAsiaX gates no action behind a signed operator agreement.

429

HTTPCodeDescription
429RATE_LIMITEDRate limit exceeded, retry after Retry-After. A request refused by a per-key limit is not counted; for a batch, details.cost is its item count. See Rate limits.
429TIER_LIMIT_EXCEEDEDOrder or daily notional exceeds api_key tier caps
403TIER_UPGRADE_REQUIREDThis endpoint requires a higher trust tier
429SANDBOX_KEY_DAILY_LIMITThis IP has already minted a sandbox key today
401PASSWORD_INCORRECTCurrent password does not match
422PASSWORD_TOO_WEAKNew password does not meet strength requirements
410SIGNIN_LINK_INVALIDBuilder Portal sign-in link is invalid, expired, revoked or already used. Ask the PredictAsiaX team for a new link.
410GRANTS_RETIREDBuilder grants are retired (2026-12-02). Builder PAX is paid by the weekly rewards: GET /v1/builders/me/points.

webhook subsystem

HTTPCodeDescription
400WEBHOOK_URL_INVALIDWebhook URL must be a valid https URL with no userinfo/fragment (thrown by PAX on POST /v1/webhooks, and on PATCH /v1/webhooks/{id} with {"active": true} when re-enabling)
400WEBHOOK_SECRET_INVALIDreceiver-side. Recommended code for your webhook receiver to return when it cannot decode the signing secret. Not emitted by PAX; PAX emits WEBHOOK_URL_INVALID at register time.
401WEBHOOK_TIMESTAMP_SKEWreceiver-side. Recommended code for your receiver to return when the t= value in X-PAX-Signature is outside your tolerance window. Not emitted by PAX.
401WEBHOOK_SIGNATURE_INVALIDreceiver-side. Recommended code for your receiver to return when neither v1= HMAC matches the body. See /webhook-signing.
422WEBHOOK_EVENT_UNKNOWNWebhook event_type not present in canonical catalog (thrown by PAX on POST /v1/webhooks and PATCH /v1/webhooks/{id})

subaccounts / delegation

HTTPCodeDescription
404SLOT_NOT_FOUNDsubaccount_slot names a slot that does not exist; create it with POST /v1/subaccounts. Sandbox keys have only slot 0. A slot that is not an integer 0–63 is 400 VALIDATION_FAILED
403SUBACCOUNTS_BUILDER_ONLYSubaccounts are available to builder accounts
409SUBACCOUNT_NOT_EMPTYA subaccount with a balance, open orders or open positions cannot be deleted; empty it first
409INSUFFICIENT_BALANCEThe source slot of a subaccount transfer does not hold the amount
202pending: trueNot an error: a subaccount transfer was interrupted between its two legs and completes automatically
403DELEGATION_SCOPE_MISMATCHThe trading-agent approval does not cover this request: scope (e.g. close_only and a BUY), slot, market, or per-order max_notional_usdt
422DELEGATION_DAILY_CAP_EXCEEDEDThe order would take the approval past its rolling-24h daily_notional_cap
403APPROVAL_INVALID / APPROVAL_EXPIREDApproving a trading agent: the request did not come from your Builder Portal session with a fresh 2FA code; approve it in the portal
409LIMIT_REACHED10 live trading agents already; revoke one first
400INVALID_FIELDApproving a trading agent: delegatee_id is not a live builder account
503SERVICE_UNAVAILABLEApproving a trading agent: the agent account could not be verified; retry shortly
400VALIDATION_FAILEDApproving a trading agent: the body has a field this endpoint does not take; details.unknown_fields names it (for example per_order_cap instead of max_notional_usdt). Nothing is created and the 2FA code is not used up

builder fee

HTTPCodeDescription
403BUILDER_FEE_NOT_APPROVEDOrder placed for another account (on_behalf_of) by a builder that charges a builder fee, and that account has not approved the builder's fee (POST /v1/builder-fee-approvals). The message names the rate. Nothing was placed
403BUILDER_FEE_EXCEEDS_APPROVALThe builder's current rate is above the maximum the account approved. Nothing was placed; the account can raise its approval
503BUILDER_FEE_UNAVAILABLEThe builder's rate or the account's approval could not be read. The order is refused rather than placed with an unverified fee; retry shortly
409RATE_CHANGE_PENDINGPUT /v1/builders/me/fee while a change is pending; details.pending_effective_at. Cancel it with DELETE /v1/builders/me/fee/pending or wait
429RATE_CHANGE_COOLDOWNThe rate can change at most once every 7 days; details.next_change_allowed_at
403BUILDER_NOT_ELIGIBLESetting a rate: only live (non-sandbox) builders can charge a builder fee. Approving (404): unknown or inactive builder
409APPROVAL_LIMIT10 live builder fee approvals already; revoke one first
404NOT_FOUNDNo pending rate change to cancel, or no live approval for that builder to revoke

composer

HTTPCodeDescription
400TEMPLATE_SCHEMA_INVALIDTemplate params_schema is malformed
400TEMPLATE_DISPLAY_KEY_MISSINGdisplay_defaults references a key not in params_schema
409PROPOSAL_STATE_INVALIDProposal state transition not valid
422COMBO_COMPONENT_HALTEDCombo derived market has a halted component
403COMPLIANCE_GATE_BLOCKEDCompliance gate blocked market creation

liquidity/RFQ

HTTPCodeDescription
400QUOTE_EXPIRED_IN_PASTQuote expires_at_ms must be in the future
400QUOTE_SIZE_INVALIDQuote size is invalid (must be > 0)
409RFQ_NOT_OPENRFQ is not open for new quotes
422RFQ_QUOTE_OUT_OF_BOUNDSRFQ quote price outside min/max bounds
400QUOTE_SIZE_MISMATCHQuotes are for the full RFQ size
409QUOTE_NOT_LIVEQuote is no longer live (expired, withdrawn, replaced, failed or filled)
409QUOTE_EXECUTINGThe requester accepted this quote; it is being executed
409RFQ_EXECUTINGA quote on this RFQ is being executed; retry shortly
422RFQ_QUOTE_FAILEDThe accepted quote could not be executed; nothing moved and the RFQ is open again
422SELF_TRADEYou cannot trade against your own account
409INSUFFICIENT_BALANCEBlock trade proposal or acceptance, or RFQ quote: your account's free USDT is below the cash your own leg needs (buyer: price x size; seller backing with USDT: (1 - price) x size; fees not included). Only your own leg is checked; nothing is reserved, and the engine checks both legs again at execution
409INSUFFICIENT_POSITIONSame, for a leg that sells shares: your account holds fewer sellable shares than the leg's size
503BACKING_CHECK_UNAVAILABLEYour balance or holdings could not be checked; retry
503RFQ_UNAVAILABLEBlock trades are temporarily unavailable
422INCENTIVE_BUDGET_EXCEEDEDIncentive budget for this period is exhausted

widget / data / MCP

HTTPCodeDescription
404MCP_TOOL_UNKNOWNreserved · MCP subsystem. MCP tool name not registered
403MCP_SCOPE_MISSINGreserved · MCP subsystem. MCP tool call missing required scope
501MCP_NOT_IMPLEMENTEDreserved · MCP subsystem. MCP tool has no upstream implementation yet
403WIDGET_ORIGIN_BLOCKEDWidget embed origin is blocked
403DATA_TIER_EXCEEDEDData query exceeds allowed tier
422DATA_RANGE_TOO_LARGE_FOR_TIERRequested range exceeds tier maximum

oracle / resolution

HTTPCodeDescription
502ORACLE_ADAPTER_ERROROracle adapter fetch failed
403ORACLE_BOND_INSUFFICIENTOracle provider PAX bond below configured minimum
422RESOLUTION_EVIDENCE_MISSINGResolution requires evidence and none was attached
409RESOLUTION_CHALLENGE_OPENCannot finalize while a challenge window is open

marketplace

HTTPCodeDescription
403LISTING_NOT_APPROVEDMarketplace listing has not been approved
403DISPUTE_REQUIRES_POSITIONOnly an account holding a position in the market can challenge its oracle verdict
403USE_API_GATEWAYAPI keys are accepted only at https://api.predictasiax.com/v1; calls to any other host are refused
409BOUNTY_ALREADY_CLAIMEDBounty has already been claimed

500 — / 502 / 503 / 504

HTTPCodeDescription
500INTERNAL_ERRORAn internal error occurred
502UPSTREAM_ERRORUpstream service returned an error
504UPSTREAM_TIMEOUTUpstream service timeout
503SERVICE_UNAVAILABLENamed subsystem is currently gated off (e.g. payouts kill-switch on for a scope), with a human-readable reason in the message
503SERVICE_UNAVAILABLEPlacing or cancelling an order: the result is not known yet. The order may or may not have been placed: send it again with the same client_order_id. It is never placed twice, and if the first one was placed, the reply is that order with duplicate: true. Check a cancel with GET /v1/orders/{id}.
503MAINTENANCEService temporarily in maintenance
503SANCTIONS_SCREEN_UNAVAILABLESanctions screening could not complete, so the wallet address was not accepted; retry later

Canonical source

This table is generated from packages/core/src/errors.ts. To propose a new code, PR that file; do not edit this HTML directly. See OpenAPI spec for which codes each endpoint can return.