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

Devices → Device custom fields

AI-generated

Summary

Retrieve custom fields for a specific device identified by its ID, optionally supporting inheritance of values from definition scopes, pagination, filtering, and custom request options.

Inputs

  • id (required) — The numeric identifier of the device to retrieve custom fields for.
  • returnAll — Boolean flag to return all custom field results across pages or just a single page.
  • additionalFields.withInheritance — Boolean option to retrieve custom field values using the definition scope hierarchy, allowing inherited values to be included.
  • options.customBody — Optional arbitrary JSON to deep-merge into the request body, allowing customization beyond the standard parameters.
  • options.headerFilters — Optional custom HTTP headers to add to the API request.
  • options.queryFilters — Optional query-string filters as parameter name and value pairs to refine the request.
  • options.batching — Optional batching settings to group input items into batches for rate-limit management, specifying items per batch and interval between batches.
  • options.debug — Flag to include detailed debug information about each API request made, such as URL, headers, and body, for troubleshooting purposes.
  • options.pagination — Settings to configure pagination handling by specifying mode (offset, cursor, or URL), parameters for managing page size and tokens, and max pages to fetch.
  • options.timeout — Timeout in milliseconds to wait for the server response headers before aborting the request; defaults to 5 minutes.

Output shape

an array of custom field objects for the specified device

If pagination is configured and returnAll is true, the operation returns all pages of custom fields concatenated into a single array. Debug info is included if enabled in options.debug. Custom request options can modify headers, body, and query parameters sent.

Examples

Example 1: Retrieve all custom fields for device ID 123 with inheritance

Set 'id' to 123, 'returnAll' true, and 'additionalFields.withInheritance' true.

Links

Discussion