> For the complete documentation index, see [llms.txt](https://help.mimeeq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.mimeeq.com/api/galleries/add-or-update-gallery-items.md).

# Add or Update Gallery Items

Add or update media items without re-sending the whole list.

Use this to add the supplied members without submitting the entire existing list. Review how matching IDs are handled below.

### Behaviour

An item whose `id` is already in the gallery replaces that item where it stands (a submitted item is stored as sent, so omitted optional fields are cleared); the rest are appended in the order given.

Items you do not send are left exactly as stored, captions in every language included.

Requires the `galleries:write` scope.

```json
{"openapi":"3.1.0","info":{"title":"Mimeeq External API","version":"1.1.0"},"tags":[{"name":"Galleries","description":"Manage named, localized media galleries used by product configurators. A gallery contains image or video items and their presentation metadata, such as captions and playback settings.\n\nUse this section to maintain reusable product imagery or video collections. Files manages the underlying media library; gallery operations manage the references and display settings rather than upload binary files.\n\n## What you can do\n\n| Task | Reference |\n| --- | --- |\n| Find available galleries | [List Galleries](https://help.mimeeq.com/developers/galleries/list-galleries) |\n| Add a new gallery | [Create Gallery](https://help.mimeeq.com/developers/galleries/create-gallery) |\n| Read one gallery | [Get Gallery](https://help.mimeeq.com/developers/galleries/get-gallery) |\n| Change gallery | [Update Gallery](https://help.mimeeq.com/developers/galleries/update-gallery) |\n| Change gallery items | [Update Gallery Items](https://help.mimeeq.com/developers/galleries/update-gallery-items) |\n| Add or Update Gallery Items | [Add or Update Gallery Items](https://help.mimeeq.com/developers/galleries/add-or-update-gallery-items) |\n| Remove Gallery Items | [Remove Gallery Items](https://help.mimeeq.com/developers/galleries/remove-gallery-items) |\n\n## Before you start\n\nYour API key needs `galleries:read` to read these resources. Use `galleries:write` for write operations.\n\n## Important behaviour\n\nGeneral gallery settings and media items have separate operations. PUT on items replaces the complete media list; POST adds or replaces supplied items; the remove operation removes selected IDs. Preserve all fields and caption translations on each submitted item. List responses are localized; Get without lang returns translation maps."}],"servers":[{"url":"https://admin.mimeeqapi.com","description":"Production API"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"API key sent as a bearer token (mk_live_… / mk_test_…)."}},"schemas":{"GalleriesDetail":{"type":"object","properties":{"data":{"type":"object","properties":{"galleryId":{"type":"string","pattern":"^GALL-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","description":"Gallery identifier (GALL-<uuid>)."},"name":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}]},{"type":"null"}],"description":"Translated text when `lang` is set, otherwise the full `{ language: text }` map. Languages with no text are omitted, and a field with no text at all is null."},"numberOfItems":{"type":"number"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"modifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}]},{"type":"null"}],"description":"Translated text when `lang` is set, otherwise the full `{ language: text }` map. Languages with no text are omitted, and a field with no text at all is null."},"numColumns":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"mediaType":{"type":"string","enum":["IMAGE","VIDEO"]},"mediaSource":{"type":"string","enum":["CUSTOM","MEDIA_LIBRARY"]},"caption":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}]},{"type":"null"}],"description":"Translated text when `lang` is set, otherwise the full `{ language: text }` map. Languages with no text are omitted, and a field with no text at all is null."},"fileId":{"anyOf":[{"type":"string"},{"type":"null"}]},"filePath":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"loop":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"autoplay":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["id","mediaType","mediaSource","caption","fileId","filePath","url","loop","autoplay"],"additionalProperties":false}}},"required":["galleryId","name","numberOfItems","createdAt","modifiedAt","description","numColumns","items"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Data schema used by Get Gallery (GET /v1/galleries/{galleryId}). Read that operation for usage, permissions and update rules. Required fields and allowed values are defined below; request and response shapes can differ."},"PublicError":{"description":"An API error response. Use code and the HTTP status to classify the failure, message and optional details for context, and requestId when reporting it. Edge firewall responses may omit requestId.","type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string","description":"Present on every error the API itself returns; absent when the edge firewall rejected the request."},"details":{"description":"Optional error-specific details (e.g. per-field validation reasons)."}}},"GalleriesItemsRequest2":{"type":"object","properties":{"items":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":255},"mediaType":{"type":"string","enum":["IMAGE","VIDEO"]},"mediaSource":{"type":"string","enum":["CUSTOM","MEDIA_LIBRARY"]},"caption":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]}},"fileId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"filePath":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"url":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"loop":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"autoplay":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["id","mediaType","mediaSource"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false,"description":"Data schema used by Add or Update Gallery Items (POST /v1/galleries/{galleryId}/items). Read that operation for usage, permissions and update rules. Required fields and allowed values are defined below; request and response shapes can differ."}}},"paths":{"/v1/galleries/{galleryId}/items":{"post":{"summary":"Add or Update Gallery Items","tags":["Galleries"],"description":"Add or update media items without re-sending the whole list.\n\nUse this to add the supplied members without submitting the entire existing list. Review how matching IDs are handled below.\n\n## Behaviour\n\nAn item whose `id` is already in the gallery replaces that item where it stands (a submitted item is stored as sent, so omitted optional fields are cleared); the rest are appended in the order given.\n\nItems you do not send are left exactly as stored, captions in every language included.\n\nRequires the `galleries:write` scope.","responses":{"200":{"description":"Successful response.","headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GalleriesDetail"}}}},"400":{"description":"Invalid request data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}}},"403":{"description":"The API key lacks the required scope (`scope_denied`), or the operation is not permitted for this account (`operation_not_permitted`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"429":{"description":"The API key exceeded its request rate (`rate_limit_exceeded`) or its monthly quota (`quota_exceeded`). Both carry `Retry-After`; the `RateLimit-*` headers accompany `rate_limit_exceeded` only, since a spent quota says nothing about the bucket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}}},"parameters":[{"name":"galleryId","in":"path","required":true,"schema":{"type":"string","pattern":"^GALL-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","description":"Gallery identifier (GALL-<uuid>)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GalleriesItemsRequest2"}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.mimeeq.com/api/galleries/add-or-update-gallery-items.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
