Skip to main content

Error Response Format

All API errors follow a consistent JSON format:

Error Fields

statusCode (integer)
HTTP status code (400, 401, 403, 429, 500, etc.)
message (string)
Human-readable error description
error (string)
Error category/type
timestamp (string)
When the error occurred (ISO 8601 UTC)
path (string)
API endpoint that generated the error

HTTP Status Codes

400 Bad Request

Invalid request parameters or malformed request.
Common causes:
  • limit parameter outside 1-100 range
  • minImportance parameter outside 1-10 range
  • Invalid cursor format
  • Malformed query parameters
Solution:

401 Unauthorized

Missing or invalid API key.
Common causes:
  • Missing X-API-Key header
  • Invalid API key format (doesn’t start with byul_v2_)
  • Expired or revoked API key
Solution:

402 Payment Required

Plan expired or payment issue.
Solutions:
  • Update payment method in dashboard
  • Upgrade to a paid plan
  • Contact support for billing issues

403 Forbidden

Feature not available on current plan.
Solutions:
  • Upgrade to Pro or Enterprise plan
  • Check pricing page for feature availability

429 Too Many Requests

Rate limit exceeded.
Rate limits by plan:
  • Test: 30 requests/minute
  • Starter: 60 requests/minute
  • Pro/Enterprise: 120 requests/minute
Headers included:

500 Internal Server Error

Server-side error.
Solutions:
  • Check status page
  • Retry with exponential backoff
  • Contact support if persistent

Testing Error Scenarios

Test Authentication Errors

Test missing API key (401 error):
Test invalid API key (401 error):

Test Bad Request Errors

Test invalid limit parameter (400 error):
Test invalid importance score (400 error):

Test Rate Limits

Test rapid requests to trigger 429 error:

Check Rate Limit Headers

View current rate limit status:

Retry Logic

Exponential Backoff

Implement retry logic with exponential backoff for temporary failures:

Rate Limit Handling

Handle rate limits gracefully:

Error Handling Patterns

Comprehensive Error Handler

Circuit Breaker Pattern

Implement circuit breaker to handle persistent failures:

Monitoring and Alerting

Health Check Implementation

Request Logging

Error Recovery Strategies

Graceful Degradation

Data Caching