Skip to main content
POST
/
api
/
favourites
/
{userId}
/
{vehicleId}
curl -X POST https://api.drivex.com/api/favourites/123/456
200 OK
This endpoint adds a specific vehicle to a user’s favorites list. If the vehicle is already in the user’s favorites, the request is idempotent and no duplicate is created.
userId
long
required
The unique identifier of the user
vehicleId
long
required
The unique identifier of the vehicle to add to favorites

Response

Returns no content (void) on success. The endpoint is idempotent - adding an already favorited vehicle will not create a duplicate.

Behavior

  • If the favorite already exists, the request succeeds without modification
  • If the user or vehicle does not exist, an error is thrown
  • Creates a new favorite relationship between the user and vehicle
curl -X POST https://api.drivex.com/api/favourites/123/456
200 OK

Build docs developers (and LLMs) love