# Upload an image to a benchmark

`POST /v1/benchmarks/{benchmark_id}/images/upload`

Downloads one image from `image_url`, stores it in your default
workspace with the benchmark's scope as its image type, and adds it
to the benchmark. The image is downloaded with the same checks as
[Submit an image for scoring](/api/images/scoreImage): a public HTTP
or HTTPS URL to a JPEG, PNG or WebP image of up to 25 MB.

Send `product_category_id` to score the image under that category
as it lands. The response is `202` with `status: PROCESSING`,
since scoring runs after the upload.

## Request Body

### application/json

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

  - `product_category_id` (any) — Scores the image under this category as it uploads. Must be one
returned by [List product categories](/api/product-details/listProductCategories).


## Responses

### 202 — Image stored and added to the benchmark

**application/json**

- **object**
  - `image_id` (string, required) — The new image, already a member of the benchmark.
  - `status` (enum: "PROCESSING" | "COMPLETED" | "ERROR", required) — Always `PROCESSING`, since scoring starts once the upload lands.

### 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
  - UNSAFE_IMAGE_URL: `image_url` is not a public HTTP or HTTPS URL
  - IMAGE_DOWNLOAD_FAILED: the image URL could not be downloaded
  - IMAGE_DOWNLOAD_TIMEOUT: the download took too long
  - UNSUPPORTED_IMAGE_FORMAT: the image is not JPEG, PNG or WebP
  - IMAGE_TOO_LARGE: the image is over 25 MB
  - EMPTY_IMAGE: the downloaded image was empty


**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
  - BENCHMARK_NOT_FOUND: no such custom benchmark in your default workspace
  - PRODUCT_CATEGORY_NOT_FOUND: `product_category_id` does not exist


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

### 502 — The image could not be stored; retry the request (error_code IMAGE_UPLOAD_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)
