Skip to main content

Download queue

Endpoints for viewing and managing the download queue.

Authentication

Most queue endpoints are publicly accessible for viewing. Admin authorization is required for modifications.

EndpointAuth Level
GET /api/queuePublic
GET /api/queue/:idPublic
DELETE /api/queue/:idAdmin
POST /api/queue/:id/retryAdmin
POST /api/queue/cleanupAdmin
GET /api/queue/eventsPublic

List queue

Returns the current download queue with all active and pending items.

GET /api/queue

Request parameters

ParameterTypeRequiredDescription
pageintegerNoPage number (default: 1)
limitintegerNoItems per page (default: 20, max: 100)
statusstringNoFilter by status
movieIdstringNoFilter by movie ID
seriesIdstringNoFilter by series ID

Status filter values

StatusDescription
downloadingCurrently downloading
queuedWaiting to download
completedDownload finished
failedDownload failed
warningDownload with warnings
pausedPaused download

Response codes

CodeDescription
200Success
401Authentication required (if not public)

Response schema

{
"items": [
{
"id": "string",
"downloadId": "string",
"title": "string",
"status": "string",
"trackedDownloadStatus": "string",
"trackedDownloadState": "string",
"protocol": "string",
"downloadClient": "string",
"downloadClientId": "string",
"indexer": "string",
"outputPath": "string",
"size": "integer",
"sizeleft": "integer",
"timeleft": "string",
"estimatedCompletionTime": "string",
"statusMessages": [
{
"title": "string",
"messages": ["string"]
}
],
"errorMessage": "string",
"episodeIds": ["string"],
"movieId": "string",
"seriesId": "string",
"added": "string",
"started": "string",
"ended": "string",
"quality": "string",
"qualityScore": "integer"
}
],
"totalRecords": "integer",
"page": "integer",
"pageSize": "integer"
}

Download status values

StatusDescription
downloadingActive download in progress
pausedDownload is paused
queuedWaiting in download client queue
completedFinished successfully
failedDownload failed
warningCompleted with warnings

Tracked download states

StateDescription
downloadingCurrently downloading
importPendingDownload complete, waiting for import
importingCurrently importing to library
importedSuccessfully imported
failedPendingFailed, waiting for retry
failedFailed and will not retry
ignoredIgnored by user

Example request

curl -H "x-api-key: cinephage_your_key_here" \
"http://localhost:3000/api/queue?page=1&limit=10&status=downloading"

Example response

{
"items": [
{
"id": "q_550e8400-e29b-41d4-a716-446655440021",
"downloadId": "dl_550e8400-e29b-41d4-a716-446655440020",
"title": "Inception.2010.1080p.BluRay.x264-Group",
"status": "downloading",
"trackedDownloadStatus": "ok",
"trackedDownloadState": "downloading",
"protocol": "torrent",
"downloadClient": "qBittorrent",
"downloadClientId": "c10e8400-e29b-41d4-a716-446655440030",
"indexer": "Indexer1",
"outputPath": "/downloads/movies/Inception.2010.1080p.BluRay.x264-Group",
"size": 10485760000,
"sizeleft": 5242880000,
"timeleft": "00:45:00",
"estimatedCompletionTime": "2024-01-15T11:15:00Z",
"statusMessages": [],
"errorMessage": null,
"movieId": "550e8400-e29b-41d4-a716-446655440000",
"seriesId": null,
"added": "2024-01-15T10:30:00Z",
"started": "2024-01-15T10:30:05Z",
"ended": null,
"quality": "Bluray-1080p",
"qualityScore": 100
}
],
"totalRecords": 1,
"page": 1,
"pageSize": 10
}

Get queue item

Returns details for a specific queue item.

GET /api/queue/:id

Path parameters

ParameterTypeDescription
idstringQueue item ID

Response codes

CodeDescription
200Success
404Queue item not found

Response schema

Same as individual items in the list queue response.


Remove from queue

Removes a download from the queue.

DELETE /api/queue/:id

Path parameters

ParameterTypeDescription
idstringQueue item ID

Query parameters

ParameterTypeRequiredDescription
removeFromClientbooleanNoAlso remove from download client (default: true)
blocklistbooleanNoAdd to blocklist (default: false)

Response codes

CodeDescription
204Deleted successfully
401Authentication required
403Admin authorization required
404Queue item not found

Example request

curl -X DELETE \
-H "x-api-key: cinephage_your_key_here" \
"http://localhost:3000/api/queue/q_550e8400-e29b-41d4-a716-446655440021?removeFromClient=true&blocklist=true"

Retry failed item

Retries a failed download.

POST /api/queue/:id/retry

Path parameters

ParameterTypeDescription
idstringQueue item ID

Response codes

CodeDescription
200Retry initiated
401Authentication required
403Admin authorization required
404Queue item not found
409Item not in failed state

Response schema

{
"success": "boolean",
"message": "string"
}

Example request

curl -X POST \
-H "x-api-key: cinephage_your_key_here" \
http://localhost:3000/api/queue/q_550e8400-e29b-41d4-a716-446655440021/retry

Cleanup queue

Removes completed and failed items from the queue.

POST /api/queue/cleanup

Request body schema

FieldTypeRequiredDescription
removeCompletedbooleanNoRemove completed items (default: true)
removeFailedbooleanNoRemove failed items (default: true)

Response codes

CodeDescription
200Cleanup completed
401Authentication required
403Admin authorization required

Response schema

{
"success": "boolean",
"removedCount": "integer",
"message": "string"
}

Example request

curl -X POST \
-H "Content-Type: application/json" \
-H "x-api-key: cinephage_your_key_here" \
-d '{"removeCompleted": true, "removeFailed": true}' \
http://localhost:3000/api/queue/cleanup

Queue events

SSE endpoint for real-time queue updates.

GET /api/queue/events

Response format

Server-Sent Events stream with JSON payloads.

Event types

EventDescription
queueItemAddedNew item added to queue
queueItemUpdatedQueue item status changed
queueItemRemovedItem removed from queue
queueCompletedDownload completed
queueFailedDownload failed

Example event

event: queueItemUpdated
data: {"id":"q_550e8400-e29b-41d4-a716-446655440021","status":"downloading","progress":50}

Example request

const eventSource = new EventSource('http://localhost:3000/api/queue/events');

eventSource.addEventListener('queueItemUpdated', (event) => {
const data = JSON.parse(event.data);
console.log('Queue item updated:', data);
});

Download protocols

Torrent

Torrent downloads use magnet links or .torrent files.

FieldDescription
protocoltorrent
downloadClientqBittorrent, Transmission, etc.
sizeTotal size in bytes
sizeleftRemaining size in bytes
seedersNumber of seeders
leechersNumber of leechers

Usenet

Usenet downloads use NZB files.

FieldDescription
protocolusenet
downloadClientSABnzbd, NZBGet, etc.
sizeTotal size in bytes
sizeleftRemaining size in bytes

Download client operations

Test connection

Tests the connection to a download client.

POST /api/download-clients/:id/test

Response codes

CodeDescription
200Connection successful
400Connection failed
401Authentication required
403Admin authorization required

See Also

  • Search — Search and grab endpoints
  • Movies — Movie library endpoints
  • TV — TV series and episode endpoints