Already a NinjaOne customer? Log in to view more guides and the latest updates.

NinjaOne Documentation: Public API

Topic

This article explains where to find and how to use NinjaOne's Public Application Programming Interface (API).

Environment

  • NinjaOne Documentation
  • NinjaOne Public API

Description

Use NinjaOne's Public API page to view all available requests in NinjaOne and their functions, construct sample queries, and view or copy responses.

If you have any questions about API configuration or documentation, you can contact NinjaOne's API Team at [email protected].

Select a topic to learn more:

Where to Find the API Resources

For a full list of all API queries, refer to the NinjaOne Public API documentation, which you can access from the Help resources menu in the top right corner of NinjaOne. The link is at the bottom of the menu.

Figure 1: Access NinjaOne's public API documentation (click to enlarge)

The NinjaOne Public API provides additional resources for device filter syntax and webhooks. Click the links provided in the API documentation to learn more:

  • Device Filter syntax: Explains the syntax requirements for the Device filter parameter URL-encoded string.
  • Webhooks: Describes how to configure a webhook integration.
public API resources.png
Figure 2: NinjaOne public API resources

Explore the API

NinjaOne provides a Public API so you can view a comprehensive index of templates for the API entities. Available operations include POST, GET, PATCH, DELETE, and PUT request methods.

Authorization

The NinjaOne Public API uses OAuth 2.0 to authenticate requests. OAuth 2.0 allows applications to obtain access to NinjaOne resources that are made available via the API.

Click Authorization to review the documentation describing authorization requirements in the NinjaOne Public API.

public api 2.0_authorization.png
Figure 3: Review the NinjaOne Public API 2.0 authorization documentation

Refer to

Figure 4: NinjaOne's public API schemas

API Changes

We are enhancing the API documentation for better organization and visibility. To view the new API documentation, perform the following steps.

  1. Click Details here, where it says API coming changes at the top of the page, to learn more.
API_change details.png
Figure 5: View upcoming changes to NinjaOne Public API
  1. From the NinjaOne Public API beta page, click Core Resources to view the new layout. Click Return to previous site to view the original API documentation.
API_core resources_return to previous site.png
Figure 6: View the new core resources layout or return to the previous site
  1. Refer to the Test Endpoints from the Public API 2.0 section to learn how to interact with the page.

How to Test or Send the API Request

Test a Request Method

While you are in the Public API, you can test and then execute a request method by performing the following steps:

  1. Expand a query to view the details and click Try it out. Some queries, such as the one in Figure 7, may require you to input a parameter. Parameters may be optional to organize or limit the data shown in a response. To learn how to obtain a parameter ID, refer to the section of this article titled How to Find Query Identifiers.
try the api.png
Figure 7: Trial NinjaOne's public API endpoints
  1. After you input the necessary parameters, click Execute. The response to the query will appear in the Responses section for that template.
Figure 8: Execute the API query and view the response (click to enlarge)
  1. Once the response is complete, you can copy the request URL or click Download to save the response as a JSON file.

You can use the customizable API requests with GUI-based platforms, such as Postman, for browsing or testing. To learn how to use Postman, refer to Postman Docs | Postman Docs (external link). For Postman application support, refer to Postman support center (external link).

Test Endpoints from the Public API 2.0

Within the NinjaOne Public API beta, access the queries from the sidebar menu. The requests will operate similarly to the previous section, but you must ensure you have authorization configured before using it. Refer to NinjaOne Documentation: Public API 2.0 Authorization to learn how to configure these settings.

  1. Select your query from the sidebar menu to view the details.
  2. Enter your authorization into either the Token or sessionKey field, depending on your preferred authorization method.
  3. Enter the parameters, if necessary.
  4. Click Send API Request.
  5. View the Response.
Figure 9: Example of a NinjaOne Public API beta query response (click to enlarge)

How to Find Query Identifiers

Certain API queries may require you to input an identifier, such as an organization or device ID. In most cases, you can use the core system entities and resources to find this data. The following steps provide an example for obtaining an organization ID so you can return a list of locations within the NinjaOne Public API.

  1. Expand the /v2/organizations query and click Try it out. Then, click Execute.
  2. Copy the value for "id".
api_response_id.png
Figure 10: Copy the response ID
  1. Navigate to the /v2/organization/{id}/locations query.
  2. Click Try it out and paste the copied value into the id field.
api_query id.png
Figure 11: Enter the query ID
  1. Click Execute and view the response.

Additional Resources

Refer to the following resources to learn more about the NinjaOne API.

FAQ

Next Steps