Command

euphoria360 edited this page Mar 4, 2018 · 25 revisions

GET

api/command
api/command/{id}
Summary

Queries the status of a previously started command, or all currently started commands.

Parameters

Required: None

Optional: id (int) Unique ID of the command

Returns

For api/command

An array of JSON objects

For api/command/{id}

{
  "name": "RescanSeries",
  "startedOn": "0001-01-01T00:00:00Z",
  "stateChangeTime": "2014-02-05T05:09:09.2366139Z",
  "sendUpdatesToClient": true,
  "state": "pending",
  "id": 24
}

POST

Summary

Publish a new command for Sonarr to run.

These commands are executed asynchronously; use GET to retrieve the current status.

And, remember, all POST/PUT requests require all parameters to be JSON encoded in the body, unless otherwise noted.

Parameters

Required: name (string)

Returns
{
  "name": "RescanSeries",
  "startedOn": "0001-01-01T00:00:00Z",
  "stateChangeTime": "2014-02-05T05:09:09.2366139Z",
  "sendUpdatesToClient": true,
  "state": "pending",
  "id": 24
}

Commands

RefreshSeries

Refresh series information from trakt and rescan disk

Parameters

Optional: seriesId (int) - if not set, all series will be refreshed and scanned


RescanSeries

Refresh rescan disk for a single series

Parameters

Optional: seriesId (int) - if not set all series will be scanned


EpisodeSearch

Search for one or more episodes

Parameters

Required: episodeIds (int[]) - one or more episodeIds in an array


SeasonSearch

Search for all episodes of a particular season

Parameters

Required: seriesId (int) seasonNumber (int)


SeriesSearch

Search for all episodes in a series

Parameters

Required: seriesId (int)


DownloadedEpisodesScan

Update: Due to a deprecated Drone Factory, this command should only be used in combination with the 'path' set in the POSTed json body.

Instruct Sonarr to scan and import the DroneFactoryFolder or another folder defined by the path variable.

Each file and folder in the DroneFactoryFolder is interpreted as a separate download (job).

A folder specified by the path variable is assumed to be a single download (job) and the folder name should be the release name.

The downloadClientId can be used to support this API endpoint in conjunction with Completed Download Handling, so Sonarr knows that a particular download has already been imported.

Optionally the 'importMode' can be used to specify whether Sonarr should Hardlink/Copy or Move the imported files.

Parameters

Optional:
path (string)
downloadClientId (string)
- nzoid for sabnzbd
- special 'drone' attribute value for nzbget
- uppercase infohash for torrents
importMode (string) = Move or Copy
- Copy = Copy or Hardlink depending on Sonarr configuration
- Can be used to override the default Copy for torrents with external preprocessing/transcoding/unrar.


RssSync

Instruct Sonarr to perform an RSS sync with all enabled indexers

Parameters

None


RenameFiles

Instruct Sonarr to rename the list of files provided

Parameters

files (int[]) List of File IDs to rename


RenameSeries

Instruct Sonarr to rename all files in the provided series.

Parameters

seriesIds (int[]) List of Series IDs to rename


Backup

Instruct Sonarr to perform a backup of it's database and config file (nzbdrone.db and config.xml)

Parameters

None


missingEpisodeSearch

Instruct Sonarr to perform a backlog search of missing episodes (Similar functionality to Sickbeard)

Parameters

None

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.