Errors¶
This section describes common error responses returned by the Madevo API and how to handle them.
Error format¶
All errors follow the standard response structure:
Common error messages¶
Authentication errors¶
Unauthorized¶
Cause
- Missing token
- Invalid token
- Expired token
Session expired¶
Cause
- Token refresh attempted after session expiry
Authorization errors¶
Forbidden¶
Cause
- Insufficient permissions
- Role does not allow access
Validation errors¶
Invalid request body¶
Cause
- Missing required fields
- Incorrect JSON structure
Invalid input¶
Cause
- Invalid parameter values
- Unsupported formats
Datasource errors¶
Missing required fields¶
Cause
- Missing
timefieldormetafield - Invalid row data
Partial success¶
Cause
- Some rows failed validation
Important
- Valid rows are still inserted
- You must inspect the message
File upload errors¶
Unsupported file type¶
Cause
- File type not supported
Assistant errors¶
Assistant query failed¶
Cause
- Internal processing error
- Timeout or data issue
Agent errors¶
Invalid task request¶
Cause
- Missing or invalid fields
HTTP status vs API error¶
The API may return HTTP 200 even when:
Important¶
- Always check the
errorfield - Do not rely only on HTTP status
Handling errors¶
Recommended approach¶
- Check
errorfield - Log the
message - Handle specific cases based on message
- Retry or correct input
Example¶
Best practices¶
- Validate inputs before sending requests
- Handle partial success explicitly
- Implement retry logic where appropriate
- Log all error messages for debugging
- Do not assume all failures are fatal
Debugging tips¶
- Check authentication first
- Verify required fields
- Confirm datasource configuration
- Validate timestamps and formats
- Inspect API response messages carefully