---
id: ListFeedbacks
name: List feedbacks
version: 1.0.0
badges:
  - content: Reviews
    backgroundColor: purple
    textColor: purple
summary: Returns feedback for a book with pagination, sorting, and validation responses.
owners:
  - catalog-experience-team
schemaPath: schema.json
operation:
  method: GET
  path: /api/v1/feedbacks
  statusCodes: ["200", "400"]
sidebar:
  badge: "GET"
---

`ListFeedbacks` queries [[service|rating-api]] (`GET /rating/api/v1/feedbacks`) for a paginated, sorted page of customer feedback records belonging to a single Catalog book. The endpoint is publicly readable, caches pages for 10 minutes, and emits total counts and navigation links in HTTP response headers.

## Overview

| Property                           | Value                                                                                                                                                                                          |
| :--------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Bounded Context**                | Reviews                                                                                                                                                                                        |
| **Owner Service**                  | [[service\|rating-api]]                                                                                                                                                                        |
| **Protocol / Format**              | HTTP `GET`, `application/json` response                                                                                                                                                        |
| **Gateway Endpoint**               | `GET /rating/api/v1/feedbacks` (service path `/api/v1/feedbacks`)                                                                                                                              |
| **Authentication & Authorization** | None required (public read endpoint)                                                                                                                                                           |
| **Idempotency / Concurrency**      | Read-only and naturally idempotent                                                                                                                                                             |
| **Rate Limit / Caching**           | Global concurrency (`100`), per-IP fixed-window (`30 req/min`), and per-user token bucket (`30` limit, `20` per `10s`, queue `5`); cached in L1 + Redis L2 for `10 minutes` tagged by `BookId` |
| **Contract Version**               | `1.0.0` (`ApiVersions.V1`)                                                                                                                                                                     |

## Request & Response Contract

### Query Parameters

| Name           | Type              | Required | Constraints                                                                          | Description                                                        |
| :------------- | :---------------- | :------- | :----------------------------------------------------------------------------------- | :----------------------------------------------------------------- |
| `BookId`       | `string` (`uuid`) | Yes      | Valid UUID                                                                           | Identifier of the Catalog book whose feedback records are returned |
| `PageIndex`    | `integer`         | No       | Default `1`; must be `> 0`                                                           | 1-based page number to retrieve                                    |
| `PageSize`     | `integer`         | No       | Default `20`; must be `> 0`                                                          | Maximum number of feedback records per page                        |
| `OrderBy`      | `string`          | No       | Default `"Rating"`; supports `Rating` and `CreatedAt` (others fall back to `Rating`) | Field used to sort feedback records                                |
| `IsDescending` | `boolean`         | No       | Default `false`                                                                      | Sorts descending when `true` and ascending when `false`            |

### Response Headers (`200 OK`)

| Name               | Type     | Required | Constraints                               | Description                                                                                                          |
| :----------------- | :------- | :------- | :---------------------------------------- | :------------------------------------------------------------------------------------------------------------------- |
| `Pagination-Count` | `string` | Yes      | Integer string (e.g., `42`)               | Total number of feedback records matching `BookId` across all pages                                                  |
| `Link`             | `string` | Yes      | Comma-separated `<uri>;rel=<rel>` entries | Navigation URIs with `first`, `self`, `last`, and conditional `previous` / `next` relations preserving query filters |

### Success Response (`200 OK`)

Returns a JSON array of feedback objects (`additionalProperties: false`).

| Name           | Type                | Required | Constraints | Description                                   |
| :------------- | :------------------ | :------- | :---------- | :-------------------------------------------- |
| `[].id`        | `string` (`uuid`)   | Yes      | Valid UUID  | Unique identifier of the feedback record      |
| `[].firstName` | `string \| null`    | Yes      | Nullable    | First name of the reviewer                    |
| `[].lastName`  | `string \| null`    | Yes      | Nullable    | Last name of the reviewer                     |
| `[].comment`   | `string \| null`    | Yes      | Nullable    | Written review text left by the reviewer      |
| `[].rating`    | `integer \| string` | Yes      | `0`-`5`     | Numeric star rating submitted by the reviewer |
| `[].bookId`    | `string` (`uuid`)   | Yes      | Valid UUID  | Identifier of the reviewed Catalog book       |

## Behavior & Side Effects

- **Read-through caching:** Queries Azure Cosmos DB (`ratingdb`/`feedbacks`, partition key `/bookId`) and caches paginated results for 10 minutes; invalidated on feedback creation or deletion.
- **No state mutation:** Pure read query with no database writes or integration events.

## Error Responses

| Status / Code           | Condition                                                             | Client Recovery Action                                   |
| :---------------------- | :-------------------------------------------------------------------- | :------------------------------------------------------- |
| `400 Bad Request`       | Missing/malformed `BookId` or invalid `PageIndex`/`PageSize` (`<= 0`) | Correct invalid query parameters; do not retry unchanged |
| `429 Too Many Requests` | Rate limit quota exceeded (`Retry-After` header included)             | Wait for the `Retry-After` duration before retrying      |

## Related Documentation

- [[service|rating-api]] — Service overview, Azure Cosmos DB storage, and endpoints.
- [[entity|feedback]] — Feedback document model.
- [[query|SummarizeFeedback]] — Generate an AI summary and classification for a book's feedback.
- [[command|CreateFeedback]] — Submit a new customer feedback record.

<NodeGraph />

<SchemaViewer file="schema.json" title="List feedbacks schema" maxHeight="500" search="true" />


 ## Raw Schema:schema.json

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"title": "ListFeedbacksResponse",
	"description": "Feedback records returned for a Catalog book.",
	"type": "array",
	"items": {
		"type": "object",
		"additionalProperties": false,
		"required": ["id", "firstName", "lastName", "comment", "rating", "bookId"],
		"properties": {
			"id": {
				"type": "string",
				"format": "uuid",
				"description": "Unique identifier of the feedback record."
			},
			"firstName": {
				"type": ["string", "null"],
				"description": "First name of the reviewer."
			},
			"lastName": {
				"type": ["string", "null"],
				"description": "Last name of the reviewer."
			},
			"comment": {
				"type": ["string", "null"],
				"description": "Written feedback left by the reviewer."
			},
			"rating": {
				"type": ["integer", "string"],
				"format": "int32",
				"description": "Rating value from 0 through 5."
			},
			"bookId": {
				"type": "string",
				"format": "uuid",
				"description": "Identifier of the reviewed Catalog book."
			}
		}
	}
}
