Actions88
- Module Actions
- Platform Actions
- Device Actions
- Device Bay Actions
- Device Bay Template Actions
- Device Role Actions
- Device Type Actions
- Interface Actions
- Manufacturer Actions
- Module Bay Actions
- Module Bay Template Actions
- Module Type Actions
- Region Actions
- Site Actions
- Virtual Chassis Actions
- Virtual Device Context Actions
Overview
This node interacts with the NetBox API to manage device roles within the "DCIM" domain. Specifically, the "Delete" operation for the "Device Role" resource allows users to remove a device role record from their NetBox instance by specifying its unique identifier. This is useful in scenarios where obsolete or incorrect device roles need to be cleaned up to maintain accurate infrastructure documentation.
Practical examples include:
- Automating cleanup of deprecated device roles after hardware lifecycle changes.
- Integrating with workflows that decommission devices and their associated roles.
- Managing device role data programmatically as part of network inventory updates.
Properties
| Name | Meaning |
|---|---|
| Domain | The domain of the NetBox API to interact with. Options: DCIM, IPAM, Tenancy, Extras, Virtualization, Circuits, Core, Users, Plugins, VPN, Wireless, Status. For this operation, must be "DCIM". |
| Device Role ID | The unique identifier (ID) of the device role to delete in the NetBox system. Required when Domain is "DCIM" and Resource is "Device Role". |
Output
The node outputs JSON data representing the result of the delete operation. Typically, this will be an empty response or confirmation that the device role was successfully deleted. If an error occurs, the output JSON will contain an error field with the error message.
No binary data output is involved in this operation.
Dependencies
- Requires access to a NetBox instance with appropriate API permissions.
- Needs 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 libraries beyond those bundled with the node.
Troubleshooting
Common issues:
- Providing an invalid or non-existent Device Role ID will cause the API to return an error.
- Insufficient API permissions can lead to authorization errors.
- Incorrect Domain or Resource selection may prevent the operation from executing properly.
Error messages:
"404 Not Found": The specified Device Role ID does not exist. Verify the ID."401 Unauthorized"or"403 Forbidden": API credentials lack necessary permissions. Check API key and user rights.- Network or connectivity errors: Ensure the NetBox API endpoint is reachable from n8n.
To handle errors gracefully, enable the "Continue on Fail" option in the node settings to receive error details in the output instead of stopping workflow execution.
Links and References
- NetBox API Documentation
- NetBox Device Roles API Endpoint
- n8n Documentation on HTTP Request Nodes and Credentials (for understanding API authentication setup)