OpenPoly logo
Operator Api

Error codes

Common error codes returned by the operator-facing API surface.

Error codes

Operator routes use the standard H3/Nitro error envelope. Clients should branch on HTTP status and statusMessage; message is human-readable context and may equal the code.

{
  "statusCode": 403,
  "statusMessage": "INSUFFICIENT_SCOPE",
  "message": "INSUFFICIENT_SCOPE"
}

Authentication

  • UNAUTHORIZED -> missing or malformed bearer header
  • INVALID_API_KEY -> wrong, revoked, or inactive-operator API key
  • INVALID_OPERATOR_SESSION -> expired or revoked staff session
  • INSUFFICIENT_SCOPE -> active API key or staff session lacks the required scope
  • STAFF_SESSION_REQUIRED -> staff management, private market request, or support route called with an API key; wildcard scope does not bypass the restriction

Resource and input

  • INVALID_NAME
  • INVALID_LAUNCH_PARAMETERS
  • INVALID_EXTERNAL_USER_ID
  • INVALID_SCOPES
  • INVALID_ID
  • INVALID_MARKET
  • INVALID_MARKET_ID
  • INVALID_TRADE_ID
  • INVALID_AMOUNT
  • INVALID_CATEGORY
  • INVALID_VISIBILITY
  • INVALID_DELIVERY_ID
  • NOT_FOUND
  • INVALID_URL
  • INVALID_OPERATOR_HOST
  • INVALID_ENABLED_EVENTS
  • INVALID_STATUS
  • INVALID_ENDPOINT_ID
  • INVALID_DIRECTION
  • INVALID_AMOUNT_MINOR
  • INVALID_IDEMPOTENCY_KEY
  • INVALID_USER_ID
  • INVALID_STAFF_ID
  • INVALID_INPUT
  • INVALID_EMAIL
  • FULL_CONTRACT_CONFIRMATION_REQUIRED
  • OPERATOR_USER_NOT_FOUND
  • TRADE_NOT_FOUND
  • MARKET_NOT_FOUND
  • WEBHOOK_ENDPOINT_NOT_FOUND
  • WEBHOOK_DELIVERY_NOT_FOUND
  • STAFF_NOT_FOUND
  • USER_NOT_FOUND
  • OPERATOR_USER_CREATE_FAILED
  • API_KEY_CREATE_FAILED
  • WEBHOOK_ENDPOINT_CREATE_FAILED
  • WEBHOOK_ENDPOINT_UPDATE_FAILED
  • SIMULATOR_USER_CREATE_FAILED
  • SIMULATOR_USER_UPDATE_FAILED
  • FX_RATE_UNAVAILABLE
  • FX_RATE_INVALID

The query helpers also return field-specific codes such as INVALID_SORT, INVALID_TYPE, INVALID_CREATED_FROM, INVALID_CREATED_TO, INVALID_ACTIVITY_FROM_DATE, and INVALID_ACTIVITY_TO_DATE. HTML Portfolio controls add INVALID_PRODUCT, INVALID_TAB, INVALID_LOCALE, and INVALID_TICKET_PAGE / INVALID_TICKET_PAGE_SIZE. Consult each endpoint for strict versus defaulting pagination.

409 MARKET_OUTSIDE_RESOLUTION_HORIZON means a market cannot be shown under the operator's current maximum-duration setting; hiding it remains allowed. Other-operator private markets return not-found rather than allowing visibility rules to grant access.

Opinion sell policy

PARTIAL_SHARE_SELL_DISABLED means an unexecuted sell does not match the user's entire current holding in the selected outcome while Polynion Admin has disabled partial selling. It may appear as a quote rejection or an order failure reason. Refresh the holding and obtain a new full-position quote; do not automatically increase an existing order or retry it with a new amount.

Market PnL and cash-flow triage

HTTP statusCodeMeaning/action
400OPERATOR_SELECTOR_NOT_ALLOWEDOmit operatorId / operator_id; authentication determines the operator.
400INVALID_RESOLVED_FROM_DATE, INVALID_RESOLVED_TO_DATE, INVALID_RESOLVED_DATE_RANGEUse valid calendar dates in ascending order.
400INVALID_MARKET_ID, INVALID_SOURCE_ID, INVALID_TRIAGE_SOURCE, INVALID_KIND, INVALID_ISSUE_STATECorrect the exact market/source selector or issue-state filter.
404CASH_ISSUE_NOT_FOUNDNo readable source matches the detail path.
403INSUFFICIENT_SCOPEPnL requires both trade/redemption read scopes; triage additionally requires balance-operation read.

Triage is read-only. A failed or unknown operation is not permission to repeat a payment with a fresh idempotency key.

Private market requests

  • 400 INVALID_MARKET_REQUEST: request/query schema, unknown field, operator selector, dates, horizon, or pagination is invalid.
  • 400 INVALID_CATEGORY / INVALID_TAGS: selected taxonomy is invalid or inactive.
  • 404 MARKET_REQUEST_NOT_FOUND: request does not exist for the authenticated operator.
  • 409 OPERATOR_NOT_ACTIVE: operator is no longer active.
  • 500 MARKET_REQUEST_UNAVAILABLE: request operation failed; inspect existing requests before repeating a create after an ambiguous result.

Private-market review can also reject stale dates (MARKET_REQUEST_DATES_EXPIRED) or an already-reviewed request (MARKET_REQUEST_ALREADY_REVIEWED); operator routes do not expose an approve/reject mutation.

Operator support

  • 400 INVALID_INPUT: invalid list/body/ID, unknown field, or attempted operator selector.
  • 404 TICKET_NOT_FOUND: missing/inaccessible ticket or ineligible mutation actor.
  • 409 TICKET_CLOSED: reopen before sending a reply.

Support requires a staff session but no additional resource scope.

Opinion settlement reports

HTTP statusCodeAction
400INVALID_REPORT_MONTHUse strict YYYY-MM in years 2000..2100.
400INVALID_REPORT_PREVIEW, INVALID_REPORT_FORMATUse preview=true/false on read or a supported export format.
400REPORT_MONTH_NOT_COMPLETEUse a completed month; only the read route can preview the current month. Future months remain invalid.
400OPERATOR_SELECTOR_NOT_ALLOWEDRemove the operator selector.
404MINI_APP_OPERATOR_NOT_FOUNDOperator no longer exists in the report context.
409REPORT_MONTH_NOT_COMPLETEExport completeness guard found an incomplete period.
409SETTLEMENT_FEE_SNAPSHOT_INCOMPLETEHistorical fee evidence must be reconciled before export.
409SETTLEMENT_PAYOUT_RECONCILIATION_INCOMPLETEReconcile payout cash evidence before export.
409SETTLEMENT_UNDERWRITING_ATTRIBUTION_INCOMPLETERequired v3 public/private attribution is incomplete/invalid.
422INVALID_OPERATOR_TIMEZONEAsk an authorized administrator to correct the operator timezone; do not substitute UTC client-side.

Polyflight

  • INVALID_PRODUCT
  • PRODUCT_DISABLED
  • POLYFLIGHT_REQUIRES_IDR
  • INVALID_FLIGHT_ID
  • INVALID_TICKETID
  • INVALID_OPERATIONID
  • INVALID_ID
  • POLYFLIGHT_FLIGHT_NOT_FOUND
  • POLYFLIGHT_TICKET_NOT_FOUND
  • POLYFLIGHT_OPERATION_NOT_FOUND
  • POLYFLIGHT_TERMS_NOT_FOUND
  • POLYFLIGHT_STATEMENT_NOT_FOUND
  • INVALID_CONTRACT_TEST_SCENARIO
  • DEDICATED_TEST_USER_CONFIRMATION_REQUIRED
  • UNSAFE_POLYFLIGHT_CONTRACT_TEST_AMOUNT

Polyflight not-found responses also protect tenant isolation: do not infer that an identifier belongs to another operator. PRODUCT_DISABLED means the selected product is not enabled; launch does not fall back to Opinion. POLYFLIGHT_REQUIRES_IDR means the operator currency is incompatible with a Polyflight launch. A flight with no committed comparison valuation is shown as temporarily unavailable for IDR entry; it does not fall back to Opinion FX.

Simulator

  • SIMULATOR_DISABLED
  • SIMULATOR_USER_NOT_FOUND

Wallet adapter

  • REST_V1_UNSUPPORTED_CURRENCY
  • INVALID_BASE_URL
  • INVALID_FIELD
  • BEARER_TOKEN_REQUIRED
  • INVALID_WALLET_ADAPTER_CONFIG
  • WALLET_ADAPTER_ENCRYPTION_NOT_CONFIGURED
  • WALLET_ADAPTER_UPDATE_FAILED

REST_V1_MUTATION_IDENTITY_MISMATCH can appear as wallet processing failure context when a non-null echoed external user, idempotency key, currency, or amount contradicts the original mutation. This is an ambiguous/unknown wallet result, not proof that the wallet rejected or rolled back the payment. Reconcile the original operation and key; never retry it as a new-key payment. It is not necessarily a top-level Operator API error envelope.

Staff auth

  • INVALID_OPERATOR_SESSION
  • PASSWORD_CHANGE_NOT_SUPPORTED
  • RATE_LIMIT_EXCEEDED
  • INVALID_CREDENTIALS
  • MULTIPLE_OPERATOR_MEMBERSHIPS_UNSUPPORTED

Staff management

  • INVALID_SCOPES
  • WILDCARD_SCOPE_NOT_ALLOWED
  • CANNOT_ASSIGN_SCOPE
  • SELF_ACCESS_UPDATE_FORBIDDEN
  • SELF_PASSWORD_RESET_FORBIDDEN
  • NO_UPDATES
  • EMAIL_EXISTS

Operator action

HTTP statusTypical codesOperator action
400INVALID_*, FULL_CONTRACT_CONFIRMATION_REQUIRED, NO_UPDATES, WILDCARD_SCOPE_NOT_ALLOWED, SELF_ACCESS_UPDATE_FORBIDDEN, SELF_PASSWORD_RESET_FORBIDDEN, PASSWORD_CHANGE_NOT_SUPPORTEDCorrect input or use the supported staff workflow. INVALID_CREDENTIALS also uses 400 on password change.
401UNAUTHORIZED, INVALID_API_KEY, INVALID_OPERATOR_SESSION, INVALID_CREDENTIALSReplace or refresh the credential; do not retry unchanged.
403INSUFFICIENT_SCOPE, STAFF_SESSION_REQUIRED, CANNOT_ASSIGN_SCOPE, PRODUCT_DISABLED, POLYFLIGHT_REQUIRES_IDRUse the required scope/auth type/configuration or ask authorized staff.
404NOT_FOUND, *_NOT_FOUND, SIMULATOR_DISABLEDConfirm ownership, environment, and identifier.
409EMAIL_EXISTS, MULTIPLE_OPERATOR_MEMBERSHIPS_UNSUPPORTED, TICKET_CLOSED, MARKET_OUTSIDE_RESOLUTION_HORIZON, SETTLEMENT_*_INCOMPLETEResolve the conflicting state/evidence; repeating the same input is not a remedy.
422INVALID_OPERATOR_TIMEZONEEscalate configuration; preserve operator-local accounting boundaries.
429RATE_LIMIT_EXCEEDEDWait for the login rate-limit window before retrying.
502FX_RATE_INVALIDRetry later; if persistent, escalate the operator FX configuration/runtime issue.
503FX_RATE_UNAVAILABLE on PortfolioRetry later or escalate persistent FX unavailability; do not substitute a fabricated rate. Native-IDR Polyflight HTML history can remain readable.
500*_FAILED, MARKET_REQUEST_UNAVAILABLEPreserve redacted request evidence and escalate; do not assume a mutation rolled back.

For every failure, confirm the endpoint's required scope, request schema, environment, and operator-owned resource before escalating.

Copyright © 2026