Errors & Status Codes
Overview
All errors follow the Problem+JSON format.Error Response Format
type, title, status, detail, and instance fields.
HTTP Status Codes
| Status | Meaning | Common Causes |
|---|---|---|
| 400 | Bad Request | Invalid parameters, malformed JSON |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient permissions |
| 404 | Not Found | Resource doesn’t exist |
| 409 | Conflict | Resource state conflict |
| 422 | Unprocessable Entity | Invalid request data (semantically incorrect) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server-side error |
| 502 | Bad Gateway | Upstream service error |
| 503 | Service Unavailable | Temporary service disruption |
Common Errors
400 Bad Request
Causes:- Missing required parameters
- Invalid parameter values
- Malformed JSON in request body
- Check API documentation for required parameters
- Validate parameter types and formats
- Verify JSON syntax
401 Unauthorized
Causes:- Missing
x-api-keyheader - Invalid API key
- Expired API key
- Include
x-api-key: YOUR_API_KEYheader 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
- 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
- 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_slugandkalshi_market_tickerprovided) - Invalid confidence threshold values
- Time range validation failures (
start_time >= end_time) - Business logic validation failure
- 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)
- 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
- Retry with exponential backoff
- Check status page
- Contact support if persistent
Error Handling Best Practices
- Parse error response: Always read the
detailfield for specific error information - Implement retries: Use exponential backoff for 429, 500, 502, 503 errors
- Log errors: Include
instancefield for debugging - Validate before sending: Client-side validation reduces 400/422 errors
