---
title: "Add a file to a gallery"
method: POST
path: "/v1/workspaces/{workspace}/galleries/{galleryId}/items"
---

# Add a file to a gallery

`POST /v1/workspaces/{workspace}/galleries/{galleryId}/items`

## Request

- Base URL: `https://api.uploads.sh`
- URL: `https://api.uploads.sh/v1/workspaces/{workspace}/galleries/{galleryId}/items`
- Auth: HTTP bearer

## Request body

- GalleryItemCreate
  - `expectedVersion` integer, required
  - `objectKey` string, required
  - `caption` string, nullable
  - `altText` string, nullable

## Response `200`

The file was already a member; the existing item is returned.

- GalleryItem
  - `id` string, required
  - `objectKey` string, required
  - `position` integer, required
  - `caption` string, nullable, required
  - `altText` string, nullable, required
  - `createdAt` string, date-time, required
  - `status` 'available' | 'missing' | 'withheld', required
  - `url` string, uri, nullable, required
  - `embedUrl` string, uri, nullable, required
  - `pageUrl` string, uri, required
  - `contentType` string, nullable, required
  - `size` integer, nullable, required
  - `uploaded` string, date-time, nullable, required
  - `modified` string, date-time, nullable, required
  - `posterUrl` string, uri
  - `videoDimensions` object
    - `width` integer, required
    - `height` integer, required

## Other responses

- `201`: The gallery item was created.
- `400`: Invalid request.
- `401`: Missing or invalid credential.
- `403`: The credential lacks the required scope or role.
- `404`: The resource was not found.
- `409`: The request conflicts with current resource state.
- `429`: The workspace rate limit or upload budget was exceeded.

---

[API](https://skmtc.dev/uploads/apis/uploads-sh-api.md) · [All operations](https://skmtc.dev/uploads/apis/uploads-sh-api/llms.txt) · [OpenAPI document](https://skmtc.dev/uploads/apis/uploads-sh-api/revisions/6df242babacd?raw)
