API reference
Delete an uploaded file and free its storage.
https://api.betterpost.dev/v1/mediaPosts that already published keep their content on the networks; future posts must not reference the deleted URL.
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The publicUrl returned by create a media upload. |
curl -s -X DELETE https://api.betterpost.dev/v1/media \
-H "x-access-key: $BETTERPOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://assets.betterpost.dev/proj_123/2026/10/med_7h2k9d4s1m6q3w8e0r5t2y7u-banner.png" }'200 OK
{ "success": true, "freedBytes": 482133 }freedBytes is the stored size of the file (0 if it was never uploaded).
| Status | Code | When |
|---|---|---|
200 | The file was deleted. | |
400 | media_not_found | No media with this URL in this project. |
400 | validation_error | url is missing, or an unknown field was sent. |
401 | unauthorized | Missing or unknown API key. |
429 | rate_limited | More than 120 requests per minute. |