Error Handling
The API validates all inputs before processing. When validation fails, you'll receive detailed error messages explaining exactly what's wrong and how to fix it.
Error Response Format
All validation errors return HTTP 400 with this structure:
Code
The details array contains one entry per validation issue, with:
field- The attribute path (e.g.,"supports.0.2"for nested values)message- Human-readable description of the problem
Common Validation Errors
Type Errors
Wrong type for numeric fields:
Code
Error: Expected number, received string
Wrong type for Yes/No fields:
Code
Error: Invalid enum value. Expected 'Yes' | 'No', received true
Enum Errors (Case-Sensitive)
All enum values are case-sensitive. Common mistakes:
Wet condition:
Code
Valid values: "Dry", "Wet"
Member type:
Code
Valid values: "Database", "Custom"
Support types:
Code
Valid values: "Pinned", "Roller", "Fixed"
Temperature:
Code
Valid values: "T ≤ 100°F", "100°F < T ≤ 125°F", "125°F < T ≤ 150°F"
Range Errors
Zero or negative values:
Code
Error: Beam length (L_X) must be positive
Non-integer where integer required:
Code
Error: Number of plies (n_com) must be an integer
Array Structure Errors
Supports - minimum 2 required:
Code
Error: At least 2 supports are required
Supports - incorrect tuple format:
Code
Format: [SupportType, position_ft, bearing_in]
Bearing width must be positive:
Code
Error: Bearing width must be positive
Cross-Field Validation Errors
Database type requires member:
Code
Error: Field 'member' is required when type='Database'
Custom type requires dimensions:
Code
Errors:
Field 'b_input' (width) is required when type='Custom'Field 'd_input' (depth) is required when type='Custom'Field 'species' is required when type='Custom'
Flitch beam requires flitch options:
Code
Error: Fields 'n_flitch' and 't_flitch' are required when flitch='Yes'
Error Codes Reference
| Code | HTTP Status | Description |
|---|---|---|
VALIDATION_ERROR | 400 | Input validation failed |
SHEET_NOT_FOUND | 404 | Sheet ID doesn't exist |
PROJECT_NOT_FOUND | 404 | Project ID doesn't exist |
CALCULATION_ERROR | 422 | Calculation failed (check inputs) |
UPSTREAM_ERROR | 500 | Internal server error |
Debugging Tips
- Check the
detailsarray - Each entry tells you exactly which field failed and why - Nested paths -
supports.0.2means "first support, third element (bearing width)" - Case sensitivity - All enum values are case-sensitive (
"Wet"not"wet") - Types matter - Numbers must be numbers, not strings (
14not"14") - Use the API reference - Interactive docs show exact expected types
Next Steps
- Attributes Reference - Valid values for all fields
- API Reference - Interactive endpoint testing