Delete Media
Delete an uploaded media file from storage. Removes the file from CDN and marks it as expired. Cannot delete media that is attached to a published post.
delete_media
Delete an uploaded media file from storage. Removes the file from CDN and marks it as expired. Cannot delete media that is attached to a published post.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
mediaId | string | yes | The media ID to delete. |
workspaceId | string | no | Workspace ID. Required if your API key accesses multiple workspaces. |
When to use
Remove a media asset from a workspace. Soft-deletes the record and prevents future posts from attaching it. Already-published posts referencing the media are unaffected — the live content on the target network keeps its own copy.
Example
{
"workspaceId": "wks_01H...",
"mediaId": "med_01H..."
}Response: { "success": true } or 404 if not found.
Gotchas
- Deleted media cannot be reattached to new posts. If you need the asset back, re-upload.
- Scheduled or draft posts that reference the deleted media will fail at delivery time with a
media_not_founderror. If you're sweeping unused media, cross-check against pending posts first vialist_posts+ a filter on status. - Deletion does not free the
idempotencyKeyof posts that used it.
List Media
List uploaded media files. Returns up to 50 items per page. Use offset to paginate. Media expires after 7 days unless used in a published post.
List Connected Accounts
List active connected social media accounts. Returns account IDs needed for the accountId parameter in publish_post. Only shows accounts with status "active" (c