Documentation Index
Fetch the complete documentation index at: https://docs.fabius.io/llms.txt
Use this file to discover all available pages before exploring further.
Error Handling
The Fabius API uses standard HTTP status codes to indicate the success or failure of requests. Detailed error messages are included in the response body to help you troubleshoot issues.
HTTP Status Codes
| Status Code | Description |
|---|
200 OK | Request succeeded |
201 Created | Resource created successfully |
400 Bad Request | Invalid request parameters or body |
401 Unauthorized | Missing or invalid authentication |
404 Not Found | Resource not found |
429 Too Many Requests | Rate limit exceeded |
500 Internal Server Error | Server error |
All error responses include a JSON body with the following structure:
{
"message": "Human-readable error description"
}
Common Errors
Authentication Errors
401 Unauthorized - Missing Header
{
"message": "Authorization header required"
}
401 Unauthorized - Invalid Scheme
{
"message": "Invalid authorization scheme"
}
401 Unauthorized - Invalid Credentials
{
"message": "Invalid authentication credentials"
}
Causes:
- Missing Authorization header
- Wrong authentication scheme (must be “Basic”)
- Invalid client ID or secret
- Malformed Base64 encoding
- Deleted API key
Solution: Verify your API credentials and ensure they’re properly formatted in the Authorization header.
Validation Errors
400 Bad Request - Missing Required Field
{
"message": "Name is required"
}
{
"message": "Content is required"
}
Solution: Ensure all required fields are included in your request.
400 Bad Request - Invalid Pagination
{
"message": "Invalid request body: strconv.ParseInt: parsing \"abc\": invalid syntax"
}
{
"message": "offset cannot be negative"
}
Solution: Ensure limit and offset parameters are valid positive integers.
500 Internal Server Error - User Not Found
{
"message": "user with email john.doe@company.com not found"
}
Solution: Verify the email address matches an existing user in your Fabius account.
500 Internal Server Error - Invalid Timestamp Format
{
"message": "invalid document timestamp format (expected RFC3339): parsing time \"2023-12-15\" as \"2006-01-02T15:04:05Z07:00\": cannot parse \"\" as \"T\""
}
Solution: Ensure timestamps are in RFC3339 format (e.g., 2023-12-15T14:30:00Z).
Resource Errors
404 Not Found - Document
{
"message": "Document not found"
}
Solution: Check the document ID and ensure it belongs to your account.
404 Not Found - Contact/Account
{
"message": "contact not found"
}
Solution: Verify the external contact or account ID exists in your CRM and has been synced to Fabius.
Error Handling Best Practices
1. Implement Retry Logic
For transient errors (5xx status codes), implement exponential backoff:
async function apiRequestWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
const response = await fetch(url, options);
if (response.ok) {
return response;
}
// Don't retry client errors
if (response.status >= 400 && response.status < 500) {
throw new Error(`Client error: ${response.status}`);
}
// Retry server errors with backoff
if (i < maxRetries - 1) {
await new Promise((resolve) =>
setTimeout(resolve, Math.pow(2, i) * 1000)
);
}
} catch (error) {
if (i === maxRetries - 1) throw error;
}
}
}
Always log the full error response for debugging:
import logging
import requests
try:
response = requests.post(url, json=data, auth=auth)
response.raise_for_status()
except requests.exceptions.HTTPError as e:
logging.error(f"API Error: {e.response.status_code} - {e.response.text}")
# Handle specific error cases
if e.response.status_code == 400:
error_data = e.response.json()
if "user with email" in error_data.get("message", ""):
# Handle user not found
pass
Validate data client-side to avoid unnecessary API calls:
function validateDocumentRequest(data) {
const errors = [];
if (!data.name || data.name.trim() === "") {
errors.push("Name is required");
}
if (!data.content || data.content.trim() === "") {
errors.push("Content is required");
}
if (data.userEmail && !isValidEmail(data.userEmail)) {
errors.push("Invalid email format");
}
return errors;
}
Troubleshooting Guide
| Error | Common Causes | Solutions |
|---|
| 401 Unauthorized | Incorrect credentials, revoked key | Check API key configuration |
| 400 Bad Request | Missing fields, invalid data | Review request payload |
| 404 Not Found | Wrong ID, resource doesn’t exist | Verify resource IDs |
| 429 Too Many Requests | Exceeded rate limit | Implement retry with backoff |
| 500 Internal Server Error | Server issue, invalid references | Check data and retry if needed |
Getting Help
If you continue to experience issues:
- Check the API status page for any ongoing incidents
- Review your request against the API documentation
- Contact support with your request details (excluding credentials)