Error Response Format
All JobHive API errors follow a consistent JSON structure to help you handle them programmatically:HTTP Status Codes
JobHive uses standard HTTP status codes to indicate the success or failure of API requests:2xx Success Codes
2xx Success Codes
| Code | Description | When Used |
|---|---|---|
| 200 | OK | Successful GET, PATCH, DELETE requests |
| 201 | Created | Successful POST requests (interview creation) |
| 202 | Accepted | Asynchronous operations initiated |
| 204 | No Content | Successful DELETE with no response body |
4xx Client Error Codes
4xx Client Error Codes
| Code | Description | Common Causes |
|---|---|---|
| 400 | Bad Request | Invalid request parameters, malformed JSON |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient permissions for operation |
| 404 | Not Found | Interview ID doesn’t exist |
| 409 | Conflict | Resource already exists or state conflict |
| 422 | Unprocessable Entity | Valid JSON but business logic validation failed |
| 429 | Too Many Requests | Rate limit exceeded |
5xx Server Error Codes
5xx Server Error Codes
| Code | Description | Handling Strategy |
|---|---|---|
| 500 | Internal Server Error | Retry with exponential backoff |
| 502 | Bad Gateway | Temporary infrastructure issue, retry |
| 503 | Service Unavailable | Planned maintenance, check status page |
| 504 | Gateway Timeout | Request timeout, retry with longer timeout |
Common Error Types
Authentication Errors (401)
- Missing API Key
- Invalid API Key
- Expired API Key
Validation Errors (400/422)
- Missing Required Fields
- Invalid Field Values
Rate Limiting (429)
Resource Errors (404/409)
- Interview Not Found
- Invalid State Transition
Error Handling Patterns
Basic Error Handling
Retry Logic with Exponential Backoff
Circuit Breaker Pattern
Implement a circuit breaker to handle sustained failures gracefully:Error Recovery Strategies
Graceful Degradation
Fallback to Manual Process
Fallback to Manual Process
Queue for Later Processing
Queue for Later Processing
Error Monitoring and Alerting
Best Practices Summary
Proactive Error Handling
Implementation Checklist
- Validate input data before API calls
- Implement retry logic with exponential backoff
- Use circuit breakers for sustained failures
- Monitor error rates and patterns
User Experience
UX Considerations
- Provide clear error messages to users
- Implement graceful degradation
- Show loading states during retries
- Offer alternative actions when possible
Monitoring & Alerting
Observability Setup
- Log all errors with context
- Set up alerts for critical errors
- Track error trends over time
- Generate regular error reports
Recovery Strategies
Resilience Patterns
- Queue failed requests for retry
- Implement manual fallback processes
- Use multiple API keys for redundancy
- Plan for maintenance windows
Error Prevention: The best error handling strategy is preventing errors in the first place. Always validate input data, test thoroughly, and monitor your integration continuously.
