Skip to content

Error Codes

Reference for all error codes returned by the Events API.

Error Response Format

All errors follow this structure:

json
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable description",
    "details": {}
  }
}

HTTP Status Codes

StatusMeaning
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limited
500Internal Server Error
503Service Unavailable - Maintenance

Error Codes

INVALID_PARAMETER

json
{
  "error": {
    "code": "INVALID_PARAMETER",
    "message": "Invalid value for parameter 'types'",
    "details": {
      "parameter": "types",
      "value": "INVALID_TYPE",
      "allowed": ["FORM_4", "FILING_8K", "FILING_10K", "FILING_10Q", "NEWS"]
    }
  }
}

Cause: A query parameter has an invalid value. Fix: Check the allowed values in the API reference.

INVALID_DATE_RANGE

json
{
  "error": {
    "code": "INVALID_DATE_RANGE",
    "message": "End date must be after start date",
    "details": {
      "start": "2025-01-15T00:00:00Z",
      "end": "2025-01-01T00:00:00Z"
    }
  }
}

Cause: The end parameter is before start. Fix: Ensure end date is chronologically after start date.

UNAUTHORIZED

json
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired API key"
  }
}

Cause: Missing, invalid, or expired API key. Fix: Include a valid Authorization: Bearer <key> header.

RATE_LIMIT_EXCEEDED

json
{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded",
    "details": {
      "limit": 100,
      "window": "1 minute",
      "retryAfter": 45
    }
  }
}

Cause: Too many requests in the time window. Fix: Wait retryAfter seconds before retrying. Implement exponential backoff.

CONNECTION_LIMIT_EXCEEDED

json
{
  "error": {
    "code": "CONNECTION_LIMIT_EXCEEDED",
    "message": "Maximum concurrent SSE connections exceeded",
    "details": {
      "limit": 5,
      "current": 5
    }
  }
}

Cause: Too many concurrent SSE connections from your IP. Fix: Close unused connections before opening new ones.

INTERNAL_ERROR

json
{
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "An unexpected error occurred",
    "details": {
      "requestId": "req-abc123"
    }
  }
}

Cause: Server-side error. Fix: Retry with exponential backoff. Contact support if persistent, include requestId.

SERVICE_UNAVAILABLE

json
{
  "error": {
    "code": "SERVICE_UNAVAILABLE",
    "message": "Service temporarily unavailable for maintenance",
    "details": {
      "estimatedDowntime": "15 minutes"
    }
  }
}

Cause: Planned maintenance or capacity issues. Fix: Wait and retry. Check status page for updates.

SSE Connection Errors

For SSE streams, errors appear as events:

event: error
data: {"error":{"code":"CONNECTION_LIMIT_EXCEEDED","message":"..."}}

Handle in your client:

javascript
source.addEventListener('error', (e) => {
  if (e.data) {
    const error = JSON.parse(e.data);
    console.error('Stream error:', error.error.code);
  }
});

Best Practices

  1. Always check HTTP status before parsing response body
  2. Log the requestId for internal errors to help debugging
  3. Implement retry logic with exponential backoff
  4. Monitor rate limit headers to avoid hitting limits
  5. Handle all error codes gracefully in your application

Built for traders who value data provenance.