Delete a media file
delete_mediaPermanently delete a media file from the library. Refused with a conflict (MEDIA_IN_USE) while the file is still used by a post that has not published yet (draft, scheduled, pending approval or publishing) or by a template; the error lists those posts and templates, so detach the file with update_post / update_template or remove them with archive_post / delete_template first. A 502 (MEDIA_STORAGE_DELETE_FAILED) means storage refused the file and nothing was deleted: the file is still in the library, so call delete_media again later rather than reporting it gone.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"mediaId": "<mediaId>"
},
"name": "delete_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mediaId | Yes | The media ID (from list_media) | |
| organizationId | No | Organization to act in — an id from list_organizations. Required when this connection was authorized for more than one organization; omit it when there is only one. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No |