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

RelatedItems → List host entity related items by scope

AI-generated

Summary

Retrieve and list related items associated with a specified host entity type and ID, optionally filtered by scope and enhanced with additional query, header, or pagination settings.

Inputs

  • entityType (required) — The type of the entity to get related items for, such as ORGANIZATION, DOCUMENT, LOCATION, NODE, CHECKLIST, KB_DOCUMENT, END_USER, or SOFTWARE_LICENSE.
  • entityId (required) — The numeric identifier of the entity whose related items you want to list.
  • additionalFields.scope — Optional scope to filter related items by: ALL, HOSTING, or HOSTED_BY. Defaults to ALL if not set.
  • options.customBody — Optional JSON object to send as a custom request body merged with other parameters, taking priority when set.
  • options.headerFilters — Optional custom HTTP headers to include in the API request.
  • options.queryFilters — Optional additional query string parameters to filter the request results.
  • options.batching — Optional batching controls to group input items and pause between batches, useful for rate limiting.
  • options.debug — Optional debug flag to include request details (URL, headers, body) in the output for troubleshooting.
  • options.pagination — Optional pagination controls allowing offset, cursor, or URL based paging with configurable parameters, max pages, and delays.
  • options.timeout — Optional timeout in milliseconds for the API request; defaults to 300000 (5 minutes).

Output shape

a list of related item records for the specified host entity, potentially paginated according to the pagination settings

The operation supports pagination modes including offset, cursor, and next URL with configurable parameters. The response format may be influenced by queryFilters or custom request body parameters. Enabling debug adds request details to the output for each API call made.

Examples

Example 1: List all related items for a NODE entity with ID 123 without additional scopes or filters

Set entityType=NODE, entityId=123; leave additionalFields and options empty or default

Example 2: Retrieve related items for a DOCUMENT entity with ID 456 limited to 'HOSTING' scope with custom headers and pagination

Set entityType=DOCUMENT, entityId=456, additionalFields.scope=HOSTING; add custom headers under options.headerFilters; configure pagination under options.pagination as desired.

Links

Discussion