---
title: "Remove one product photo"
method: DELETE
path: "/api/admin/components/{id}/gallery"
tags: ["admin-components"]
---

# Remove one product photo

`DELETE /api/admin/components/{id}/gallery`

## Request

- Base URL: `https://voltplan.app`
- URL: `https://voltplan.app/api/admin/components/{id}/gallery`
- Auth: HTTP bearer

Removes the named file from the `gallery` file field (`gallery-`). On success the cached component reads and the public pages `/components` and `/components/<slug>` are revalidated.

## Request body

- AdminComponentGalleryDelete
  - `filename` string, required: Stored filename to remove.

## Response `200`

Gallery after the removal.

- AdminComponentGallery
  - `success` unknown, required
  - `gallery` string[], required: Stored filenames in display order; the first one is the cover image.
  - `urls` string[], required: Public file URLs `<PocketBase>/api/files/<collectionId>/<id>/<filename>`, same order as `gallery`.

## Other responses

- `400`: `filename` missing or not a string.
- `403`: Admin access required. Returned for a missing, invalid or expired bearer token as well as for a valid token whose user lacks `is_admin=true`; admin endpoints never answer 401.
- `404`: The file is not in this gallery.
- `500`: Invalid JSON, unknown `id` or PocketBase write failed.

---

[API](https://skmtc.dev/voltplan/apis/voltplan-api.md) · [All operations](https://skmtc.dev/voltplan/apis/voltplan-api/llms.txt) · [OpenAPI document](https://skmtc.dev/voltplan/apis/voltplan-api/revisions/575b86a7af92?raw)
