OpenTrip Docs
BackendHTTP API

Error envelope

Error envelope

apps/api/src/interfaces/http/errors.ts maps thrown errors:

SourceTypical statuserror.code examples
Zod400validation_error
Domain / input400domain codes (empty_message, invalid_currency, …)
Unauthenticated guard401unauthenticated
Forbidden403insufficient_permissions
Not found404trip_not_found, suggestion_not_found, agent_disabled
Conflict409suggestion_not_pending, reservation_conflict
Precondition required428revision_required
Avatar / media size413avatar_too_large, media_too_large
Weather/FX/geo502–504 / 503see weather/fx/geo docs
Street view400 / 404 / 413 / 502–504invalid image/query, missing image, bounded preview, or upstream failure
Unhandled500internal_error

Example:

{ "error": { "code": "unauthenticated", "message": "Sign in required" } }

Reservation compare-and-swap conflicts additionally return error.current with the current ReservationDto or null when it was deleted.


Status code summary: conventions.md.


← API index

On this page