Skip to main content

Error Codes

All API errors follow a consistent format. REST responses use HTTP status codes along with structured error bodies. gRPC responses include error_code and error_message fields.

Error Response Format

{
"success": false,
"error": {
"code": "MARKET_NOT_FOUND",
"message": "Market with id abc-123 not found",
"details": {}
}
}

Market Errors

CodeHTTP StatusDescription
MARKET_NOT_FOUND404Market with the given ID does not exist
MARKET_NOT_OPEN400Market is not in OPEN status — trading is not allowed
MARKET_ALREADY_RESOLVED409Market has already been resolved
MARKET_INVALID_STATUS_TRANSITION400Invalid status change (e.g., trying to open an already closed market)
VALIDATION_ERROR400Currency is not in the operator's supportedCurrencies list

Order Errors

CodeHTTP StatusDescription
ORDER_NOT_FOUND404Order with the given ID does not exist
ORDER_INVALID_PRICE400Price is outside the allowed range (0.01–0.99)
ORDER_INVALID_SHARES400Shares count is outside the allowed range (1–100,000)
ORDER_INSUFFICIENT_FUNDS400Insufficient funds to place the order
ORDER_CANNOT_CANCEL400Order is not in a cancellable status (must be PENDING or PARTIAL)
ORDER_NO_LIQUIDITY400No matching orders available for a market order

Position Errors

CodeHTTP StatusDescription
POSITION_NOT_FOUND404Position does not exist
POSITION_INSUFFICIENT_SHARES400Operator does not hold enough shares to sell

Category Errors

CodeHTTP StatusDescription
CATEGORY_NOT_FOUND404Category with the given ID does not exist
CATEGORY_DUPLICATE_SLUG409A category with this slug already exists for the operator

Settlement Errors

CodeHTTP StatusDescription
SETTLEMENT_FAILED500Settlement processing encountered an error
SETTLEMENT_ALREADY_COMPLETED409Settlement has already been completed

Authentication Errors

CodeHTTP StatusDescription
UNAUTHORIZED401Missing or invalid authentication credentials

General Errors

CodeHTTP StatusDescription
VALIDATION_ERROR400Request body validation failed — check the error message for details
INTERNAL_ERROR500An unexpected internal error occurred
NOT_FOUND404The requested resource was not found
FORBIDDEN403You do not have permission to perform this action
CONFLICT409The request conflicts with the current state of the resource

Order Validation Errors

These errors are returned when placing an order fails validation:

Error MessageDescription
Market not foundThe specified marketId does not exist
Market is not open for tradingMarket status is not OPEN
Trading has not started yetCurrent time is before tradingStartsAt
Trading has endedCurrent time is after tradingEndsAt
Invalid outcome for this marketThe outcomeId does not belong to the market
Shares must be greater than 0Shares value is zero or negative
Shares must be at least {min}Below minimum share count
Shares must be at most {max}Above maximum share count
Price is required for LIMIT ordersLIMIT order missing price field
Price must be between {min} and {max}Price outside allowed range
Insufficient shares to sellSELL order exceeds operator's position

HTTP Status Code Summary

StatusUsage
200Successful retrieval or update
201Successful creation (markets, orders, categories)
400Validation error or bad request
401Authentication required
403Insufficient permissions
404Resource not found
409State conflict
500Internal server error