Base URL
By default, the Surge server runs on:--port flag when starting the server:
Authentication
All API requests require authentication using a Bearer token. See the Authentication page for details on obtaining and using tokens.Available Endpoints
Download Management
- POST /download - Start a new download
- GET /download?id= - Get status of a specific download
- GET /list - List all downloads with their current status
Download Control
- POST /pause?id= - Pause an active download
- POST /resume?id= - Resume a paused download
- DELETE /delete?id= - Delete a download (also accepts POST)
- PUT /update-url - Update the URL of a download
Real-time Updates
- GET /events - Server-Sent Events (SSE) stream for real-time download events
System
- GET /health - Health check endpoint
- GET /history - Retrieve completed download history
Response Format
All API responses use JSON format with appropriate HTTP status codes:200 OK- Successful request400 Bad Request- Invalid parameters or missing required fields404 Not Found- Download ID not found405 Method Not Allowed- Incorrect HTTP method500 Internal Server Error- Server-side error
Quick Example
Next Steps
- Authentication - Learn how to authenticate API requests
- Download Endpoint - Start and manage downloads
- Events Endpoint - Subscribe to real-time updates