Overview
Robust error handling is critical for production integrations. This guide covers common error scenarios, retry strategies, and best practices for building resilient applications.Error Response Format
All Day Copilot API errors follow a consistent format:error: Error category (e.g., “Validation Error”, “Not Found”)message: Detailed explanationstatus: HTTP status codecorrelationId: Unique ID for support/debuggingdetails: Additional context (optional)
HTTP Status Codes
| Code | Meaning | Typical Cause | Action |
|---|---|---|---|
400 | Bad Request | Invalid parameters | Fix request format |
401 | Unauthorized | Missing/invalid token | Check authentication |
403 | Forbidden | Insufficient permissions | Check user access |
404 | Not Found | Resource doesn’t exist | Verify ID/check deletion |
409 | Conflict | Draft conflict | Refresh and retry |
422 | Unprocessable Entity | Validation failed | Fix validation errors |
429 | Too Many Requests | Rate limit exceeded | Implement backoff |
500 | Internal Server Error | Server issue | Retry with backoff |
503 | Service Unavailable | Maintenance/outage | Retry later |
Common Error Scenarios
1. Authentication Errors (401)
Cause: Invalid or expired token2. Validation Errors (422)
Cause: Request body doesn’t meet validation requirements3. Not Found Errors (404)
Cause: Resource doesn’t exist or user lacks access (RLS)4. Conflict Errors (409)
Cause: Draft conflict - another version was published5. Rate Limit Errors (429)
Cause: Too many requests in time window6. Server Errors (500, 503)
Cause: Temporary server issues or maintenanceRetry Strategies
Exponential Backoff
Circuit Breaker Pattern
Logging & Debugging
Using Correlation IDs
Error Monitoring
Best Practices
Always Include Error Context
Always Include Error Context
Log enough information to debug issues:
Implement Exponential Backoff
Implement Exponential Backoff
For transient errors (rate limits, server issues), use exponential backoff instead of immediate retries.
Distinguish Retriable vs Non-Retriable Errors
Distinguish Retriable vs Non-Retriable Errors
- Retriable: 429, 500, 503, network errors
- Non-retriable: 400, 401, 403, 404, 422
Use Circuit Breakers
Use Circuit Breakers
Implement circuit breakers to prevent cascading failures when the API is experiencing issues.
Store Correlation IDs
Store Correlation IDs
Always save correlation IDs from error responses. They’re essential for support tickets and debugging.
Graceful Degradation
Graceful Degradation
When API calls fail, provide fallback behavior: