Skip to main content
PUT
/
api
/
reviews
/
:id
Update Review
curl --request PUT \
  --url https://api.example.com/api/reviews/:id \
  --header 'Content-Type: application/json' \
  --data '
{
  "rating": 123,
  "comment": "<string>"
}
'
{
  "success": true,
  "data": {
    "data.id": "<string>",
    "data.routeId": "<string>",
    "data.userId": "<string>",
    "data.rating": 123,
    "data.comment": "<string>",
    "data.createdAt": "<string>",
    "data.updatedAt": "<string>",
    "data.user": {
      "data.user.id": "<string>",
      "data.user.name": "<string>",
      "data.user.imageUrl": "<string>"
    }
  },
  "message": "<string>"
}

Authentication

This endpoint requires authentication. Include a valid Bearer token in the Authorization header.

Path Parameters

id
string
required
The UUID of the review to updateMust be a valid UUID format.

Body Parameters

Both fields are optional. Provide only the fields you want to update.
rating
number
New rating from 1 to 5 stars
  • Must be an integer
  • Minimum: 1
  • Maximum: 5
comment
string
New comment about the route
  • Maximum length: 500 characters
  • Can be set to empty string to remove comment

Response

success
boolean
Indicates if the request was successful
data
object
The updated review object
data.id
string
UUID of the review
data.routeId
string
UUID of the reviewed route
data.userId
string
UUID of the user who created the review
data.rating
number
Updated rating value (1-5)
data.comment
string
Updated review comment
data.createdAt
string
ISO 8601 timestamp of creation
data.updatedAt
string
ISO 8601 timestamp of last update
data.user
object
User information
data.user.id
string
User UUID
data.user.name
string
User’s display name
data.user.imageUrl
string
URL to user’s profile image
message
string
Success message

Request Example

curl -X PUT https://api.losinmaduros.com/api/reviews/123e4567-e89b-12d3-a456-426614174000 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "rating": 4,
    "comment": "Updated my review with more details."
  }'

Response Example

{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "routeId": "987e6543-e21b-12d3-a456-426614174000",
    "userId": "456e7890-e12b-34d5-a678-901234567890",
    "rating": 4,
    "comment": "Updated my review with more details.",
    "createdAt": "2026-02-09T12:00:00Z",
    "updatedAt": "2026-03-04T14:30:00Z",
    "user": {
      "id": "456e7890-e12b-34d5-a678-901234567890",
      "name": "John Doe",
      "imageUrl": "https://example.com/avatar.jpg"
    }
  },
  "message": "Review updated successfully"
}

Notes

  • Only the review owner can update their review. Attempting to update another user’s review will return a 403 Forbidden error.
  • You can update just the rating, just the comment, or both fields in a single request.
  • The updatedAt timestamp will be automatically updated to reflect the modification time.
  • To remove a comment while keeping the rating, send an empty string for comment.

Build docs developers (and LLMs) love