Amba

Reviews

Submit, edit, delete user reviews; fetch reviews for an item or the caller's own.

Reviewable items are upserted on first submission. Average + count aggregates on reviewable_items are recomputed on every write.

Source: apps/api/src/routes/client/reviews.ts.

Endpoints

MethodPathDescription
POST/client/reviewsSubmit a review.
GET/client/reviews/item/:itemType/:itemIdApproved reviews for an item + aggregates.
GET/client/reviews/mineCaller's reviews with item metadata.
PATCH/client/reviews/:reviewIdUpdate the caller's review.
DELETE/client/reviews/:reviewIdDelete the caller's review.

POST /client/reviews

Request (SubmitReviewInput)

FieldTypeRequiredDefault
item_typestringno"custom"
item_idstringyes
rating1-5yes
titlestringnonull
bodystringnonull

Response 201

{
  "data": {
    "id": "…",
    "reviewable_item_id": "…",
    "app_user_id": "…",
    "rating": 5,
    "title": "…",
    "body": "…"
  }
}

Errors

  • 409 ALREADY_REVIEWED — one review per (user, item).
  • 500 CREATE_FAILED.

Try it:

POST/client/reviews
client auth
curl -X POST 'https://api.amba.dev/client/reviews'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X POST '${BASE_URL}/client/reviews' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{}'

GET /client/reviews/item/:itemType/:itemId

Approved reviews only, plus item aggregates.

Query

ParamDefault
limit20
offset0

Response 200

{
  "data": [
    { "id": "…", "rating": 5, "app_users": { "id": "…", "display_name": "…", "avatar_url": "…" } }
  ],
  "total": 42,
  "offset": 0,
  "limit": 20,
  "avg_rating": 4.3,
  "review_count": 42
}

Try it:

GET/client/reviews/item/%7B%7BitemType%7D%7D/%7B%7BitemId%7D%7D
client auth
curl -X GET 'https://api.amba.dev/client/reviews/item/%7B%7BitemType%7D%7D/%7B%7BitemId%7D%7D'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/client/reviews/item/{itemType}/{itemId}' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

GET /client/reviews/mine

Response 200

{
  "data": [
    { "id": "…", "rating": 5, "reviewable_items": { "item_type": "product", "item_id": "…" } }
  ]
}

Try it:

GET/client/reviews/mine
client auth
curl -X GET 'https://api.amba.dev/client/reviews/mine'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/client/reviews/mine' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

PATCH /client/reviews/:reviewId

Update rating, title, and/or body. Only the review's author can edit — others get 404 UPDATE_FAILED.

Errors

  • 400 INVALID_INPUT — no updatable fields.
  • 404 UPDATE_FAILED.
  • 500 UPDATE_FAILED.

Try it:

PATCH/client/reviews/%7B%7BreviewId%7D%7D
client auth
curl -X PATCH 'https://api.amba.dev/client/reviews/%7B%7BreviewId%7D%7D'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X PATCH '${BASE_URL}/client/reviews/{reviewId}' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{}'

DELETE /client/reviews/:reviewId

Only the author can delete. Aggregates on reviewable_items are recomputed.

Response 200

{ "data": { "deleted": true } }

Try it:

DELETE/client/reviews/%7B%7BreviewId%7D%7D
client auth
curl -X DELETE 'https://api.amba.dev/client/reviews/%7B%7BreviewId%7D%7D'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X DELETE '${BASE_URL}/client/reviews/{reviewId}' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

On this page