diff --git a/docs/capabilities/server/media-uploads.mdx b/docs/capabilities/server/media-uploads.mdx index 7c6ba050..2e04da0f 100644 --- a/docs/capabilities/server/media-uploads.mdx +++ b/docs/capabilities/server/media-uploads.mdx @@ -165,6 +165,18 @@ await reddit.submitComment({ }); ``` +## Deleting uploaded media + +Devvit does not currently provide an API to delete a media asset after it has been uploaded with `media.upload()`. + +This limitation applies to runtime Reddit-hosted uploads from `media.upload()`, not static assets bundled with your app through `media.dir` in `devvit.json`. + +The `mediaId` and `mediaUrl` returned by `media.upload()` identify a Reddit-hosted asset, but the current media API only supports upload. If your app needs to stop showing uploaded media, remove your app's references to the asset and update or delete the Reddit content that embeds it. + +For example: + +- If you store uploaded media in Redis, delete the Redis key or remove the item from your app's list of visible assets. +- If the media is embedded in a post or comment, edit or delete that post or comment when your app has permission to do so. ## Canvas screenshots diff --git a/versioned_docs/version-0.14/capabilities/server/media-uploads.mdx b/versioned_docs/version-0.14/capabilities/server/media-uploads.mdx index 7c6ba050..2e04da0f 100644 --- a/versioned_docs/version-0.14/capabilities/server/media-uploads.mdx +++ b/versioned_docs/version-0.14/capabilities/server/media-uploads.mdx @@ -165,6 +165,18 @@ await reddit.submitComment({ }); ``` +## Deleting uploaded media + +Devvit does not currently provide an API to delete a media asset after it has been uploaded with `media.upload()`. + +This limitation applies to runtime Reddit-hosted uploads from `media.upload()`, not static assets bundled with your app through `media.dir` in `devvit.json`. + +The `mediaId` and `mediaUrl` returned by `media.upload()` identify a Reddit-hosted asset, but the current media API only supports upload. If your app needs to stop showing uploaded media, remove your app's references to the asset and update or delete the Reddit content that embeds it. + +For example: + +- If you store uploaded media in Redis, delete the Redis key or remove the item from your app's list of visible assets. +- If the media is embedded in a post or comment, edit or delete that post or comment when your app has permission to do so. ## Canvas screenshots