Skip to main content
GET
/
api
/
rentals
curl -X GET "https://api.drivex.com/api/rentals?userId=123" \
  -H "Authorization: Bearer YOUR_API_KEY"
[
  {
    "id": 789,
    "userId": 123,
    "vehicleId": 456,
    "startDate": "2026-03-15",
    "endDate": "2026-03-20",
    "price": 450.00,
    "status": "RESERVED",
    "createdAt": "2026-03-01T10:30:00Z",
    "updatedAt": "2026-03-01T10:30:00Z"
  },
  {
    "id": 790,
    "userId": 123,
    "vehicleId": 457,
    "startDate": "2026-04-01",
    "endDate": "2026-04-05",
    "price": 380.00,
    "status": "COMPLETED",
    "createdAt": "2026-02-20T14:15:00Z",
    "updatedAt": "2026-04-05T18:00:00Z"
  }
]
Retrieves a list of rentals filtered by user or vehicle. At least one filter parameter must be provided.
If no query parameters are provided, the endpoint returns an empty list.

Query Parameters

userId
long
Filter rentals by user ID. Returns all rentals for the specified user.
vehicleId
long
Filter rentals by vehicle ID. Returns all rentals for the specified vehicle.

Response

Returns an array of rental objects.
id
long
Unique identifier for the rental
userId
long
The ID of the user who made the reservation
vehicleId
long
The ID of the rented vehicle
startDate
string
Rental start date in ISO 8601 format
endDate
string
Rental end date in ISO 8601 format
price
decimal
Total rental price
status
string
Current rental status: RESERVED, ACTIVE, COMPLETED, or CANCELLED
createdAt
string
Timestamp when the rental was created (ISO 8601)
updatedAt
string
Timestamp when the rental was last updated (ISO 8601)
curl -X GET "https://api.drivex.com/api/rentals?userId=123" \
  -H "Authorization: Bearer YOUR_API_KEY"
[
  {
    "id": 789,
    "userId": 123,
    "vehicleId": 456,
    "startDate": "2026-03-15",
    "endDate": "2026-03-20",
    "price": 450.00,
    "status": "RESERVED",
    "createdAt": "2026-03-01T10:30:00Z",
    "updatedAt": "2026-03-01T10:30:00Z"
  },
  {
    "id": 790,
    "userId": 123,
    "vehicleId": 457,
    "startDate": "2026-04-01",
    "endDate": "2026-04-05",
    "price": 380.00,
    "status": "COMPLETED",
    "createdAt": "2026-02-20T14:15:00Z",
    "updatedAt": "2026-04-05T18:00:00Z"
  }
]

Build docs developers (and LLMs) love