---
title: "Delete an uploaded media file"
method: DELETE
path: "/media/{mediaId}"
tags: ["Media"]
---

# Delete an uploaded media file

`DELETE /media/{mediaId}`

Delete a media record and its stored object. If the media belonged to a
scheduled post, the post is demoted to draft and must be scheduled again.
Media cannot be removed while its post is publishing or after the group
has reached published or failed status.

## Path parameters

- `mediaId` string, required

## Response `200`

Media deleted

- object
  - `success` boolean, required
  - `postGroupDemoted` boolean
  - `message` string
  - `groupAlreadyMissing` boolean
  - `mediaWasOrphan` boolean
  - `thumbnailCleared` boolean
  - `coverCleared` boolean

## Other responses

- `400` — Invalid media ID, or media belongs to a published or failed post
- `404` — Media file not found
- `409` — Post is publishing or changed state concurrently; retry later
- `500` — Failed to delete media

---

[API](https://skmtc.dev/publora/apis/publora-api.md) · [All operations](https://skmtc.dev/publora/apis/publora-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/publora/publora-api/revisions/a1534a88d80a/schema)
