# List a collection's images

`GET /v1/collections/{collection_id}/images`

Lists the images in a collection, sorted by `sort_by` and
`sort_direction` with ties broken by image id. Page with `limit` and
`offset`; the `Vizit-Total-Count` response header carries the number
of images.

Send `product_category_id` with exactly one of `benchmark_id` or
`retailer` to have each row carry `pair_score`, from that pair's
latest scoring of this collection
([Score a collection](/api/collections/requestCollectionScoring)).
An incomplete pair answers `422 INVALID_SCORING_PAIR`. Without a pair
`pair_score` is `null`, and `sort_by=pair_score` answers
`422 SORT_REQUIRES_PAIR`. Unscored images sort last in both
directions; informational images have `vizit_score: null` and
`scored: false` and sort with them.

`classification` is `null` for an Other asset.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `product_category_id` | query | no | string | Score each image under this product category. Send with exactly one of `benchmark_id` or `retailer`. |
| `benchmark_id` | query | no | string | Custom benchmark to score each image against. |
| `retailer` | query | no | enum: "amazon" | "walmart" | "us_composite" | Retailer whose Vizit benchmark to score each image against. |
| `sort_by` | query | no | enum: "created_at" | "name" | "pair_score" | Field to sort by. |
| `sort_direction` | query | no | enum: "asc" | "desc" | Sort direction. |
| `limit` | query | no | integer | Number of items to return. |
| `offset` | query | no | integer | Number of items to skip. |

## Responses

### 200 — A page of collection images

**application/json**

- **array**
  - items:
    - **object**
      - `image_id` (string, required)
      - `name` (string, required)
      - `image_url` (any, required) — Signed URL to the image that expires after a short time; `null` when it could not be signed.
      - `classification` (any, required) — `null` when the image is unclassified or is an Other asset.
      - `pair_score` (any, required) — Score against the requested pair from its latest scoring of this collection; `null` when no pair was sent.

### 400 — Check `error_code`:
  - NO_DEFAULT_PORTFOLIO: your organization has no default portfolio
  - NO_DEFAULT_WORKSPACE: your default portfolio has no default workspace
  - CATEGORY_NOT_IN_ORG_ICP: `product_category_id` is outside your organization's categories
  - BENCHMARK_SCOPE_MISMATCH: the custom benchmark's scope is not the collection's `image_type`
  - RETAILER_MISMATCH: the product category has no category at the requested retailer
  - CATEGORY_HAS_NO_AUDIENCES: the product category cannot be scored yet


**application/json**

- **object** — Standardized error format for all `/v1/*` endpoints. `error_code` is a
stable SCREAMING_SNAKE_CASE identifier clients can switch on.

  - `detail` (string) — Human-readable error message
  - `status_code` (integer) — HTTP status code
  - `error_code` (string) — Stable machine-readable error code
  - `request_id` (any) — Request identifier for correlation
  - `extra` (any) — Endpoint-specific additional context. For example,
IMAGE_DOWNLOAD_FAILED populates extra.failed_urls with per-URL
failure reasons so clients can triage bulk submissions.

  - `timestamp` (string)

### 401 — Missing or invalid Bearer token

### 404 — Check `error_code`:
  - NOT_FOUND: custom benchmarks are not enabled for your organization
  - COLLECTION_NOT_FOUND: no such collection in your default workspace
  - PRODUCT_CATEGORY_NOT_FOUND: `product_category_id` does not exist
  - BENCHMARK_NOT_FOUND: `benchmark_id` is not a custom benchmark in your default workspace, or the retailer has no Vizit benchmark for the category


**application/json**

- **object** — Standardized error format for all `/v1/*` endpoints. `error_code` is a
stable SCREAMING_SNAKE_CASE identifier clients can switch on.

  - `detail` (string) — Human-readable error message
  - `status_code` (integer) — HTTP status code
  - `error_code` (string) — Stable machine-readable error code
  - `request_id` (any) — Request identifier for correlation
  - `extra` (any) — Endpoint-specific additional context. For example,
IMAGE_DOWNLOAD_FAILED populates extra.failed_urls with per-URL
failure reasons so clients can triage bulk submissions.

  - `timestamp` (string)

### 422 — Check `error_code`:
  - INVALID_SCORING_PAIR: `product_category_id` without exactly one of `benchmark_id` or `retailer`, or either of those without `product_category_id`
  - SORT_REQUIRES_PAIR: `sort_by=pair_score` without a pair
  - VALIDATION_ERROR: request validation failed


**application/json**

- **object** — Standardized error format for all `/v1/*` endpoints. `error_code` is a
stable SCREAMING_SNAKE_CASE identifier clients can switch on.

  - `detail` (string) — Human-readable error message
  - `status_code` (integer) — HTTP status code
  - `error_code` (string) — Stable machine-readable error code
  - `request_id` (any) — Request identifier for correlation
  - `extra` (any) — Endpoint-specific additional context. For example,
IMAGE_DOWNLOAD_FAILED populates extra.failed_urls with per-URL
failure reasons so clients can triage bulk submissions.

  - `timestamp` (string)

### 429 — Rate limit exceeded for this organization
