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

Geolocation → Device geolocation history

AI-generated

Summary

Retrieve the geolocation history records for a specific device identified by its numeric ID, optionally filtered by time range and paginated.

Inputs

  • id (required) — Numeric identifier of the device whose geolocation history to fetch.
  • returnAll — Boolean to indicate whether to return all pages of results (true) or only a single page (false).
  • Additional Fields — Optional parameters including 'after' timestamp (epoch seconds) to include records on or after, 'before' timestamp to include records on or before, 'pageSize' to limit records per page, and 'cursor' for cursor-based pagination.
  • Options — Additional optional settings such as 'Custom Body' JSON to override the request body, 'Custom Headers' to add HTTP headers, 'Query Filters' to add custom query-string filters, batching settings to control request grouping and intervals, debug flag to output detailed request info, pagination configuration to control pagination mode and related parameters, and request timeout in milliseconds.

Output shape

a list of geolocation history records for the given device

If 'returnAll' is false, only one page of results is returned according to pagination settings. If true, all pages are fetched and concatenated. When debug is enabled, the output includes additional debug info for each API request made. Pagination behaviour depends on user-configured pagination mode and parameters.

Examples

Example 1: Retrieve the most recent page of geolocation history records for device ID 123

Set 'id' to 123, leave 'returnAll' false and default pagination settings.

Example 2: Retrieve all available geolocation history records for device ID 456 within the last week

Set 'id' to 456, 'returnAll' true, and 'after' to the epoch timestamp 7 days ago in 'Additional Fields'.

Links

Discussion