NetBox icon

NetBox

Consume NetBox API

Overview

This node integrates with the NetBox API to update a Site resource within the DCIM domain. It allows users to modify various attributes of an existing site in their NetBox instance, such as its name, status, location details, contact information, and custom fields. This is useful for network administrators or IT professionals who manage physical infrastructure and want to keep their site data current programmatically.

Practical examples include:

  • Updating the status of a site from "planned" to "active" after construction.
  • Changing the physical address or GPS coordinates of a site.
  • Adding or modifying contact details for site management.
  • Tagging sites or adding custom metadata fields for better categorization.

Properties

Name Meaning
Domain The domain of the NetBox API to use; for this operation, it must be "DCIM".
Site ID The unique identifier of the site to update.
Update Fields A collection of fields to update on the site, including:
- Name The new name of the site.
- Slug URL-friendly slug for the site.
- Status Current status of the site. Options: Active, Planned, Staging, Decommissioning, Retired.
- Region ID Identifier of the region the site belongs to.
- Site Group ID Identifier of the group the site belongs to.
- Tenant ID Identifier of the tenant associated with the site.
- Facility Facility code or ID.
- ASN Autonomous System Number associated with the site.
- Time Zone Time zone string (e.g., America/New_York).
- Description Text description of the site.
- Physical Address Physical address of the site.
- Shipping Address Shipping address of the site.
- Latitude GPS coordinate latitude (decimal degrees).
- Longitude GPS coordinate longitude (decimal degrees).
- Contact Name Name of the contact person for the site.
- Contact Phone Phone number of the contact person.
- Contact Email Email address of the contact person.
- Comments Additional comments about the site.
- Tags Comma-separated list of tags for categorization.
- Custom Fields JSON object containing any custom fields defined for the site.

Output

The node outputs the updated site data in JSON format. The output JSON contains the full representation of the site resource as returned by the NetBox API after the update operation. This includes all standard and custom fields reflecting the new state of the site.

The node does not output binary data.

Dependencies

  • Requires access to a NetBox instance with the appropriate 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:

    • Invalid or missing Site ID will cause the update to fail.
    • Insufficient permissions or invalid API token will result in authentication errors.
    • Providing invalid field values (e.g., wrong data types or non-existent IDs) may cause validation errors from the API.
    • Network connectivity issues to the NetBox server can cause request failures.
  • Error messages:

    • Authentication errors typically indicate problems with the API key or credentials.
    • Validation errors from the API will specify which fields are incorrect or missing.
    • If the node is set to continue on failure, errors will be returned in the output JSON under an error property.
  • Resolutions:

    • Verify the Site ID exists in NetBox before updating.
    • Ensure the API token has write permissions for the DCIM domain.
    • Double-check all input fields for correct types and valid references.
    • Confirm network connectivity and correct base URL configuration for the NetBox API.

Links and References

Discussion