Skip to main content
POST
/
api
/
routes
/
:routeId
/
reviews
Create Review
curl --request POST \
  --url https://api.example.com/api/routes/:routeId/reviews \
  --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

routeId
string
required
The UUID of the route to reviewMust be a valid UUID format.

Body Parameters

rating
number
required
Route rating from 1 to 5 stars
  • Must be an integer
  • Minimum: 1
  • Maximum: 5
comment
string
Optional comment about the route
  • Maximum length: 500 characters
  • Can be omitted or left empty

Response

success
boolean
Indicates if the request was successful
data
object
The created 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
Rating value (1-5)
data.comment
string
Review comment (null if not provided)
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 POST https://api.losinmaduros.com/api/routes/123e4567-e89b-12d3-a456-426614174000/reviews \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "rating": 5,
    "comment": "Excellent route! Very well signposted and great pavement quality."
  }'

Response Example

{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "routeId": "123e4567-e89b-12d3-a456-426614174000",
    "userId": "987e6543-e21b-12d3-a456-426614174000",
    "rating": 5,
    "comment": "Excellent route! Very well signposted and great pavement quality.",
    "createdAt": "2026-02-09T12:00:00Z",
    "updatedAt": "2026-02-09T12:00:00Z",
    "user": {
      "id": "987e6543-e21b-12d3-a456-426614174000",
      "name": "John Doe",
      "imageUrl": "https://example.com/avatar.jpg"
    }
  },
  "message": "Review created successfully"
}

Notes

  • Users can only create one review per route. Attempting to create a second review will return a 409 Conflict error.
  • If you need to modify your review, use the Update Review endpoint.
  • The comment field is optional and can be omitted if you only want to provide a rating.
  • Rate limiting applies to this endpoint to prevent abuse.

Build docs developers (and LLMs) love