Skip to main content

Errors & Status Codes

Overview

All errors follow the Problem+JSON format.

Error Response Format

{
  "error": "Missing required parameter",
  "message": "Either polymarket_market_slug or kalshi_market_ticker is required"
}
Note: Some endpoints may use the Problem+JSON format (RFC 7807) with type, title, status, detail, and instance fields.

HTTP Status Codes

StatusMeaningCommon Causes
400Bad RequestInvalid parameters, malformed JSON
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions
404Not FoundResource doesn’t exist
409ConflictResource state conflict
422Unprocessable EntityInvalid request data (semantically incorrect)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer-side error
502Bad GatewayUpstream service error
503Service UnavailableTemporary service disruption

Common Errors

400 Bad Request

Causes:
  • Missing required parameters
  • Invalid parameter values
  • Malformed JSON in request body
Remediation:
  • Check API documentation for required parameters
  • Validate parameter types and formats
  • Verify JSON syntax

401 Unauthorized

Causes:
  • Missing x-api-key header
  • Invalid API key
  • Expired API key
Remediation:
  • Include x-api-key: YOUR_API_KEY header in all requests
  • Verify API key is correct
  • Request new API key if expired (contact team@predexon.com)

403 Forbidden

Causes:
  • API key lacks required permissions
  • Account suspended
Remediation:
  • Check account permissions
  • Contact support for access issues

404 Not Found

Causes:
  • Invalid market slug or ticker (e.g., polymarket_market_slug, kalshi_market_ticker)
  • Invalid token ID or condition ID
  • Resource has been deleted or market is no longer available
  • Incorrect endpoint URL
Remediation:
  • Verify market identifiers (slugs, tickers) are correct
  • Check if market still exists on the source platform
  • Confirm endpoint URL is correct (base URL: https://api.predexon.com/v1)

422 Unprocessable Entity

Causes:
  • Incompatible parameter combinations (e.g., both polymarket_market_slug and kalshi_market_ticker provided)
  • Invalid confidence threshold values
  • Time range validation failures (start_time >= end_time)
  • Business logic validation failure
Remediation:
  • Review parameter constraints in endpoint documentation
  • Ensure only one of mutually exclusive parameters is provided
  • Check example requests in documentation
  • Verify time ranges are valid (start_time < end_time)

429 Too Many Requests

Causes:
  • Exceeded rate limit (100 requests/minute per API key)
Remediation:
  • Implement exponential backoff
  • Reduce request frequency
  • Use batch endpoints when available (e.g., /matching-markets/batch)
  • Consider caching responses
  • Contact team@predexon.com for higher rate limits

500/502/503 Server Errors

Causes:
  • Temporary service issues
  • Upstream dependencies unavailable
Remediation:
  • Retry with exponential backoff
  • Check status page
  • Contact support if persistent

Error Handling Best Practices

  1. Parse error response: Always read the detail field for specific error information
  2. Implement retries: Use exponential backoff for 429, 500, 502, 503 errors
  3. Log errors: Include instance field for debugging
  4. Validate before sending: Client-side validation reduces 400/422 errors