NetBox icon

NetBox

Consume NetBox API

Overview

This node integrates with the NetBox API, specifically allowing users to list "Site" resources within the "DCIM" domain. It is designed to fetch site data from a NetBox instance, supporting filtering and pagination options. This node is useful in scenarios where network engineers or IT administrators want to automate retrieval of site information for inventory management, reporting, or integration with other systems.

For example, you could use this node to:

  • Retrieve all sites managed in your NetBox instance.
  • Filter sites by status (e.g., only active sites).
  • Limit the number of returned sites for performance reasons.
  • Search sites by name, region, tenant, or tags.

Properties

Name Meaning
Domain The domain of the NetBox API to target. For this operation, it must be set to "DCIM".
Return All Whether to return all results or limit the output to a specified number. If true, all matching sites are returned; if false, the number of results is limited by the "Limit" property.
Limit Maximum number of site results to return when "Return All" is false. Must be at least 1.
Filters Collection of optional filters to narrow down the list of sites:
- Site ID Filter by exact site ID number.
- Name Filter by site name (string match).
- Slug Filter by site slug (URL-friendly identifier).
- Facility Filter by facility code string.
- Status Filter by site status. Options include: Active, Planned, Staging, Decommissioning, Retired.
- Region ID Filter by numeric region ID.
- Region Filter by region name (slug).
- Site Group ID Filter by numeric site group ID.
- Site Group Name Filter by site group name (slug).
- Tenant ID Filter by numeric tenant ID.
- Tenant Name Filter by tenant name (slug).
- Latitude Approximate filter by latitude coordinate.
- Longitude Approximate filter by longitude coordinate.
- Search Free text search term applied across multiple fields.
- Tag Filter by tag string.

Output

The node outputs an array of JSON objects representing the sites retrieved from NetBox. Each object corresponds to a site resource and contains its properties as returned by the NetBox API, such as site ID, name, slug, status, region, tenant, and other metadata.

If the node supports binary data output (not indicated here), it would typically represent attachments or files related to the site, but this operation focuses on JSON data only.

Dependencies

  • Requires access to a NetBox instance with API enabled.
  • Requires an API authentication token credential configured in n8n to authorize requests to the NetBox API.
  • The node depends on internal helper functions to execute the API operation but no external npm packages beyond those bundled.

Troubleshooting

  • Common issues:

    • Authentication failures due to invalid or missing API tokens.
    • Network connectivity problems reaching the NetBox server.
    • Incorrect domain/resource/operation selections causing no data or errors.
    • Using filters with incorrect types or values may result in empty responses.
  • Error messages:

    • Errors thrown during execution will be logged to the console.
    • If "Continue on Fail" is enabled, errors are returned as part of the node output instead of stopping the workflow.
    • Common error messages might include HTTP 401 Unauthorized, 404 Not Found (wrong resource), or 400 Bad Request (invalid filters).
  • Resolution tips:

    • Verify API credentials and permissions.
    • Confirm the NetBox URL and network accessibility.
    • Double-check filter values and types.
    • Enable "Return All" cautiously to avoid large data loads.

Links and References

Discussion