Error Response Format
When an API request fails, Kordless returns a JSON error response with a consistent structure:Error Response Fields
A human-readable description of the error. Use this for debugging and logging.
The HTTP status code (400, 401, 403, 404, 429, 500, etc.)
A machine-readable error type for programmatic handling.
HTTP Status Codes
Kordless uses standard HTTP status codes to indicate success or failure:2xx Success
200 OK
200 OK
Meaning: Request succeededResponse: Contains the requested data
201 Created
201 Created
Meaning: Resource successfully createdResponse: Contains the newly created resource
204 No Content
204 No Content
Meaning: Request succeeded with no response bodyUse case: DELETE requests, successful updates with no data to return
4xx Client Errors
400 Bad Request
400 Bad Request
Meaning: The request is malformed or contains invalid dataCommon causes:How to fix:
- Missing required fields
- Invalid field values
- Malformed JSON
- Check request body against API documentation
- Validate all required fields are present
- Ensure correct data types
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
Meaning: Authentication succeeded but you lack permissionCommon causes:How to fix:
- Wrong organization ID
- Accessing resources from another organization
- Insufficient permissions
- Verify
x-organization-idheader is correct - Ensure you’re accessing your own organization’s resources
- Check API key permissions
404 Not Found
404 Not Found
Meaning: The requested resource doesn’t existCommon causes:How to fix:
- Invalid resource ID
- Resource was deleted
- Wrong endpoint URL
- Verify the resource ID is correct
- Check the endpoint URL
- Ensure the resource exists in your organization
409 Conflict
409 Conflict
Meaning: The request conflicts with current stateCommon causes:How to fix:
- Time slot already booked
- Overlapping bookings
- Resource state conflict
- Query fresh availability
- Choose a different time slot
- Resolve the conflict before retrying
422 Unprocessable Entity
422 Unprocessable Entity
Meaning: Request is well-formed but semantically invalidCommon causes:How to fix:
- Business logic validation failed
- Invalid time range
- Rule violations
- Read the error message carefully
- Adjust request to meet business rules
- Validate data before sending
429 Too Many Requests
429 Too Many Requests
Meaning: Rate limit exceededCommon causes:How to fix:
- Too many requests in short time
- Exceeded per-minute/hour/day limits
- Implement exponential backoff
- Respect rate limit headers
- Cache responses when possible
- Contact us for higher limits
5xx Server Errors
500 Internal Server Error
500 Internal Server Error
Meaning: An unexpected error occurred on our serversWhat to do:
- Retry the request after a delay
- Check our status page
- Contact support if persistent
503 Service Unavailable
503 Service Unavailable
Rate Limiting
API requests are rate limited to ensure fair usage and system stability.Rate Limit Headers
Every response includes rate limit information:Maximum requests allowed in the current window
Number of requests remaining in current window
Unix timestamp when the rate limit resets
Default Limits
- 100 requests per minute per API key
- 1,000 requests per hour per API key
- 10,000 requests per day per organization
Handling Rate Limits
Error Handling Best Practices
1. Always Check Status Codes
1. Always Check Status Codes
Don’t assume success. Always check the HTTP status code:
2. Implement Retry Logic
2. Implement Retry Logic
Retry on transient errors (500, 503, 429) with exponential backoff:
3. Log Errors Properly
3. Log Errors Properly
Log errors with context for debugging:
4. Handle Specific Error Types
4. Handle Specific Error Types
Handle different error types appropriately:
5. Use Idempotency Keys
5. Use Idempotency Keys
Prevent duplicate operations when retrying:
6. Respect Rate Limits
6. Respect Rate Limits
Monitor rate limit headers and throttle requests:
Common Error Scenarios
Scenario 1: Time Slot No Longer Available
Error:Scenario 2: Invalid Organization ID
Error:Scenario 3: Rate Limit Exceeded
Error:Testing Error Handling
Test your error handling with these scenarios:1
Test Invalid API Key
2
Test Missing Required Field
3
Test Rate Limiting
Make 101 requests rapidly to trigger rate limit.Expected: 429 Too Many Requests on 101st request

