Skip to main content
Submit a rating and optional comment for a ride you participated in. The ride must be in COMPLETED status before feedback can be accepted. Authentication required — include Authorization: Bearer <token> in the request header.

Request

POST /rides/feedback/{rideId}
rideId
number
required
The unique ID of the completed ride.
rating
integer
required
Your rating for the ride. Must be an integer between 1 and 5 (inclusive).
comment
string
Optional written feedback. Stored in riderFeedback on the ride (up to 600 characters).

Response

id
number
Unique ride identifier.
status
string
Remains COMPLETED after feedback is submitted.
riderRating
number
The rating you submitted (1–5).
riderFeedback
string
The comment you submitted, or an empty string if none was provided.
riderId
number
ID of the rider.
driverId
number
ID of the driver.
fare
number
Fare for the ride.
pickupLocation
string
Pickup address.
dropLocation
string
Drop-off address.
createdAt
string
ISO 8601 timestamp of ride creation.

Example

curl -X POST "http://localhost:8080/rides/feedback/1021" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "rating": 5,
    "comment": "Great driver, very smooth ride!"
  }'
Feedback can only be submitted for rides with status COMPLETED. Attempting to submit feedback on a ride in any other status returns a 400 Bad Request.
If rating is missing, non-numeric, or outside the range 1–5, the server returns 400 Bad Request with the message: "Rating must be a number between 1 and 5."
Omitting the comment field is valid — the server stores an empty string for riderFeedback in that case. You must still provide a valid rating.