Package Exports
- @ev1lc0rp/n8n-nodes-ninjaone
- @ev1lc0rp/n8n-nodes-ninjaone/dist/nodes/NinjaOne/NinjaOne.node.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ev1lc0rp/n8n-nodes-ninjaone) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
n8n-nodes-example-service
Community nodes for n8n demonstrating OAuth2 integrations. The package ships with nodes for the public JSONPlaceholder API and the NinjaOne platform.
Installation
Follow the community node installation guide and install the package:
npm install n8n-nodes-example-serviceNodes
Example Service
Basic CRUD operations for the JSONPlaceholder test API.
- Get Many – Retrieve a list of posts
- Get – Fetch a single post by ID
- Create – Create a new post
NinjaOne
Interact with the NinjaOne API.
Device Resource
Get – Fetch a single device by ID
Get Activities – Retrieve activities for a device
Get Alerts – Retrieve alerts for a device
Get Custom Fields – Retrieve custom fields for a device
Get Disks – Retrieve disks for a device
Get Jobs – Retrieve jobs for a device
Get Last Logged On User – Retrieve the last logged on user for a device
Get Many – Retrieve a list of devices
Get Network Interfaces – Retrieve network interfaces for a device
Get OS Patch Installs – Retrieve OS patch installs for a device
Get OS Patches – Retrieve OS patches for a device
Get Policy Overrides – Retrieve policy overrides for a device
Get Processors – Retrieve processors for a device
Get Software – Retrieve software for a device
Get Software Patch Installs – Retrieve software patch installs for a device
Get Software Patches – Retrieve software patches for a device
Get Volumes – Retrieve volumes for a device
Get Windows Services – Retrieve windows services for a device
Update Custom Fields – Update custom fields for a device
Device – Retrieve devices, jobs, alerts and more
Webhook – Create, update or delete a webhook
Related Item – Manage relations between entities
Ticket Resource
- Add Comment – Add a comment to a ticket
- Create – Create a new ticket
- Get – Fetch a single ticket by ID
- List Ticketing Boards – Retrieve a list of ticketing boards
- Get Tickets by Board – Retrieve a list of tickets for a board
- Update – Update a ticket
- System – Query system entities like policies or users
- Location – Read and update location custom fields
- Organization – Retrieve organizations and related resources
- Backup – Create and list backup jobs
- Knowledge Base – Manage knowledge base articles and folders
- Group – Get device IDs for a group
- Query – Run device queries such as antivirus status or health
- Organization Document – Manage organization documents
- Document Template – Manage document templates
- Checklist Template – Manage checklist templates
- Organization Checklist – Manage client checklists
- Asset Tag – Create and manage asset tags
- Vulnerability – Upload scan data and list groups
- Custom Field – Obtain signed URLs for custom field content
- Management – Advanced management operations (e.g. maintenance)
NinjaOne Legacy
Legacy HMAC based authentication for older NinjaOne API versions.
- Customer – List customers or retrieve a customer by ID
Creating a Ticket
Use the Create operation on the Ticket resource. A minimal payload matching the NewTicket schema is:
{
"clientId": 1,
"ticketFormId": 1,
"subject": "CPU with problems",
"description": {
"public": true,
"body": "new ticket description"
}
}Additional optional fields such as severity, priority and tags can be provided.
Example with all fields
{
"clientId": 1,
"ticketFormId": 1,
"locationId": 1,
"nodeId": 1,
"subject": "CPU with problems",
"description": {
"public": true,
"body": "new ticket description",
"htmlBody": "<p>new ticket description</p>",
"timeTracked": 60,
"duplicateInIncidents": true
},
"status": "1000",
"type": "PROBLEM",
"cc": {
"uids": [
"1fa74a18-a329-40d8-b5b7-0a22624f7800",
"b0558cb6-3c4e-438c-b8fd-5247c648bbbe"
],
"emails": [
"example1@example.com",
"example2@example.com"
]
},
"assignedAppUserId": 0,
"requesterUid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"severity": "NONE",
"priority": "NONE",
"parentTicketId": 1,
"tags": [
"tag1",
"tag2"
],
"attributes": [
{
"id": 1,
"attributeId": 1,
"value": "string"
}
]
}Authorization Workflow
The NinjaOne Public API uses OAuth 2.0. The specific flow depends on the application type.
OAuth 2.0 Flows
- Authorization Code Flow: For server-side web applications.
- Client Credentials Flow: For machine-to-machine (M2M) applications, such as CLIs or backend services. This is the recommended flow for all API methods in this package.
- Implicit Flow: For single-page applications (SPAs).
- Authorization Code Flow with PKCE: For native and single-page applications.
For detailed information on each flow, refer to the NinjaOne API documentation.
API Method Authentication
All API methods in this package are intended for server-to-server communication and should use the Client Credentials Flow.
Credentials
Create credentials of type NinjaOne OAuth2 API for OAuth 2.0 authentication or NinjaOne Legacy API for legacy HMAC-based authentication. n8n handles token generation and signing for you.
The NinjaOne OAuth2 API credentials are used for all modern NinjaOne API interactions. The NinjaOne Legacy API is for older, deprecated API endpoints.
The NinjaOne OAuth2 credentials include:
- Region selector: Choose your NinjaOne region (North America, Europe, or Australia & Oceania)
- Base URL field: Specify the API endpoint for your region (default:
https://api.ninjaone.com)
The OAuth2 endpoints are automatically configured based on your selected region.
Compatibility
- Minimum n8n version:
1.38.0 - Tested on Node.js
20
Usage
After installation and credential setup the nodes appear under Community Nodes in the editor. Add a node, select the credentials and choose an operation.
Resources
Development Notes
The Webhook resource is fully functional. Implementation of some related item and location custom field endpoints is pending. The new-node-feature-docs/ directory contains reference API method lists for additional features.
Troubleshooting
400 Bad Request
: The NinjaOne API may reject requests when required parameters are missing or malformed. Confirm that all mandatory fields are set for the selected operation. When using OAuth2 credentials, make sure the Base URL points to the correct region endpoint and does not contain a trailing slash.
401 Unauthorized
: This error indicates that your access token is invalid, expired, or does not have the required permissions (scopes) for the requested operation. Verify that your credentials are correct and that the access token has the necessary scopes.
write EPROTO / TLS handshake errors
: Errors such as write EPROTO or tlsv1 unrecognized name typically indicate a problem during the TLS handshake. This is usually caused by:
- Incorrect region selection: Ensure you've selected the correct region in your OAuth2 credentials
- Invalid Base URL: Verify that the Base URL uses
httpsand refers to your actual NinjaOne API domain (for examplehttps://api.ninjaone.com) - SSL certificate mismatch: The OAuth2 endpoints are automatically configured based on your region selection
- Network issues: Check that your environment trusts the server certificate and that no proxy is interfering with the connection