API and tokens
Integration accounts and their dp_ tokens, and the native external-client API scripts use to submit, follow, withdraw and acknowledge their own downloads.
- Desktop
- Server
On this page
- Integration accounts and tokens
- Issuing a token
- Each token is its own client
- Revoking a token
- Rotating a token
- Disabling or deleting the account
- Sending the token
- HTTP Basic on servers with passwords
- What a token can and cannot do
- Questions a token cannot answer
- The external-client API
- Check what you may do
- Submit a job
- Poll your jobs
- What a job says
- Get the files
- Acknowledge a delivery
- Withdraw a job
- Ask for a pause or resume
- Limits
- Errors
- The request API
- Related pages
Scripts and your own tools connect to DownloadPulse with an Integration token, a dp_… key that belongs to an Integration account. With it they can submit downloads, follow their own jobs, withdraw them, acknowledge finished deliveries and ask for a pause or resume, through the native external-client API (downloadpulse.external/1). This page covers the tokens and that API. For Sonarr and Radarr, which use the same tokens through their own download-client protocols, see Sonarr and Radarr.
Integration accounts and tokens
Link to this section: Integration accounts and tokensAPI tokens belong only to Integration accounts. Admin, User and ReadOnly accounts hold no API tokens, and there are no Admin, User or ReadOnly tokens. On a Standalone installation, the built-in Administrator holds none either.
An Admin manages them in Settings › Users & Access › Integration Accounts (Settings › Access & Integrations on a Standalone installation and the desktop app):
- several Integration accounts may exist. A default one called Automation always exists and holds no token until you issue one;
- an account may hold several tokens, each with its own label;
- an Integration account has no username, password or email, and cannot sign in to the interface.
Issuing a token
Link to this section: Issuing a token- In the account’s row, choose Issue Token.
- Enter a Token Label that names the automation that will use it. A label is required.
- Choose Issue Token.
- Copy the token from Copy Your New Token and choose Done.
The token is shown once, in that dialog only. DownloadPulse stores only a SHA-256 verifier of it in its database, so it cannot be shown again. If you lose it, issue another.
Through the API, an Admin issues a token with POST /api/accounts/{id}/tokens and a label. The raw token is in that response only.
Warning: treat a token like a password. Never put a raw token in
config.json, documentation, logs, bug reports or screenshots. Token verifiers are in the database, and so in backups.
Each token is its own client
Link to this section: Each token is its own client- A newly issued token is a new client. Two tokens of one account are two clients, and neither sees the other’s jobs.
- Every request a token submits is recorded as owned by its Integration account and that token. In a download’s details, Requested By shows
Integration · token "<label>".
Revoking a token
Link to this section: Revoking a token- In the token’s row, choose Revoke.
- Confirm with Revoke Token.
“Automation using this token loses access at once. Downloads it already submitted are not affected.” The next call with that token gets 401. Revoking never withdraws work the token submitted. Through the API: DELETE /api/accounts/{id}/tokens/{token_id}.
Rotating a token
Link to this section: Rotating a tokenRotation replaces a token while keeping its client: the new token continues the old one’s jobs, deliveries and controls. It is done through the API:
curl -u admin:'your-password' \
-H 'Content-Type: application/json' \
-d '{"label": "sonarr-2026", "succeeds": "<old token id>"}' \
https://downloadpulse.example/api/accounts/<account id>/tokens- The old token is revoked in the same step.
- The old token must belong to the same account, or to an account merged into it.
- It may already be revoked. Rotating from a revoked token is how you recover a client whose token was lost.
- Without a successor, a revoked token’s jobs stay, but no other credential can reach them.
Disabling or deleting the account
Link to this section: Disabling or deleting the account- Disable stops all of the account’s tokens at once and withdraws its outstanding requests. Those jobs then read
withdrawnwith the reasonwithdrawn_by_administrator. - Delete also revokes its tokens permanently.
Sending the token
Link to this section: Sending the tokenSend the token in the Authorization header:
curl -H 'Authorization: Bearer dp_REPLACE_WITH_TOKEN' \
https://downloadpulse.example/api/requestsAn invalid or revoked token is refused with 401 in every mode, including on an installation without sign-in.
Desktop: scripts reach the desktop app at its Local Port,
http://127.0.0.1:8095unless changed. It listens on this computer only.
HTTP Basic on servers with passwords
Link to this section: HTTP Basic on servers with passwordsWhen Username & Password sign-in is on, REST clients can also use a person’s username and password with standard HTTP Basic authentication:
curl -u operator:'your-password' https://downloadpulse.example/api/statsThat request then has that person’s role, and nothing beyond it. HTTP Basic does not work with OpenID Connect sign-in alone, and stops at once when Username & Password is turned off. When a request carries several credentials, DownloadPulse uses, in order: a valid browser session, then a Bearer token, then HTTP Basic.
Note: the external-client API on this page needs an Integration token. An Admin’s session or HTTP Basic credentials get
403there.
What a token can and cannot do
Link to this section: What a token can and cannot do| A token can | A token cannot |
|---|---|
| Submit downloads | Sign in to the interface |
List its own requests (GET /api/requests) and withdraw them (POST /api/requests/{id}/withdraw) |
See the Dashboard, Downloads, statistics pages, Settings, diagnostics or other accounts’ requests |
| Use the external-client API for its own jobs | Read or operate transfers (/api/torrents/* answers 403) |
Read /api/metrics for Prometheus |
Pause, delete, reorder, prioritize, route or retry a transfer directly |
Read the aggregate /api/stats |
Choose a service, engine, queue position or destination |
| Ask to pause or resume its own jobs, which DownloadPulse decides | Answer the questions only a person answers (see below) |
A browser extension’s token is a different kind: it gets 403 on every external-client route, and an Integration token gets 403 on the browser API. See Connected browsers.
Questions a token cannot answer
Link to this section: Questions a token cannot answerAn external submission never answers a question meant for a person. If one is needed, the submission is refused and nothing is added:
- a link to an address on your private network, while Local Network Connections asks for confirmation:
local_network_confirmation_required. With Skip Local Connection Confirmation on, such links are accepted; - a link that names one item inside a collection:
acquisition_scope_required.
External submissions always take every file (no file selection).
The external-client API
Link to this section: The external-client APIAll routes are under /api/external/v1 and need an Integration token. Requests and answers are JSON.
| Route | Does |
|---|---|
GET /api/external/v1/capabilities |
The protocol, this client’s ID, the profiles and source kinds it may use, and the limits |
POST /api/external/v1/jobs |
Submit one job |
GET /api/external/v1/jobs?after=&limit=&phase= |
This client’s jobs that changed since a cursor |
GET /api/external/v1/jobs/{id} |
One of this client’s jobs |
POST /api/external/v1/jobs/{id}/withdraw |
Withdraw this job’s request |
POST /api/external/v1/jobs/{id}/controls |
Ask for a pause or resume |
GET /api/external/v1/jobs/{id}/delivery |
Where the finished files are |
POST /api/external/v1/jobs/{id}/delivery/ack |
Acknowledge a delivery |
Every job is submitted into a category, which selects a Delivery Profile that authorizes this token. Set one up first in Integration Delivery Profiles. See Sonarr and Radarr for the fields.
Check what you may do
Link to this section: Check what you may docurl -H "Authorization: Bearer $DP_TOKEN" \
https://downloadpulse.example/api/external/v1/capabilitiesThe answer lists the profiles and source kinds this token may use, the operations, the job phases and delivery states, and the limits.
Submit a job
Link to this section: Submit a jobcurl -H "Authorization: Bearer $DP_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"idempotency_key": "sonarr-4711",
"category": "tv",
"source": {"kind": "magnet", "magnet": "magnet:?xt=urn:btih:..."},
"client_reference": "4711"
}' \
https://downloadpulse.example/api/external/v1/jobsA new job answers 201 with its id (job_…) and phase accepted.
| Field | Meaning |
|---|---|
idempotency_key |
Required. 1–200 printable characters, chosen by you, unique within this client |
category |
Required. A category of a profile that authorizes this token |
source |
Required. What to download (below) |
display_name |
Optional. Up to 256 characters |
client_reference |
Optional. Your own reference, up to 256 characters |
No other field is accepted: no service, engine, priority, queue position or destination.
Source kinds
Link to this section: Source kindskind |
Fields |
|---|---|
links |
links: 1–100 direct links (http(s), ftp, sftp, scp, rsync, WebDAV-style) |
magnet |
magnet |
nzb_link |
url, an http(s) link to an NZB, which DownloadPulse fetches and checks |
nzb |
nzb_base64 (up to 8 MB decoded) and filename (*.nzb), checked before it is accepted |
torrent |
torrent_base64 (up to 16 MB decoded) and filename (*.torrent) |
The profile’s Source Types must permit the kind. Metalink uploads, link files and alternate sources are not supported here, and are refused with unsupported_source.
Idempotency
Link to this section: Idempotency- The same key with the same request answers the same job (
200) and never adds a second download. - The same key with a different request (source, category,
display_nameorclient_reference) is refused with409 idempotency_conflict, and nothing is added. - Different keys are different jobs, even for identical content. The work itself may still be shared by one transfer.
- If a submission’s outcome is unknown (
503 submission_outcome_unknown), retry with the same key.
Poll your jobs
Link to this section: Poll your jobscurl -H "Authorization: Bearer $DP_TOKEN" \
'https://downloadpulse.example/api/external/v1/jobs?after=0&limit=200'The answer holds the jobs whose cursor is greater than after, in cursor order, with next_cursor, more and high_water. Start from 0 for everything, then store next_cursor and poll with it to receive exactly the jobs that changed. Polling is the only way to follow jobs: there is no event stream. Filter with phase= if you need to.
Job IDs, delivery IDs, revisions and cursors survive a restart. Withdrawn and acknowledged jobs stay queryable. Only a database reset (Data & Maintenance) removes them; after one, a missing job answers 404. Treat it as gone rather than resubmitting it silently.
What a job says
Link to this section: What a job saysphase |
Meaning |
|---|---|
accepted |
Recorded, waiting to be resolved |
queued |
Waiting for capacity |
processing |
Resolving, downloading, verifying, extracting, paused (paused_by: client, operator or administrator), waiting for input, or served by another transfer still in progress |
completed |
A delivery was committed for every file the job needs |
failed |
The download failed, was cancelled or deleted, or the finished files cannot be delivered |
withdrawn |
This job’s request was withdrawn |
Each job also carries a reason, an actionability (none, wait, operator or resubmit), progress (including effective, the figure DownloadPulse shows as its main bar), an estimate of the time left while it downloads (always labelled an estimate), an error category, a revision and a cursor. A service refusing, a switch to another service, a recovery or an engine restart is not a failure: the phase follows DownloadPulse.
A job’s source is a summary only (kind, count, host names, info-hash and declared name). It never contains a full link, query, credential or payload.
Get the files
Link to this section: Get the filescurl -H "Authorization: Bearer $DP_TOKEN" \
https://downloadpulse.example/api/external/v1/jobs/job_.../deliveryThe delivery has a delivery_id, a generation, and a state: unavailable, partial, available, acknowledged or expired. When it is available, files[] gives each file’s name, relative_path, import_path and size, beneath the profile’s import_root. Read the files from that shared path. DownloadPulse copies, links and moves nothing.
- Every file is checked on disk again when the delivery is committed and on later inspections.
- If the files change (for example a new extraction), a new generation is committed.
- If they disappear, the delivery reads
unavailablewith a reason, and the phase stayscompleted. - After the profile’s Retention, the delivery is
expiredand its paths are no longer given. Nothing is deleted.
Acknowledge a delivery
Link to this section: Acknowledge a deliveryWhen you have imported the files, acknowledge that exact generation:
curl -H "Authorization: Bearer $DP_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"delivery_id": "dlv_...", "generation": 1}' \
https://downloadpulse.example/api/external/v1/jobs/job_.../delivery/ackAcknowledging records that this job’s interest is satisfied. It never deletes or releases files, and never affects another job. Repeating it answers already_acknowledged. A wrong or outdated generation is a conflict (delivery_mismatch, unknown_generation, or stale_generation with the current_generation).
Withdraw a job
Link to this section: Withdraw a jobcurl -X POST -H "Authorization: Bearer $DP_TOKEN" \
https://downloadpulse.example/api/external/v1/jobs/job_.../withdrawWithdrawing retires this job’s request. DownloadPulse cancels the work only if nobody else still needs it. It never cancels shared work, touches another requester’s request or deletes files. Repeating it answers already_withdrawn.
A “remove” before completion is a withdrawal; after completion it is an acknowledgement.
Ask for a pause or resume
Link to this section: Ask for a pause or resumecurl -H "Authorization: Bearer $DP_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"kind": "pause", "request_key": "pause-4711-1"}' \
https://downloadpulse.example/api/external/v1/jobs/job_.../controlsA control is advisory: DownloadPulse decides. Each request_key is idempotent; reusing one for the other kind is 409 control_conflict. The answer carries a disposition (honored, declined, revoked, superseded or pending), a reason and the effective state now (pausing, paused, held_by_operator or not_paused).
| Request | Decision |
|---|---|
| Pause, and this job is the only one that needs the work | honored / paused |
| Pause, and others need the work | declined / shared_interest |
| Pause while everything is paused, or a person already paused it | declined / globally_paused or paused_independently |
| Resume of this client’s own pause | honored / resumed |
| Resume when not paused | honored / not_paused, with no effect |
| Resume while a person’s or a global pause holds | declined. A client never lifts a person’s or a global pause |
| A finished, cancelled or deleted transfer | declined / already_settled |
| A withdrawn job | declined / job_withdrawn |
A client’s pause is released (revoked / shared_interest_joined) if another requester later needs the same work. It is retired if a person replaces it or uses Resume All.
| Limit | Value |
|---|---|
| Unsettled jobs per client | 2000 (429 client_job_limit) |
| Changes per client per minute | 120 (429 rate_limited) |
| Controls per job | 64 (429 control_limit) |
| Jobs per page | 200 |
| Links per submission | 100 |
| Uploaded NZB | 8 MB |
| Uploaded torrent | 16 MB |
Refusals look like {"detail": {"code": "…", "message": "…", "retryable": …}}.
| Status | Meaning |
|---|---|
401 |
Missing, invalid or revoked token |
403 |
Not an Integration token (client_credential_required), or a route a token may not use |
404 |
job_not_found: an unknown job and another client’s job look the same |
409 |
idempotency_conflict, control_conflict, delivery_mismatch, unknown_generation, stale_generation, duplicate_torrent |
413 / 422 |
An invalid, unsupported or refused submission, for example unknown_category, source_kind_not_permitted or profile_root_outside_downloads |
429 |
rate_limited, client_job_limit, control_limit |
503 |
source_unavailable or submission_outcome_unknown: retry with the same key |
unknown_category means either the category does not exist or this token is not authorized for it. The two look the same on purpose.
The request API
Link to this section: The request APIBesides the external-client API, a token can list and withdraw its own requests:
# Your own requests and their status
curl -H "Authorization: Bearer $DP_TOKEN" https://downloadpulse.example/api/requests
# Withdraw one
curl -X POST -H "Authorization: Bearer $DP_TOKEN" \
https://downloadpulse.example/api/requests/<request id>/withdrawWithdrawing is idempotent. The transfer stops only when no other outstanding request still needs it. Completed downloads and history are never touched.