# Upload images to a collection

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

Downloads up to 50 images and stores each in the collection, with
the collection's image type and product category. Each image is a
public HTTP or HTTPS URL to a JPEG, PNG or WebP image of up to 25 MB.
New images are scored under the collection's existing scorings once
their first scores land.

Each image succeeds or fails on its own, so one bad URL never
refuses the batch. The response is `202` with one result per
requested image, in request order: `PROCESSING` with an `image_id`
for a stored image, or `ERROR` with a `reason` for a failed one.
Downloads share a time budget, so an image not yet uploading when it
runs out fails with `IMAGE_DOWNLOAD_TIMEOUT` and is not stored.

There is no deduplication by URL: retrying a whole batch stores the
accepted images again. Retry only the failed items.

## Request Body

### application/json

- **object**
  - `images` (array<object>, required) — Up to 50 images, uploaded in request order. More than 50 is rejected
with `413 TOO_MANY_IMAGES`.

    - items:
      - **object**
        - `image_url` (string, required) — Public HTTP or HTTPS image URL (JPEG, PNG or WebP, up to 25 MB).

        - `name` (any) — Image name; defaults to the file name in the URL. A scorable file
extension is added when the name has none.


## Responses

### 202 — One result per requested image

**application/json**

- **object**
  - `results` (array<object>, required) — One result per requested image, in request order.
    - items:
      - **object**
        - `image_id` (any, required) — The new image; `null` when it failed.
        - `status` (enum: "PROCESSING" | "COMPLETED" | "ERROR", required) — `PROCESSING` once the image is stored and scoring, `ERROR` when it failed.
        - `reason` (any) — Error code of a failed image, such as `UNSAFE_IMAGE_URL`,
`IMAGE_DOWNLOAD_FAILED`, `IMAGE_DOWNLOAD_TIMEOUT`,
`UNSUPPORTED_IMAGE_FORMAT`, `IMAGE_TOO_LARGE`, `EMPTY_IMAGE` or
`IMAGE_UPLOAD_FAILED`. `null` for a stored image.


### 400 — Check `error_code`:
  - NO_DEFAULT_PORTFOLIO: your organization has no default portfolio
  - NO_DEFAULT_WORKSPACE: your default portfolio has no default workspace


**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


**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)

### 413 — More than 50 images were sent (error_code TOO_MANY_IMAGES)

**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 — Request validation failed (error_code VALIDATION_ERROR)

**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
