Skip to content

Places API returns 400 instead of 404 when a place isn't found #361

Closed

Description

@LeftoversTodayAppAdmin

Describe the bug

GET, PUT and DELETE /v1/places/{id} return 400 Place resource not found. for an unknown id or another organization's place. Orders, vehicles, drivers and fleets return 404 in the same case. The lookup is scoped correctly, so nothing is exposed; only the status code is off.

PlaceController calls its local apiError(), which defaults to 400, at lines 149, 256 and 272. VehicleController passes 404 explicitly.

Impact

Clients that map 404 to "not found" treat a missing place as a bad request, and need a special case for this one resource.

Proposed fix

-            return $this->apiError('Place resource not found.');
+            return $this->apiError('Place resource not found.', 404);

at the three call sites. CustomerController.php:539 ("Account not found.") and DriverController.php:89 ("Company not found.") fall back to 400 the same way.

Why

A small change that makes not-found handling the same across resources.

Fleetbase v0.7.68 (fleetops 0.6.71).

Activity

  1. roncodes commented on Oct 9, 2026

    @roncodes
    Member

    Thanks for the clear report. Confirmed: PlaceController::apiError() defaults to 400, and the three not-found paths didn't pass a status. The fix is in #373 (against release/v0.6.72): those paths now return 404, matching the other resources.

    I left the two related call sites as they are. DriverController "Company not found." answers an invalid company input on create, so 400 still fits. CustomerController "Account not found." sits in the password-reset flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions