Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/HelenaLM32/ECHO/llms.txt

Use this file to discover all available pages before exploring further.

The reviews API lets buyers leave a score and comment on completed orders, building a public reputation for creators and service providers on ECHO. Anyone can read reviews and average scores without authentication. Creating or retrieving reviews tied to a specific order requires a JWT token. Listing all reviews and deleting individual reviews are restricted to ADMIN users.
The base URL for all endpoints on a local development server is http://localhost:8084. Replace this with your deployed API URL in production.

Create review

POST /reviews
Submits a review for a completed order. The authenticated user must be the buyer on the referenced order.

Authentication

Requires a valid JWT token.

Request body

orderId
number
required
The ID of the order being reviewed.
score
number
required
A whole-number rating between 1 and 5 (inclusive).
comment
string
Optional written feedback accompanying the score.
score must be an integer between 1 and 5. Values outside this range will be rejected with a 400 response.

Example

curl -X POST http://localhost:8084/reviews \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"orderId":12,"score":5,"comment":"Exceptional work, delivered ahead of schedule."}'

Response fields

id
number
required
Unique identifier for the newly created review.
orderId
number
required
The ID of the reviewed order.
authorId
number
required
The ID of the user who wrote the review.
score
number
required
The submitted score (1–5).
comment
string
The submitted written feedback, if provided.

Error codes

StatusMeaning
400score is outside the 1–5 range or required fields are missing.
403You are not the buyer on the referenced order.
404No order exists with the given orderId.

Get reviews for order

GET /reviews/order/{orderId}
Returns all reviews associated with a specific order.

Authentication

Requires a valid JWT token.

Path parameters

orderId
number
required
The numeric ID of the order whose reviews to retrieve.

Example

curl -X GET http://localhost:8084/reviews/order/12 \
  -H "Authorization: Bearer <token>"

Response fields

id
number
required
Unique identifier for the review.
orderId
number
required
The ID of the reviewed order.
authorId
number
required
The ID of the review author.
score
number
required
The rating score (1–5).
comment
string
Written feedback, if provided.

Get reviews for user

GET /reviews/user/{userId}
Returns all reviews written about a specific user. This endpoint is publicly accessible without authentication.

Path parameters

userId
number
required
The numeric ID of the user whose received reviews to retrieve.

Example

curl -X GET http://localhost:8084/reviews/user/7

Response fields

id
number
required
Unique identifier for the review.
orderId
number
required
The ID of the order the review relates to.
authorId
number
required
The ID of the user who wrote the review.
score
number
required
The rating score (1–5).
comment
string
Written feedback, if provided.

Get average score for user

GET /reviews/user/{userId}/average
Returns the average review score and total review count for a user. This endpoint is publicly accessible without authentication.

Path parameters

userId
number
required
The numeric ID of the user whose average score to retrieve.

Example

curl -X GET http://localhost:8084/reviews/user/7/average

Response

{"average": 4.5, "count": 12}

Response fields

average
number
required
The mean score across all reviews for this user, as a decimal.
count
number
required
The total number of reviews included in the average.

Get all reviews

GET /reviews
Returns every review on the platform.
This endpoint is restricted to users with the ADMIN role. Requests from non-admin accounts will receive a 403 response.

Authentication

Requires a valid JWT token with ADMIN role.

Example

curl -X GET http://localhost:8084/reviews \
  -H "Authorization: Bearer <token>"

Delete review

DELETE /reviews/{reviewId}
Permanently removes a review from the platform.
This endpoint is restricted to users with the ADMIN role. This action is irreversible.

Authentication

Requires a valid JWT token with ADMIN role.

Path parameters

reviewId
number
required
The numeric ID of the review to delete.

Example

curl -X DELETE http://localhost:8084/reviews/34 \
  -H "Authorization: Bearer <token>"

Error codes

StatusMeaning
403You do not have the ADMIN role.
404No review exists with the given ID.

Build docs developers (and LLMs) love