Delete media
DELETE https://api.json2video.com/v2/media/file
Removes a single file from S3 and from the account's media index. DELETE /v2/media/folder removes empty folder markers; non-empty folders must be cleared first.
Request — delete file
Path
DELETE /v2/media/file
Headers
| Header | Required | Value |
|---|---|---|
x-api-key |
yes | API key issued from the dashboard. Requires role render, editor, manager, or admin. |
Content-Type |
yes | application/json |
Body
{
"name": "clip.mp4",
"folder": "videos"
}
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Filename. |
folder |
string | no | Folder containing the file. Empty means root. |
Request — delete folder
Path
DELETE /v2/media/folder
Body
{ "folder": "videos/raw" }
The folder must be empty. The temp folder cannot be deleted.
Response
200 OK
{
"success": true,
"timestamp": "2026-05-12T10:49:52.924Z"
}
Errors
| Status | Message | Cause |
|---|---|---|
400 |
name is required |
Missing name on DELETE /v2/media/file. |
400 |
folder is required |
Missing folder on DELETE /v2/media/folder. |
400 |
Cannot delete root folder |
Attempted to delete /. |
400 |
Cannot delete the temp folder |
Attempted to delete temp. |
400 |
Folder is not empty. Delete all files first. |
Folder still contains files or sub-folders. |
403 |
Insufficient permissions |
API key role is below render. |
404 |
File not found |
File path does not exist. |
Examples
Delete a file
curl --location --request DELETE 'https://api.json2video.com/v2/media/file' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"name": "clip.mp4", "folder": "videos"}'
Delete a folder
curl --location --request DELETE 'https://api.json2video.com/v2/media/folder' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"folder": "videos/raw"}'