Syno
Node.js wrapper and CLI for Synology DSM REST API 6.x and 7.x.

See Synology Development Tool.
Installation
npm install syno
For the CLI:
npm install -g syno
Requires Node.js >= 24.0.0
Syno API
- DSM API (SYNO.DSM, SYNO.Core)
- File Station API (SYNO.FileStation)
- Download Station API (SYNO.DownloadStation)
- Audio Station API (SYNO.AudioStation)
- Video Station API (SYNO.VideoStation)
- Video Station DTV API (SYNO.DTV)
- Surveillance Station API (SYNO.SurveillanceStation)
- Synology Photos API (SYNO.Foto, SYNO.FotoTeam) - DSM 7.x only
For detailed parameters and response data, refer to the Synology Developer Tool page.
JavaScript / TypeScript
import { Syno } from 'syno';
const syno = new Syno({
protocol: 'https',
host: 'localhost',
port: 5001,
account: 'my_username',
passwd: 'my_password',
apiVersion: '7.2',
});
All methods return Promises:
const info = await syno.fs.getInfo();
Or call a method dynamically:
const info = await syno.fs.call('getInfo', { folder_path: '/path' });
Examples
const dsmInfo = await syno.dsm.getInfo();
const fsInfo = await syno.fs.getInfo();
const files = await syno.fs.list({ folder_path: '/path/to/folder' });
const tasks = await syno.dl.listTasks({ limit: 5, offset: 10 });
await syno.dl.createTask({ uri: 'https://link' });
const songs = await syno.as.searchSong({ title: 'my_title_song' });
const movies = await syno.vs.listMovies({ limit: 5 });
const channels = await syno.dtv.listChannels({ limit: 5 });
const camera = await syno.ss.getInfoCamera({ cameraIds: 4 });
const albums = await syno.photo.listAlbums();
Configuration Options
account | string | - | DSM user account (required) |
passwd | string | - | DSM user password (required) |
protocol | string | 'http' | 'http' or 'https' |
host | string | 'localhost' | DSM hostname or IP |
port | number | 5000 | DSM port |
apiVersion | string | '7.2' | DSM API version |
debug | boolean | false | Enable debug logging |
ignoreCertificateErrors | boolean | false | Ignore TLS certificate errors |
otpCode | string | - | Two-factor auth OTP code |
sid | string | - | Reuse an existing session ID |
followRedirects | boolean | true | Follow HTTP redirects (QuickConnect) |
Station Aliases
syno.dsm | syno.diskStationManager | DSM |
syno.fs | syno.fileStation | FileStation |
syno.dl | syno.downloadStation | DownloadStation |
syno.as | syno.audioStation | AudioStation |
syno.vs | syno.videoStation | VideoStation |
syno.dtv | syno.videoStationDTV | VideoStationDTV |
syno.ss | syno.surveillanceStation | SurveillanceStation |
syno.photo | syno.synologyPhotos | SynologyPhotos |
CLI
$ syno --help
Usage: syno [options] [command]
Synology Rest API Command Line
Options:
-V, --version output the version number
-c, --config <path> DSM Configuration file. Default to ~/.syno/config.yaml
-u, --url <url> DSM URL. Default to https://admin:password@localhost:5001
-d, --debug Enabling Debugging Output
-a, --api <version> DSM API Version. Default to 7.2
-i, --ignore-certificate-errors Ignore certificate errors
-h, --help display help for command
Commands:
diskstationmanager|dsm [options] <method> DSM API
filestation|fs [options] <method> DSM File Station API
downloadstation|dl [options] <method> DSM Download Station API
audiostation|as [options] <method> DSM Audio Station API
videostation|vs [options] <method> DSM Video Station API
videostationdtv|dtv [options] <method> DSM Video Station DTV API
surveillancestation|ss [options] <method> DSM Surveillance Station API
synologyphotos|photo [options] <method> DSM Synology Photos API
CLI Examples
$ syno dsm getInfo --pretty
$ syno fs listFiles --payload '{"folder_path":"/path/to/folder"}' --pretty
$ syno dl createTask --payload '{"uri":"https://link"}'
$ syno as searchSong --payload '{"title":"my_title_song"}' --pretty
$ syno vs listMovies --payload '{"limit":5}' --pretty
$ syno dtv listChannels --payload '{"limit":5}' --pretty
$ syno ss getInfoCamera --payload '{"cameraIds":4}' --pretty
CLI Authentication
Via environment variables
export SYNO_ACCOUNT=user
export SYNO_PASSWORD=password
export SYNO_PROTOCOL=https
export SYNO_HOST=localhost
export SYNO_PORT=5001
Via URL
$ syno fs getInfo --url https://user:password@localhost:5001 --pretty
Via configuration file
url:
protocol: https
host: localhost
port: 5001
account: admin
passwd: password
$ syno fs getInfo --pretty
More usage examples in the wiki.
Migrating from 2.x to 3.x
Breaking changes
Tips & Tricks
If you encounter certificate errors with https:
[ERROR] : Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
Use the --ignore-certificate-errors flag:
$ syno fs getInfo --ignore-certificate-errors
Or set the environment variable:
export SYNO_IGNORE_CERTIFICATE_ERRORS=1
Or in code:
const syno = new Syno({
ignoreCertificateErrors: true,
});
History
View the changelog
Authors
License
MIT - See LICENSE-MIT