NinjaOne RMM API

Version

This is a wrapper for the ninjaone API. You can see the API endpoints

Currently only the GET requests to endpoints are implemented (readonly).

Installation

Add this line to your application's Gemfile:

gem 'ninjaone'

And then execute:

> bundle install

Or install it yourself as:

> gem install ninjaone

Usage

Authentication

Before you start making the requests to API provide the client id and client secret and email/password using the configuration wrapping.

require 'ninjaone'

NinjaOne.configure do |config|
  config.client_id = ENV['NINJA1_CLIENT_ID']
  config.client_secret = ENV['NINJA1_CLIENT_SECRET']
  config.endpoint = ENV['NINJA1_ENDPOINT']
end
client = NinjaOne.client()
client.

o = client.organizations

o.each do |organization|
  puts "#{organization.name}"
end

Resources

Authentication

# setup configuration
#
client.

Resource API endpoint
login https://app.ninjarmm.com/apidocs/?links.active=authorization

System

Core system Entities and Resources

client.organizations
client.devices
client.contacts
Method Description
contacts(params = {}) List all contacts
contact(id, params = {}) Retrieve a specific contact by ID
organizations(params = {}) List all organizations
organization(id, params = {}) Retrieve a specific organization by ID
organizations_detailed(params = {}) List all organizations with detailed information
policies(params = {}) List all policies
jobs(params = {}) List all active jobs
activities(params = {}) List all activities
alerts(params = {}) List all active alerts (triggered conditions)
automation_scripts(params = {}) List available automation scripts
devices(params = {}) List all devices
devices_detailed(params = {}) List all devices with detailed information
notification_channels_enabled(params = {}) List enabled notification channels
notification_channels(params = {}) List all notification channels
groups(params = {}) List all groups (saved searches)
locations(params = {}) List all locations
roles(params = {}) List device roles
tasks(params = {}) List scheduled tasks
software_products(params = {}) List supported 3rd party software
users(params = {}) List all users
user_end_users(params = {}) List end users
user_technicians(params = {}) List technicians
user_roles(params = {}) Get user roles
devices_search(params = {}) Search devices by query parameter q
search_devices(query_string, options = {}) Helper method to search devices (equivalent to devices_search({q: query_string}))

Organizations

All APIs related to organizations

organizations = client.organizations
org_id = organizations.first.id
org_devices = client.organization_devices(org_id)
Method Description
organization(id, params = {}) Retrieve a specific organization by ID
organization_locations(id, params = {}) List all locations for the specified organization
organization_end_users(id, params = {}) List all end users in the specified organization
organization_custom_fields(id, params = {}) Retrieve custom fields for the specified organization
organization_devices(id, params = {}) List all devices in the specified organization
organization_locations_backup_usage(id, params = {}) Retrieve backup usage for all locations in the specified organization
organization_backup_usage_by_location(id, location_id, params = {}) Retrieve backup usage for a specific location in the specified organization
organization_location_custom_fields(id, location_id, params = {}) Retrieve custom fields for a specific location in the specified organization

Backup

All APIs related to backup

# Get failed jobs using status filter
failed_jobs = client.backup_jobs(sf: 'status = FAILED')
integrity_jobs = client.backup_integrity_checks_jobs
Method Description
backup_jobs(params = {}) List all backup jobs. Supports filtering via sf (filter) and sc (sort) parameters
backup_integrity_checks_jobs(params = {}) List all backup integrity check jobs. Supports filtering and sorting parameters

Devices

All APIs related to devices

device = client.device(12345)
device_jobs = client.device_jobs(12345)
device_activities = client.device_activities(12345, since: '2026-01-01T00:00:00Z')
group_device_ids = client.group_device_ids(group_id)
Method Description
device(id, params = {}) Retrieve details of a single device by its device ID
device_policy_overrides(id, params = {}) Retrieve policy overrides applied to the specified device
device_jobs(id, params = {}) Retrieve all jobs associated with the specified device
device_activities(id, params = {}) Retrieve activities for the specified device (supports since filtering)
device_alerts(id, params = {}) Retrieve alerts related to the specified device
device_disks(id, params = {}) Retrieve disk information for the specified device
device_processors(id, params = {}) Retrieve processor information for the specified device
device_software(id, params = {}) Retrieve installed software for the specified device
device_volumes(id, params = {}) Retrieve volume information for the specified device
device_windows_services(id, params = {}) Retrieve Windows services for the specified device
device_custom_fields(id, params = {}) Retrieve custom fields associated with the specified device
device_os_patch_installs(id, params = {}) Retrieve operating system patch installation records for the specified device
device_software_patch_installs(id, params = {}) Retrieve software patch installation records for the specified device
device_last_logged_on_user(id, params = {}) Retrieve information about the last logged-on user of the device
device_network_interfaces(id, params = {}) Retrieve network interface information for the specified device
device_os_patches(id, params = {}) Retrieve available or installed operating system patches for the device
device_software_patches(id, params = {}) Retrieve available or installed software patches for the device
group_device_ids(id, params = {}) Retrieve device IDs for all devices in the specified group

Users

All APIs related to user management

end_user = client.user_end_user(end_user_id)
end_user_custom_fields = client.user_end_user_custom_fields(end_user_id)
technician = client.user_technician(technician_id)
Method Description
user_end_user(id, params = {}) Retrieve details of a specific end user
user_end_user_custom_fields(id, params = {}) Retrieve custom fields for a specific end user
user_technician(id, params = {}) Retrieve details of a specific technician

Queries

Query endpoints that support pagination for advanced data retrieval

av_status = client.queries_antivirus_status
device_health = client.queries_device_health
software_list = client.queries_software

All query methods support pagination and filtering parameters. Query methods return paginated results.

Method Description
queries_antivirus_status(params = {}) Query antivirus status across devices
queries_antivirus_threats(params = {}) Query antivirus threats across devices
queries_computer_systems(params = {}) Query computer system information
queries_custom_fields_detailed(params = {}) Query custom fields with detailed information
queries_custom_fields(params = {}) Query custom fields
queries_device_health(params = {}) Query device health status
queries_backup_usage(params = {}) Query backup usage across devices
queries_disks(params = {}) Query disk information
queries_os_patch_installs(params = {}) Query operating system patch installations
queries_software_patch_installs(params = {}) Query software patch installations
queries_logged_on_users(params = {}) Query currently logged-on users
queries_network_interfaces(params = {}) Query network interface information
queries_operating_systems(params = {}) Query operating system information
queries_os_patches(params = {}) Query operating system patches
queries_software_patches(params = {}) Query software patches
queries_policy_overrides(params = {}) Query policy overrides
queries_processors(params = {}) Query processor information
queries_raid_controllers(params = {}) Query RAID controller information
queries_raid_drives(params = {}) Query RAID drive information
queries_scoped_custom_fields_detailed(params = {}) Query scoped custom fields with detailed information
queries_scoped_custom_fields(params = {}) Query scoped custom fields
queries_software(params = {}) Query software information
queries_volumes(params = {}) Query volume information
queries_windows_services(params = {}) Query Windows services

Contributing

Bug reports and pull requests are welcome on GitHub.

License

The gem is available as open source under the terms of the MIT License.