ErrorResponse
Standard error response schema for all API endpoints.
Follows Django Ninja standard format and aligns with validation errors. Compatible with frontend apiClient.ts error handling.
Attributes: detail: Human-readable error message or machine-readable error code error_code: Optional machine-readable error identifier details: Optional additional context (field errors, validation details, etc.)
Examples: Simple error: {"detail": "Resource not found"}
Error with code: {"detail": "FORBIDDEN", "error_code": "INSUFFICIENT_PERMISSIONS"}
Validation error: { "detail": "Validation failed", "details": { "name": ["This field is required"], "email": ["Invalid email format"] } }
detailDetail (string)required
error_code object
anyOf
- string
- null
string
details object
anyOf
- object
- null
object
ErrorResponse
{
"detail": "string",
"error_code": "string",
"details": {}
}