Delete Media
Delete a media file from your workspace.
Delete a media file from your workspace.
/api/v1/media/{mediaId}Permanently delete a media file and its thumbnail from storage.
Replace {mediaId} with the id of the media file to delete.
curl --request DELETE \
--url https://dopost.co/api/v1/media/<mediaId> \
--header 'x-api-key: <apiKey>'curl --request DELETE \
--url https://dopost.co/api/v1/media/<mediaId> \
--header 'x-api-key: <apiKey>'{
"message": "Media deleted",
"mediaId": "cm3abc123def456"
}{
"message": "Media deleted",
"mediaId": "cm3abc123def456"
}This action is irreversible. The file and its thumbnail will be permanently removed from storage.
Posts that reference the deleted media URL will keep their existing content — the URL will still appear in the post data, but the file will no longer be accessible.
| Status | Error | Cause |
|---|---|---|
401 | Invalid or missing API key | Bad or missing x-api-key header |
404 | Media not found | The mediaId doesn't exist in your workspace |
429 | Rate limit exceeded | Too many requests. Check X-RateLimit-* response headers and retry after the indicated time |