Back to Transmission

Transmission's RPC specification

docs/rpc-spec.md

4.1.147.2 KB
Original Source

[!IMPORTANT] Transmisson 4.1.0 (rpc_version_semver 6.0.0) added support for the JSON-RPC 2.0 protocol and converted all RPC strings to snake_case.

The old bespoke RPC protocol, and the old mix of kebab-case and camelCase strings, are still supported in Transmission 4 but are deprecated and will be removed in the future. People using the old protocol should update their code!

For documentation of the old RPC protocol and strings, please consult documentation from previous versions. https://github.com/transmission/transmission/blob/4.0.6/docs/rpc-spec.md

Transmission's RPC specification

This document describes a protocol for interacting with Transmission sessions remotely.

1.1 Terminology

The JSON terminology in RFC 8259 is used. RPC requests and responses are formatted in JSON.

1.2 Tools

If transmission-remote is called with a --debug argument, its RPC traffic to the Transmission server will be dumped to the terminal. This can be useful when you want to compare requests in your application to another for reference.

If transmission-qt is run with an environment variable TR_RPC_VERBOSE set, it too will dump the RPC requests and responses to the terminal for inspection.

Lastly, using the browser's developer tools in the Transmission web client is always an option.

1.3 Libraries of ready-made wrappers

Some people outside of the Transmission project have written libraries that wrap this RPC API. These aren't supported by the Transmission project, but are listed here in the hope that they may be useful:

LanguageLink
C# .NET10https://www.nuget.org/packages/Transmission.API.RPC.NET/
C#https://www.nuget.org/packages/Transmission.API.RPC
Gohttps://github.com/hekmon/transmissionrpc
Pythonhttps://github.com/Trim21/transmission-rpc
Rusthttps://crates.io/crates/transmission-rpc

2 Message format

Transmission follows the JSON-RPC 2.0 specification and supports the entirety of it, except that parameters by-position is not supported, meaning the request parameters must be an Object.

Response parameters are returned in the result Object.

Example request

json
{
   "jsonrpc": "2.0",
   "params": {
     "fields": [ "version" ]
   },
   "method": "session_get",
   "id": 912313
}

Example response

json
{
   "jsonrpc": "2.0",
   "result": {
      "version": "4.1.0-dev (ae226418eb)"
   },
   "id": 912313
}

2.1 Error data

JSON-RPC 2.0 allows for additional information about an error be included in the data key of the Error object in an implementation-defined format.

In Transmission, this key is an Object that includes:

  1. An optional error_string string that provides additional information that is not included in the message key of the Error object.
  2. An optional result Object that contains additional keys defined by the method.
json
{
   "jsonrpc": "2.0",
   "error": {
      "code": 7,
      "message": "HTTP error from backend service",
      "data": {
         "error_string": "Couldn't test port: No Response (0)",
         "result": {
            "ip_protocol": "ipv6"
         }
      }
   },
   "id": 912313
}

2.2 Transport mechanism

HTTP POSTing a JSON-encoded request is the preferred way of communicating with a Transmission RPC server. The current Transmission implementation has the default URL as http://host:9091/transmission/rpc. Clients may use this as a default, but should allow the URL to be reconfigured, since the port and path may be changed to allow mapping and/or multiple daemons to run on a single server.

The RPC server will normally return HTTP 200 regardless of whether the request succeeded. For JSON-RPC 2.0 notifications, HTTP 204 will be returned.

2.2.1 CSRF protection

Most Transmission RPC servers require a X-Transmission-Session-Id header to be sent with requests, to prevent CSRF attacks.

When your request has the wrong id -- such as when you send your first request, or when the server expires the CSRF token -- the Transmission RPC server will return an HTTP 409 error with the right X-Transmission-Session-Id in its own headers.

So, the correct way to handle a 409 response is to update your X-Transmission-Session-Id and to resend the previous request.

2.2.2 DNS rebinding protection

Additional check is being made on each RPC request to make sure that the client sending the request does so using one of the allowed hostnames by which RPC server is meant to be available.

If host whitelisting is enabled (which is true by default), Transmission inspects the Host: HTTP header value (with port stripped, if any) and matches it to one of the whitelisted names. Regardless of host whitelist content, localhost and localhost. domain names as well as all the IP addresses are always implicitly allowed.

For more information on configuration, see Editing Configuration Files documentation for rpc_host_whitelist_enabled and rpc_host_whitelist keys.

2.2.3 Authentication

Enabling authentication is an optional security feature that can be enabled on Transmission RPC servers. Authentication occurs by method of HTTP Basic Access Authentication.

If authentication is enabled, Transmission inspects the Authorization: HTTP header value to validate the credentials of the request. The value of this HTTP header is expected to be Basic <b64 credentials>, where <b64 credentials> is equal to a base64 encoded string of the username and password (respectively), separated by a colon.

3 Torrent requests

3.1 Torrent action requests

Method namelibtransmission functionDescription
torrent_starttr_torrentStartstart torrent
torrent_start_nowtr_torrentStartNowstart torrent disregarding queue position
torrent_stoptr_torrentStopstop torrent
torrent_verifytr_torrentVerifyverify torrent
torrent_reannouncetr_torrentManualUpdatere-announce to trackers now

Request parameters: ids, which specifies which torrents to use. All torrents are used if the ids parameter is omitted.

ids should be one of the following:

  1. an integer referring to a torrent id
  2. a list of torrent id numbers, SHA1 hash strings, or both
  3. a string, recently_active, for recently-active torrents

Note that integer torrent ids are not stable across Transmission daemon restarts. Use torrent hashes if you need stable ids.

Response parameters: none

3.2 Torrent mutator: torrent_set

Method name: torrent_set

Request parameters:

KeyValue TypeValue Description
bandwidth_prioritynumberthis torrent's bandwidth tr_priority_t
download_limitnumbermaximum download speed (kB/s)
download_limitedbooleantrue if download_limit is honored
files_unwantedarrayindices of file(s) to not download
files_wantedarrayindices of file(s) to download
groupstringThe name of this torrent's bandwidth group
honors_session_limitsbooleantrue if session upload limits are honored
idsarraytorrent list, as described in 3.1
labelsarrayarray of string labels
locationstringnew location of the torrent's content
peer_limitnumbermaximum number of peers
priority_higharrayindices of high-priority file(s)
priority_lowarrayindices of low-priority file(s)
priority_normalarrayindices of normal-priority file(s)
queue_positionnumberposition of this torrent in its queue [0...n)
seed_idle_limitnumbertorrent-level number of minutes of seeding inactivity
seed_idle_modenumberwhich seeding inactivity to use. See tr_idlelimit
seed_ratio_limitdoubletorrent-level seeding ratio
seed_ratio_modenumberwhich ratio to use. See tr_ratiolimit
sequential_downloadbooleandownload torrent pieces sequentially
sequential_download_from_piecenumberdownload from a specific piece when sequential download is enabled
tracker_addarrayDEPRECATED use tracker_list instead
tracker_liststringstring of announce URLs, one per line, and a blank line between tiers.
tracker_removearrayDEPRECATED use tracker_list instead
tracker_replacearrayDEPRECATED use tracker_list instead
upload_limitnumbermaximum upload speed (kB/s)
upload_limitedbooleantrue if upload_limit is honored

Just as an empty ids value is shorthand for "all ids", using an empty array for files_wanted, files_unwanted, priority_high, priority_low, or priority_normal is shorthand for saying "all files".

Response parameters: none

3.3 Torrent accessor: torrent_get

Method name: torrent_get.

Request parameters:

  1. An optional ids array as described in 3.1.
  2. A required fields array of keys. (see list below)
  3. An optional format string specifying how to format the torrents response field. Allowed values are objects (default) and table. (see "Response parameters" below)

Response parameters:

  1. A torrents array.

    If the format request was objects (default), torrents will be an array of objects, each of which contains the key/value pairs matching the request's fields arg. This was the only format before Transmission 3 and has some obvious programmer conveniences, such as parsing directly into Javascript objects.

    If the format was table, then torrents will be an array of arrays. The first row holds the keys and each remaining row holds a torrent's values for those keys. This format is more efficient in terms of JSON generation and JSON parsing.

  2. If the request's ids field was recently_active, a removed array of torrent-id numbers of recently-removed torrents.

Note: For more information on what these fields mean, see the comments in libtransmission/transmission.h. The 'source' column here corresponds to the data structure there.

KeyValue Typetransmission.h source
activity_datenumbertr_stat
added_datenumbertr_stat
availabilityarray (see below)tr_torrentAvailability()
bandwidth_prioritynumbertr_priority_t
bytes_completedarray (see below)n/a
commentstringtr_torrent_view
corrupt_evernumbertr_stat
creatorstringtr_torrent_view
date_creatednumbertr_torrent_view
desired_availablenumbertr_stat
done_datenumbertr_stat
download_dirstringtr_torrent
integernumbertr_stat
download_limitintegertr_torrent
download_limitedbooleantr_torrent
edit_datenumbertr_stat
errornumbertr_stat
error_stringstringtr_stat
etanumbertr_stat
eta_idlenumbertr_stat
file_countnumbertr_info
filesarray (see below)n/a
file_statsarray (see below)n/a
groupstringn/a
hash_stringstringtr_torrent_view
have_uncheckednumbertr_stat
have_validnumbertr_stat
honors_session_limitsbooleantr_torrent
idintegertr_torrent
is_finishedbooleantr_stat
is_privatebooleantr_torrent
is_stalledbooleantr_stat
labelsarray of stringstr_torrent
left_until_donenumbertr_stat
magnet_linkstringn/a
manual_announce_timenumberDEPRECATED don't use it, it never worked
max_connected_peersnumbertr_torrent
metadata_percent_completedoubletr_stat
namestringtr_torrent_view
peer_limitnumbertr_torrent
peersarray (see below)n/a
peers_connectednumbertr_stat
peers_fromobject (see below)n/a
peers_getting_from_usnumbertr_stat
peers_sending_to_usnumbertr_stat
percent_completedoubletr_stat
percent_donedoubletr_stat
piecesstring (see below)tr_torrent
piece_countnumbertr_torrent_view
piece_sizenumbertr_torrent_view
prioritiesarray (see below)n/a
primary_mime_typestringtr_torrent
queue_positionnumbertr_stat
rate_download (B/s)numbertr_stat
rate_upload (B/s)numbertr_stat
recheck_progressdoubletr_stat
seconds_downloadingnumbertr_stat
seconds_seedingnumbertr_stat
seed_idle_limitnumbertr_torrent
seed_idle_modenumbertr_inactivelimit
seed_ratio_limitdoubletr_torrent
seed_ratio_modenumbertr_ratiolimit
sequential_downloadbooleantr_torrent
sequential_download_from_piecenumbertr_torrent
size_when_donenumbertr_stat
start_datenumbertr_stat
statusnumber (see below)tr_stat
torrent_filestringtr_info
total_sizenumbertr_torrent_view
trackersarray (see below)n/a
tracker_liststringstring of announce URLs, one per line, with a blank line between tiers
tracker_statsarray (see below)n/a
uploaded_everintegertr_stat
upload_limitintegertr_torrent
upload_limitedbooleantr_torrent
upload_ratiodoubletr_stat
wantedarray (see below)n/a
webseedsarray of stringsDEPRECATED tr_tracker_view
webseeds_exarray (see below)n/a
webseeds_sending_to_usnumbertr_stat

availability: An array of piece_count numbers representing the number of connected peers that have each piece, or -1 if we already have the piece ourselves.

bytes_completed: An array of tr_info.filecount numbers. Each is the completed bytes for the corresponding file.

files: array of objects, each containing:

KeyValue Typetransmission.h source
bytes_completednumbertr_file_view
lengthnumbertr_file_view
namestringtr_file_view
begin_piecenumbertr_file_view
end_piecenumbertr_file_view

Files are returned in the order they are laid out in the torrent. References to "file indices" throughout this specification should be interpreted as the position of the file within this ordering, with the first file bearing index 0.

file_stats: a file's non-constant properties. An array of tr_info.filecount objects, in the same order as files, each containing:

KeyValue Typetransmission.h source
bytes_completednumbertr_file_view
wantedbooleantr_file_view
prioritynumbertr_file_view

peers: an array of objects, each containing:

KeyValue Typetransmission.h source
addressstringtr_peer_stat
bytes_to_clientnumbertr_peer_stat
bytes_to_peernumbertr_peer_stat
client_is_chokedbooleantr_peer_stat
client_is_interestedbooleantr_peer_stat
client_namestringtr_peer_stat
flag_strstringtr_peer_stat
is_downloading_frombooleantr_peer_stat
is_encryptedbooleantr_peer_stat
is_incomingbooleantr_peer_stat
is_uploading_tobooleantr_peer_stat
is_utpbooleantr_peer_stat
peer_idstringtr_peer_stat
peer_is_chokedbooleantr_peer_stat
peer_is_interestedbooleantr_peer_stat
portnumbertr_peer_stat
progressdoubletr_peer_stat
rate_to_client (B/s)numbertr_peer_stat
rate_to_peer (B/s)numbertr_peer_stat

peers_from: an object containing:

KeyValue Typetransmission.h source
from_cachenumbertr_stat
from_dhtnumbertr_stat
from_incomingnumbertr_stat
from_lpdnumbertr_stat
from_ltepnumbertr_stat
from_pexnumbertr_stat
from_trackernumbertr_stat

pieces: A bitfield holding piece_count flags which are set to 'true' if we have the piece matching that position. JSON doesn't allow raw binary data, so this is a base64-encoded string. (Source: tr_torrent)

priorities: An array of tr_torrentFileCount() numbers. Each is the tr_priority_t mode for the corresponding file.

status: A number between 0 and 6, where:

ValueMeaning
0Torrent is stopped
1Torrent is queued to verify local data
2Torrent is verifying local data
3Torrent is queued to download
4Torrent is downloading
5Torrent is queued to seed
6Torrent is seeding

trackers: array of objects, each containing:

KeyValue Typetransmission.h source
announcestringtr_tracker_view
idintegertr_tracker_view
scrapestringtr_tracker_view
sitenamestringtr_tracker_view
tiernumbertr_tracker_view

tracker_stats: array of objects, each containing:

KeyValue Typetransmission.h source
announcestringtr_tracker_view
announce_statenumbertr_tracker_view
download_countnumbertr_tracker_view
downloader_countnumbertr_tracker_view
has_announcedbooleantr_tracker_view
has_scrapedbooleantr_tracker_view
hoststringtr_tracker_view
idintegertr_tracker_view
is_backupbooleantr_tracker_view
last_announce_peer_countnumbertr_tracker_view
last_announce_resultstringtr_tracker_view
last_announce_start_timenumbertr_tracker_view
last_announce_succeededbooleantr_tracker_view
last_announce_timenumbertr_tracker_view
last_announce_timed_outbooleantr_tracker_view
last_scrape_resultstringtr_tracker_view
last_scrape_start_timenumbertr_tracker_view
last_scrape_succeededbooleantr_tracker_view
last_scrape_timenumbertr_tracker_view
last_scrape_timed_outbooleantr_tracker_view
leecher_countnumbertr_tracker_view
next_announce_timenumbertr_tracker_view
next_scrape_timenumbertr_tracker_view
scrapestringtr_tracker_view
scrape_statenumbertr_tracker_view
seeder_countnumbertr_tracker_view
sitenamestringtr_tracker_view
tiernumbertr_tracker_view

webseeds_ex: array of objects, each containing:

KeyValue Typetransmission.h source
urlstringtr_webseed_view
is_downloadingbooleantr_webseed_view
download_bytes_per_secondnumbertr_webseed_view

wanted: An array of tr_torrentFileCount() booleans, true if the corresponding file is to be downloaded. (Source: tr_file_view)

Note: For backwards compatibility, in the old bespoke API, wanted is serialized as an array of 0 or 1 that should be treated as booleans.

Example:

Say we want to get the name and total size of torrents #7 and #10.

Request:

json
{
   "jsonrpc": "2.0",
   "params": {
       "fields": [ "id", "name", "total_size" ],
       "ids": [ 7, 10 ]
   },
   "method": "torrent_get",
   "id": 39693
}

Response:

json
{
   "jsonrpc": "2.0",
   "result": {
      "torrents": [
         {
             "id": 10,
             "name": "Fedora x86_64 DVD",
             "total_size": 34983493932
         },
         {
             "id": 7,
             "name": "Ubuntu x86_64 DVD",
             "total_size": 9923890123
         }
      ]
   },
   "id": 39693
}

3.4 Adding a torrent

Method name: torrent_add

Request parameters:

KeyValue TypeDescription
cookiesstringpointer to a string of one or more cookies.
download_dirstringpath to download the torrent to
filenamestringfilename or URL of the .torrent file
labelsarrayarray of string labels
metainfostringbase64-encoded .torrent content
pausedbooleanif true, don't start the torrent
peer_limitnumbermaximum number of peers
bandwidth_prioritynumbertorrent's bandwidth tr_priority_t
files_wantedarrayindices of file(s) to download
files_unwantedarrayindices of file(s) to not download
priority_higharrayindices of high-priority file(s)
priority_lowarrayindices of low-priority file(s)
priority_normalarrayindices of normal-priority file(s)
sequential_downloadbooleandownload torrent pieces sequentially
sequential_download_from_piecenumberdownload from a specific piece when sequential download is enabled

Either filename or metainfo must be included. All other parameters are optional.

The format of the cookies should be NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie should contain. Set multiple cookies like this: name1=content1; name2=content2; etc. See libcurl documentation for more information.

Response parameters:

  • On success, a torrent_added object in the form of one of 3.3's torrent objects with the fields for id, name, and hash_string.

  • When attempting to add a duplicate torrent, a torrent_duplicate object in the same form is returned, but the response's result value is still success.

3.5 Removing a torrent

Method name: torrent_remove

KeyValue TypeDescription
idsarraytorrent list, as described in 3.1
delete_local_databooleandelete local data. (default: false)

Response parameters: none

3.6 Moving a torrent

Method name: torrent_set_location

Request parameters:

KeyValue TypeDescription
idsarraytorrent list, as described in 3.1
locationstringthe new torrent location
movebooleanif true, move from previous location. otherwise, search location for files (default: false)

Response parameters: none

3.7 Renaming a torrent's path

Method name: torrent_rename_path

For more information on the use of this function, see the transmission.h documentation of tr_torrentRenamePath(). In particular, note that if this call succeeds you'll want to update the torrent's files and name field with torrent_get.

Request parameters:

KeyValue TypeDescription
idsarraythe torrent list, as described in 3.1 (must only be 1 torrent)
pathstringthe path to the file or folder that will be renamed
namestringthe file or folder's new name

Response parameters: path, name, and id, holding the torrent ID integer

4 Session requests

4.1 Session parameters

KeyValue TypeDescription
alt_speed_downnumbermax global download speed (kB/s)
alt_speed_enabledbooleantrue means use the alt speeds
alt_speed_time_beginnumberwhen to turn on alt speeds (units: minutes after midnight)
alt_speed_time_daynumberwhat day(s) to turn on alt speeds (look at tr_sched_day)
alt_speed_time_enabledbooleantrue means the scheduled on/off times are used
alt_speed_time_endnumberwhen to turn off alt speeds (units: same)
alt_speed_upnumbermax global upload speed (kB/s)
anti_brute_force_enabledbooleantrue means to enable a basic brute force protection for RPC server
blocklist_enabledbooleantrue means enabled
blocklist_sizenumbernumber of rules in the blocklist
blocklist_urlstringlocation of the blocklist to use for blocklist_update
cache_size_mibnumberDEPRECATED This property will be removed in Transmission 5.0.0. Clients should stop using this property now.
config_dirstringlocation of transmission's configuration directory
default_trackersstringannounce URLs, one per line, and a blank line between tiers.
dht_enabledbooleantrue means allow DHT in public torrents
download_dirstringdefault path to download torrents
download_dir_free_spacenumberDEPRECATED Use the free_space method instead.
download_queue_enabledbooleanif true, limit how many torrents can be downloaded at once
download_queue_sizenumbermax number of torrents to download at once (see download_queue_enabled)
encryptionstringrequired, preferred, allowed
idle_seeding_limitnumbertorrents we're seeding will be stopped if they're idle for this long
idle_seeding_limit_enabledbooleantrue if the seeding inactivity limit is honored by default
incomplete_dirstringpath for incomplete torrents, when enabled
incomplete_dir_enabledbooleantrue means keep torrents in incomplete_dir until done
lpd_enabledbooleantrue means allow Local Peer Discovery in public torrents
peer_limit_globalnumbermaximum global number of peers
peer_limit_per_torrentnumbermaximum global number of peers
peer_port_random_on_startbooleantrue means pick a random peer port on launch
peer_portnumberport number
pex_enabledbooleantrue means allow PEX in public torrents
port_forwarding_enabledbooleantrue means ask upstream router to forward the configured peer port to transmission using UPnP or NAT-PMP
preferred_transportsstring[]preference of transport protocols, see Editing Configuration Files for details
queue_stalled_enabledbooleanwhether or not to consider idle torrents as stalled
queue_stalled_minutesnumbertorrents that are idle for N minuets aren't counted toward seed_queue_size or download_queue_size
rename_partial_filesbooleantrue means append .part to incomplete files
reqqnumberthe number of outstanding block requests a peer is allowed to queue in the client
rpc_version_minimumnumberDEPRECATED the minimum RPC API version supported
rpc_version_semverstringthe current RPC API version in a semver-compatible string
rpc_versionnumberDEPRECATED the current RPC API version
script_torrent_added_enabledbooleanwhether or not to call the added script
script_torrent_added_filenamestringfilename of the script to run
script_torrent_done_enabledbooleanwhether or not to call the done script
script_torrent_done_filenamestringfilename of the script to run
script_torrent_done_seeding_enabledbooleanwhether or not to call the seeding_done script
script_torrent_done_seeding_filenamestringfilename of the script to run
seed_queue_enabledbooleanif true, limit how many torrents can be uploaded at once
seed_queue_sizenumbermax number of torrents to uploaded at once (see seed_queue_enabled)
seed_ratio_limitdoublethe default seed ratio for torrents to use
seed_ratio_limitedbooleantrue if seed_ratio_limit is honored by default
sequential_downloadbooleantrue means sequential download is enabled by default for added torrents
session_idstringthe current X-Transmission-Session-Id value
speed_limit_downintegermax global download speed (kB/s)
speed_limit_down_enabledbooleantrue means enabled
speed_limit_upintegermax global upload speed (kB/s)
speed_limit_up_enabledbooleantrue means enabled
start_added_torrentsbooleantrue means added torrents will be started right away
tcp_enabledbooleanDEPRECATED Use preferred_transports instead
trash_original_torrent_filesbooleantrue means the .torrent file of added torrents will be deleted
unitsobjectsee below
utp_enabledbooleanDEPRECATED Use preferred_transports instead
versionstringlong version string $version ($revision)

units: an object containing:

KeyValue Typetransmission.h source
speed_unitsarray4 strings: KB/s, MB/s, GB/s, TB/s
speed_bytesnumbernumber of bytes in a KB (1000 for kB; 1024 for KiB)
size_unitsarray4 strings: KB/s, MB/s, GB/s, TB/s
size_bytesnumbernumber of bytes in a KB (1000 for kB; 1024 for KiB)
memory_unitsarray4 strings: KB/s, MB/s, GB/s, TB/s
memory_bytesnumbernumber of bytes in a KB (1000 for kB; 1024 for KiB)

4.1.1 Mutators

Method name: session_set

Request parameters: the mutable properties from 4.1's parameters, i.e. all of them except:

  • blocklist_size
  • config_dir
  • rpc_version_minimum,
  • rpc_version_semver
  • rpc_version
  • session_id
  • tcp_enabled
  • units
  • version

Response parameters: none

4.1.2 Accessors

Method name: session_get

Request parameters: an optional fields array of keys (see 4.1)

Response parameters: key/value pairs matching the request's fields parameter if present, or all supported fields (see 4.1) otherwise.

4.2 Session statistics

Method name: session_stats

Request parameters: none

Response parameters:

KeyValue TypeDescription
active_torrent_countnumber
download_speednumber
paused_torrent_countnumber
torrent_countnumber
upload_speednumber
cumulative_statsstats object (see below)
current_statsstats object (see below)

A stats object contains:

KeyValue Typetransmission.h source
uploaded_bytesnumbertr_session_stats
downloaded_bytesnumbertr_session_stats
files_addednumbertr_session_stats
seconds_activenumbertr_session_stats
session_countnumbertr_session_stats

4.3 Blocklist

Method name: blocklist_update

Request parameters: none

Response parameters: a number blocklist_size

4.4 Port checking

This method tests to see if your incoming peer port is accessible from the outside world.

Method name: port_test

Request parameters: an optional parameter ip_protocol. ip_protocol is a string specifying the IP protocol version to be used for the port test. Set to ipv4 to check IPv4, or set to ipv6 to check IPv6. For backwards compatibility, it is allowed to omit this parameter to get the behaviour before Transmission 4.1.0, which is to check whichever IP protocol the OS happened to use to connect to our port test service, frankly not very useful.

Response parameters:

KeyValue TypeDescription
port_is_openbooleantrue if port is open, false if port is closed
ip_protocolstringipv4 if the test was carried out on IPv4, ipv6 if the test was carried out on IPv6, unset if it cannot be determined

4.5 Session shutdown

This method tells the Transmission session to shut down.

Method name: session_close

Request parameters: none

Response parameters: none

4.6 Queue movement requests

Method nametransmission.h source
queue_move_toptr_torrentQueueMoveTop()
queue_move_uptr_torrentQueueMoveUp()
queue_move_downtr_torrentQueueMoveDown()
queue_move_bottomtr_torrentQueueMoveBottom()

Request parameters:

KeyValue TypeDescription
idsarraytorrent list, as described in 3.1.

Response parameters: none

4.7 Free space

This method tests how much free space is available in a client-specified folder.

Method name: free_space

Request parameters:

KeyValue typeDescription
pathstringthe directory to query

Response parameters:

KeyValue typeDescription
pathstringsame as the Request parameter
size_bytesnumberthe size, in bytes, of the free space in that directory
total_sizenumberthe total capacity, in bytes, of that directory

4.8 Bandwidth groups

4.8.1 Bandwidth group mutator: group_set

Method name: group_set

Request parameters:

KeyValue typeDescription
honors_session_limitsbooleantrue if session upload limits are honored
namestringBandwidth group name
speed_limit_downintegermax global download speed (kB/s)
speed_limit_down_enabledbooleantrue means enabled
speed_limit_upintegermax global upload speed (kB/s)
speed_limit_up_enabledbooleantrue means enabled

Response parameters: none

4.8.2 Bandwidth group accessor: group_get

Method name: group_get

Request parameters: An optional parameter group. group is either a string naming the bandwidth group, or a list of such strings. If group is omitted, all bandwidth groups are used.

Response parameters:

KeyValue typeDescription
grouparrayA list of bandwidth group description objects

A bandwidth group description object has:

KeyValue typeDescription
honors_session_limitsbooleantrue if session upload limits are honored
namestringBandwidth group name
speed_limit_downintegermax global download speed (kB/s)
speed_limit_down_enabledbooleantrue means enabled
speed_limit_upintegermax global upload speed (kB/s)
speed_limit_up_enabledbooleantrue means enabled

5 Protocol versions

This section lists the changes that have been made to the RPC protocol.

There are two ways to check for API compatibility. Since most developers know semver, session_get's rpc_version_semver is the recommended way. That value is a semver-compatible string of the RPC protocol version number.

DEPRECATED Since Transmission predates the semver 1.0 spec, the previous scheme was for the RPC version to be a whole number and to increment it whenever a change was made. That is session_get's rpc_version. rpc_version_minimum lists the oldest version that is compatible with the current version; i.e. an app coded to use rpc_version_minimum would still work on a Transmission release running rpc_version.

Starting from rpc-version-semver 6.0.0, Transmission returns the RPC version in an HTTP header X-Transmission-Rpc-Version: {rpc_version_semver} in the CSRF HTTP 409 response. This is so that clients supporting both JSON-RPC and the old bespoke API can determine which scheme to use without making any extra requests. Example: X-Transmission-Rpc-Version: 6.0.0

Breaking changes are denoted with a :bomb: emoji.

Transmission 1.30 (rpc-version-semver 1.0.0, rpc-version: 1)

Initial revision.

Transmission 1.40 (rpc-version-semver 1.1.0, rpc-version: 2)

MethodDescription
torrent-getnew port to peers

Transmission 1.41 (rpc-version-semver 1.2.0, rpc-version: 3)

MethodDescription
session-getnew arg version
torrent-getnew arg downloaders
torrent-removenew method

Transmission 1.50 (rpc-version-semver 1.3.0, rpc-version: 4)

MethodDescription
session-getnew arg rpc-version-minimum
session-getnew arg rpc-version
session-statsadded cumulative-stats
session-statsadded current-stats
torrent-getnew arg downloadDir

Transmission 1.60 (rpc-version-semver 2.0.0, rpc-version: 5)

MethodDescription
session-get:bomb: renamed peer-limit to peer-limit-global
session-get:bomb: renamed pex-allowed to pex-enabled
session-get:bomb: renamed port to peer-port
torrent-get:bomb: removed arg downloadLimitMode
torrent-get:bomb: removed arg uploadLimitMode
torrent-set:bomb: renamed speed-limit-down-enabled to downloadLimited
torrent-set:bomb: renamed speed-limit-down to downloadLimit
torrent-set:bomb: renamed speed-limit-up-enabled to uploadLimited
torrent-set:bomb: renamed speed-limit-up to uploadLimit
blocklist-updatenew method
port-testnew method
session-getnew arg alt-speed-begin
session-getnew arg alt-speed-down
session-getnew arg alt-speed-enabled
session-getnew arg alt-speed-end
session-getnew arg alt-speed-time-enabled
session-getnew arg alt-speed-up
session-getnew arg blocklist-enabled
session-getnew arg blocklist-size
session-getnew arg peer-limit-per-torrent
session-getnew arg seedRatioLimit
session-getnew arg seedRatioLimited
torrent-addnew arg files-unwanted
torrent-addnew arg files-wanted
torrent-addnew arg priority-high
torrent-addnew arg priority-low
torrent-addnew arg priority-normal
torrent-getnew arg bandwidthPriority
torrent-getnew arg fileStats
torrent-getnew arg honorsSessionLimits
torrent-getnew arg percentDone
torrent-getnew arg pieces
torrent-getnew arg seedRatioLimit
torrent-getnew arg seedRatioMode
torrent-getnew arg torrentFile
torrent-getnew ids option recently-active
torrent-reannouncenew method
torrent-setnew arg bandwidthPriority
torrent-setnew arg honorsSessionLimits
torrent-setnew arg seedRatioLimit
torrent-setnew arg seedRatioLimited

Transmission 1.70 (rpc-version-semver 2.1.0, rpc-version: 6)

MethodDescription
method torrent-set-locationnew method

Transmission 1.80 (rpc-version-semver 3.0.0, rpc-version: 7)

MethodDescription
torrent-get:bomb: removed arg announceResponse (use trackerStats instead)
torrent-get:bomb: removed arg announceURL (use trackerStats instead)
torrent-get:bomb: removed arg downloaders (use trackerStats instead)
torrent-get:bomb: removed arg lastAnnounceTime (use trackerStats instead)
torrent-get:bomb: removed arg lastScrapeTime (use trackerStats instead)
torrent-get:bomb: removed arg leechers (use trackerStats instead)
torrent-get:bomb: removed arg nextAnnounceTime (use trackerStats instead)
torrent-get:bomb: removed arg nextScrapeTime (use trackerStats instead)
torrent-get:bomb: removed arg scrapeResponse (use trackerStats instead)
torrent-get:bomb: removed arg scrapeURL (use trackerStats instead)
torrent-get:bomb: removed arg seeders (use trackerStats instead)
torrent-get:bomb: removed arg swarmSpeed
torrent-get:bomb: removed arg timesCompleted (use trackerStats instead)
session-setnew arg incomplete-dir-enabled
session-setnew arg incomplete-dir
torrent-getnew arg magnetLink
torrent-getnew arg metadataPercentComplete
torrent-getnew arg trackerStats

Transmission 1.90 (rpc-version-semver 3.1.0, rpc-version: 8)

MethodDescription
session-setnew arg rename-partial-files
session-getnew arg rename-partial-files
session-getnew arg config-dir
torrent-addnew arg bandwidthPriority
torrent-getnew trackerStats arg lastAnnounceTimedOut

Transmission 1.92 (rpc-version-semver 3.2.0, rpc-version: 8)

Note: rpc-version was not bumped in this release due to an oversight.

MethodDescription
torrent-getnew trackerStats arg lastScrapeTimedOut

Transmission 2.00 (rpc-version-semver 3.3.0, rpc-version: 9)

MethodDescription
session-setnew arg start-added-torrents
session-setnew arg trash-original-torrent-files
session-getnew arg start-added-torrents
session-getnew arg trash-original-torrent-files
torrent-getnew arg isFinished

Transmission 2.10 (rpc-version-semver 3.4.0, rpc-version: 10)

MethodDescription
session-getnew arg cache-size-mb
session-getnew arg units
session-setnew arg idle-seeding-limit-enabled
session-setnew arg idle-seeding-limit
torrent-setnew arg seedIdleLimit
torrent-setnew arg seedIdleMode
torrent-setnew arg trackerAdd
torrent-setnew arg trackerRemove
torrent-setnew arg trackerReplace

Transmission 2.12 (rpc-version-semver 3.5.0, rpc-version: 11)

MethodDescription
session-getnew arg blocklist-url
session-setnew arg blocklist-url

Transmission 2.20 (rpc-version-semver 3.6.0, rpc-version: 12)

MethodDescription
session-getnew arg download-dir-free-space
session-closenew method

Transmission 2.30 (rpc-version-semver 4.0.0, rpc-version: 13)

MethodDescription
torrent-get:bomb: removed arg peersKnown
torrent-getnew arg isUTP to the peers list
torrent-addnew arg cookies

Transmission 2.40 (rpc-version-semver 5.0.0, rpc-version: 14)

MethodDescription
torrent-get:bomb: values of status field changed
queue-move-bottomnew method
queue-move-downnew method
queue-move-topnew method
session-setnew arg download-queue-enabled
session-setnew arg download-queue-size
session-setnew arg queue-stalled-enabled
session-setnew arg queue-stalled-minutes
session-setnew arg seed-queue-enabled
session-setnew arg seed-queue-size
torrent-getnew arg fromLpd in peersFrom
torrent-getnew arg isStalled
torrent-getnew arg queuePosition
torrent-setnew arg queuePosition
torrent-start-nownew method

Transmission 2.80 (rpc-version-semver 5.1.0, rpc-version: 15)

MethodDescription
torrent-getnew arg etaIdle
torrent-rename-pathnew method
free-spacenew method
torrent-addnew return arg torrent-duplicate

Transmission 3.00 (rpc-version-semver 5.2.0, rpc-version: 16)

MethodDescription
session-getnew request arg fields
session-getnew arg session-id
torrent-getnew arg labels
torrent-setnew arg labels
torrent-getnew arg editDate
torrent-getnew request arg format

Transmission 4.0.0 (rpc-version-semver 5.3.0, rpc-version: 17)

MethodDescription
/upload:warning: undocumented /upload endpoint removed
session-get:warning: DEPRECATED download-dir-free-space. Use free-space instead.
free-spacenew return arg total_size
session-getnew arg default-trackers
session-getnew arg rpc-version-semver
session-getnew arg script-torrent-added-enabled
session-getnew arg script-torrent-added-filename
session-getnew arg script-torrent-done-seeding-enabled
session-getnew arg script-torrent-done-seeding-filename
torrent-addnew arg labels
torrent-getnew arg availability
torrent-getnew arg file-count
torrent-getnew arg group
torrent-getnew arg percentComplete
torrent-getnew arg primary-mime-type
torrent-getnew arg tracker.sitename
torrent-getnew arg trackerStats.sitename
torrent-getnew arg trackerList
torrent-setnew arg group
torrent-setnew arg trackerList
torrent-set:warning: DEPRECATED trackerAdd. Use trackerList instead.
torrent-set:warning: DEPRECATED trackerRemove. Use trackerList instead.
torrent-set:warning: DEPRECATED trackerReplace. Use trackerList instead.
group-setnew method
group-getnew method
torrent-get:warning: old arg wanted was implemented as an array of 0 or 1 in Transmission 3.00 and older, despite being documented as an array of booleans. Transmission 4.0.0 and 4.0.1 "fixed" this by returning an array of booleans; but in practical terms, this change caused an unannounced breaking change for any 3rd party code that expected 0 or 1. For this reason, 4.0.2 restored the 3.00 behavior and updated this spec to match the code.

Transmission 4.1.0 (rpc_version_semver 6.0.0, rpc_version: 18)

:bomb: switch to the JSON-RPC 2.0 protocol :bomb: switch to snake_case for all strings

MethodDescription
session_getnew arg sequential_download
session_setnew arg sequential_download
torrent_addnew arg sequential_download
torrent_getnew arg sequential_download
torrent_setnew arg sequential_download
torrent_addnew arg sequential_download_from_piece
torrent_getnew arg sequential_download_from_piece
torrent_setnew arg sequential_download_from_piece
torrent_getnew arg files.begin_piece
torrent_getnew arg files.end_piece
port_testnew arg ip_protocol
torrent_getnew arg tracker_stats.downloader_count
torrent_get:warning: DEPRECATED manual_announce_time, it never worked
session_getnew arg preferred_transports
session_setnew arg preferred_transports
session_get:warning: DEPRECATED tcp_enabled. Use preferred_transports instead.
session_get:warning: DEPRECATED utp_enabled. Use preferred_transports instead.
session_set:warning: DEPRECATED utp_enabled. Use preferred_transports instead.
session_get:warning: DEPRECATED rpc_version. Use rpc_version_semver instead.
session_get:warning: DEPRECATED rpc_version_minimum. Use rpc_version_semver instead.
torrent_get:bomb: wanted is now a boolean array instead of 1/0
session_get:bomb: renamed cache_size_mb to cache_size_mib
session_set:bomb: renamed cache_size_mb to cache_size_mib
session_get:bomb: renamed tolerated to allowed in encryption
session_set:bomb: renamed tolerated to allowed in encryption

Transmission 4.1.1 (rpc_version_semver 6.0.1, rpc_version: 19)

MethodDescription
session_getspeed_limit_down reverted to return an integer
session_getspeed_limit_up reverted to return an integer
group_getspeed_limit_down reverted to return an integer
group_getspeed_limit_up reverted to return an integer

Transmission 4.2.0 (rpc_version_semver 6.1.0, rpc_version: ?)

MethodDescription
torrent_getnew arg webseeds_ex
torrent_getDEPRECATED webseeds. Use webseeds_ex instead.
session_getDEPRECATED cache_size_mib. The memory cache is being removed, making this setting moot. The setting will still be gettable and settable via RPC session_get and session_set until Transmission 5.0.0 to avoid client breakage, but it will be otherwise unused in libtransmission. Clients should stop using this key.