Skip to main content
The /pause endpoint allows you to pause an active download. Paused downloads can be resumed later from the same position using the resume endpoint.

POST /pause

Pause a download that is currently active.

Query Parameters

id
string
required
The unique download ID to pause. This is the ID returned when the download was created.

Request

curl -X POST "http://localhost:1700/pause?id=550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

Returns a JSON object confirming the pause operation:
status
string
Confirmation that the download was paused. Always returns "paused".
id
string
The ID of the paused download.

Response Example

{
  "status": "paused",
  "id": "550e8400-e29b-41d4-a716-446655440000"
}

Examples

curl -X POST "http://localhost:1700/pause?id=550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_TOKEN"

Behavior

When you pause a download:
  1. State is saved: The current download progress is saved to disk
  2. Connections close: All active connections for this download are closed
  3. Resources freed: Memory and network resources are released
  4. Resumable: The download can be resumed later from the exact same position

Pausing Multiple Downloads

To pause multiple downloads, you need to make separate API calls for each download ID:
const downloadIds = [
  '550e8400-e29b-41d4-a716-446655440000',
  '660e8400-e29b-41d4-a716-446655440001',
  '770e8400-e29b-41d4-a716-446655440002'
];

for (const id of downloadIds) {
  await fetch(`http://localhost:1700/pause?id=${id}`, {
    method: 'POST',
    headers: { 'Authorization': 'Bearer YOUR_TOKEN' }
  });
}

Error Responses

Use Cases

  • Bandwidth Management: Pause large downloads during peak usage times
  • User Control: Let users pause downloads manually through a UI
  • Resource Constraints: Free up resources when system load is high
  • Network Changes: Pause before switching networks (e.g., WiFi to mobile data)
  • Scheduled Downloads: Pause during business hours, resume at night
  • Resume - Resume a paused download
  • List - Check which downloads are paused
  • Events - Receive real-time pause notifications