error object contains a machine-readable code, a human-readable message, and an optional details object with additional context.
Error response structure
Error object fields
Machine-readable error identifier. Use this field in your application logic to handle specific error cases.
Human-readable description of what went wrong.
Additional context about the error. For
VALIDATION_ERROR, this contains field-level errors keyed by field name (e.g. { "origen": ["Required"] }). May be absent or empty for other error codes.Error codes
| HTTP status | Code | When it occurs |
|---|---|---|
400 | VALIDATION_ERROR | The request body is missing required fields or contains values of the wrong type. Applies to origen and destino in POST /calculate-fare. |
400 | MISSING_PARAM | A required query parameter was not provided. Returned by GET /sector when the barrio query parameter is absent. |
404 | BARRIO_NOT_FOUND | The specified neighborhood was not found in any sector. Returned by GET /sector. |
415 | UNSUPPORTED_MEDIA_TYPE | A POST request was sent without the Content-Type: application/json header. |
422 | SECTOR_NOT_FOUND | Neither the origin nor the destination neighborhood could be matched to a sector. Returned by POST /calculate-fare. |
500 | INTERNAL_ERROR | An unexpected server-side error occurred. |
Error details by code
VALIDATION_ERROR — 400
Returned by POST /api/v2026/calculate-fare when the request body fails schema validation. The details object contains field-level errors:
MISSING_PARAM — 400
Returned by GET /api/v2026/sector when the barrio query parameter is missing:
BARRIO_NOT_FOUND — 404
Returned by GET /api/v2026/sector when the neighborhood name does not match any entry. Neighborhood matching is exact (after normalizing accents and casing):
UNSUPPORTED_MEDIA_TYPE — 415
Returned by any POST endpoint when the Content-Type: application/json header is missing or set to a different value.
SECTOR_NOT_FOUND — 422
Returned by POST /api/v2026/calculate-fare when neither origen nor destino can be mapped to a sector in the general or terminal fare tables, and neither belongs to a special route:
INTERNAL_ERROR — 500
Returned when an unexpected error occurs during request processing. The message field contains the error description when available.