> For the complete documentation index, see [llms.txt](https://developers.gamma.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.gamma.app/images/archive-image.md).

# POST /images/media/{savedMediaId}/archive

Remove a generated image (or other item you created) from the workspace media library without deleting the underlying file. Existing URLs continue to work.

## Archive a media item

> Removes an item you created (such as a generated image) from the workspace media library. The operation is idempotent - archiving an already archived item succeeds. The underlying file is not deleted: existing URLs continue to work.

```json
{"openapi":"3.0.0","info":{"title":"Gamma Public API","version":"1.0"},"tags":[{"name":"public-api","description":"Public API endpoints for external integrations"}],"servers":[{"url":"https://public-api.gamma.app","description":"Production"}],"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"API key for authentication"}},"schemas":{"ArchiveImageResponse":{"type":"object","properties":{"savedMediaId":{"type":"string","description":"The media library identifier of the archived item"},"archived":{"type":"boolean","description":"Confirmation that the item is archived"}},"required":["savedMediaId","archived"]}}},"paths":{"/v1.0/images/media/{savedMediaId}/archive":{"post":{"description":"Removes an item you created (such as a generated image) from the workspace media library. The operation is idempotent - archiving an already archived item succeeds. The underlying file is not deleted: existing URLs continue to work.","operationId":"archiveImage","parameters":[{"name":"savedMediaId","required":true,"in":"path","description":"The media library identifier of the item to archive, as returned in `image.savedMediaId` by the image generation status endpoint","schema":{"type":"string"}}],"responses":{"200":{"description":"Item archived successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveImageResponse"}}}},"400":{"description":"Invalid request parameters"},"401":{"description":"Invalid or missing API key"},"403":{"description":"Access denied or feature not available"},"404":{"description":"Item not found"}},"summary":"Archive a media item","tags":["public-api"]}}}}
```

{% hint style="info" %}
Pass the `savedMediaId` from `image.savedMediaId` on a completed [GET /images/{id}](/images/get-image-generation-status.md) response. Archiving is idempotent — repeating the request on an already archived item returns `200` with `"archived": true`.
{% endhint %}

## Related

* [GET /images/{id}](/images/get-image-generation-status.md) to retrieve `savedMediaId` after generation completes
* [POST /images](/images/create-image-generation.md) to generate a new standalone image
* [POST /gammas/{gammaId}/archive](/management/archive-gamma.md) to archive a Gamma document instead


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.gamma.app/images/archive-image.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
