/delete endpoint allows you to remove a download from Surge’s download list. This stops the download (if active) and removes it from tracking.
DELETE /delete
Remove a download from the system.Query Parameters
The unique download ID to delete. This is the ID returned when the download was created.
Request
This endpoint accepts bothDELETE and POST methods:
Both
DELETE and POST methods are supported for compatibility with different HTTP clients and environments that may have restrictions on DELETE requests.Response
Returns a JSON object confirming the delete operation:Confirmation that the download was deleted. Always returns
"deleted".The ID of the deleted download.
Response Example
Examples
Behavior
When you delete a download:- Download stopped: If the download is active, it will be stopped immediately
- State removed: The download’s state file is removed from disk
- List updated: The download is removed from the list returned by
/list - File preserved: The actual downloaded file (if any) is NOT deleted from disk
Deleting Multiple Downloads
To delete multiple downloads, make separate API calls for each download ID:Error Responses
Use Cases
- Clean Up: Remove completed downloads from the list
- Cancel Downloads: Stop and remove unwanted downloads
- Error Recovery: Delete failed downloads before retrying
- List Management: Keep the download list clean and organized
- Automation: Programmatically remove old completed downloads
Delete vs Pause
| Operation | Download Stops | Removed from List | State Preserved | Can Resume |
|---|---|---|---|---|
| Delete | Yes | Yes | No | No |
| Pause | Yes | No | Yes | Yes |