NinjaOne icon

NinjaOne

Ninja One Public API documentation. <br><br>See also: <br> <a href="https://resources.ninjarmm.com/API/Ninja+RMM+Public+API+v2.0.5+Device+Filter+Syntax.pdf">Device Filter syntax</a><br><a href="https://app.ninjarmm.com/apidocs-beta/core-resources/articles/webhooks/overview">Webhooks</a>

Actions309

System → List locations

AI-generated

Summary

Retrieve a paginated list of system locations from the NinjaOne API, allowing optional filtering and pagination control.

Inputs

  • returnAll — Boolean to determine if all location results should be returned by automatically handling pagination, or only a single page.
  • additionalFields.pageSize — Maximum number of location records to return per page.
  • additionalFields.after — Identifier of the last location from a previous page to fetch the subsequent page.
  • options.customBody — Custom JSON object to send in the request body, merged with other parameters and taking precedence.
  • options.headerFilters — Custom HTTP headers to include in the API request.
  • options.queryFilters — Custom query-string filters to apply to the request.
  • options.batching — Batching settings to control the grouping of input items and delay between batches for rate limit management.
  • options.debug — Enable debug mode to include detailed request information in output for troubleshooting.
  • options.pagination — Configuration for how pagination is handled, including mode (offset, cursor, or URL), parameter names, page size, max pages, and request interval.
  • options.timeout — Timeout in milliseconds for waiting on the server response before aborting.

Output shape

A collection of location records, potentially paginated depending on 'returnAll' and pagination settings.

If 'returnAll' is false, only one page of locations is returned according to the pageSize and pagination params. If true, the node aggregates pages until all locations are retrieved or limits are reached. Debug output appears under a separate key if enabled. Optional fields and filters can further refine query results.

Examples

Example 1: Return all system locations

Set 'returnAll' to true to fetch all location items across all pages.

Example 2: Return a single page with limited results

Set 'returnAll' to false and specify 'pageSize' to limit the number of locations returned on one page.

Links

Discussion