Skip to main content

Inventory Device

ManageThe inventoryInventory devicesDevice includingAPI statusprovides monitoring,comprehensive organizationmanagement filtering, and CRUD operationscapabilities for network devices within your infrastructure. These endpoints enable you to retrieve, create, update, and delete device management.records, monitor device status, and track organizational device inventory with advanced filtering options.

Base URL: https://control.zequenze.com/api/v1

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The Inventory Device API is the core interface for managing network devices in your infrastructure monitoring system. This API category allows you to maintain a complete inventory of network devices including routers, switches, servers, and other network equipment across different organizations.

Key Capabilities:

    Device Management: Create, read, update, and delete device records with comprehensive metadata Status Monitoring: Track device status (Up/Down) and monitor status changes over time Organizational Filtering: Manage devices across multiple organizations with role-based access Real-time Updates: Optionally update device status in real-time when retrieving device information Pending Configuration Tracking: Monitor devices that have pending configuration changes

    Common Integration Scenarios:

      Network monitoring dashboards that need to display device inventory and status Automated provisioning systems that register new devices Maintenance workflows that update device configurations and track changes Reporting systems that generate device inventory reports by organization or status Alert systems that need to correlate device information with monitoring events

      The API supports both individual device operations and bulk operations with advanced filtering, making it suitable for both real-time applications and batch processing workflows.


      Endpoints

      GET /inventory_device/

      RetrieveDescription: Retrieves a paginated list of inventory devices with optionalcomprehensive filtering options. This endpoint is essential for building device dashboards, generating reports, and pagination.synchronizing device inventories with external systems.

      Use Cases:

        Building network monitoring dashboards that display device status across organizations Generating inventory reports filtered by device type, status, or organization Synchronizing device data with external CMDB or asset management systems Monitoring devices with pending configuration changes

        Full URL Example:

        https://control.zequenze.com/api/v1/inventory_device/?organization=123&status=true&limit=50&offset=0
        

        Parameters:

        Parameter Type In Required Description
        type integer query No Filter devicedevices by device 'type'type ID field(e.g., router=1, switch=2, server=3)
        status string query No Filter by statusdevice ('0'/'false'/'False'status. for Down,Use '1'/'true'/'True' for Up)Up devices, '0'/'false'/'False' for Down devices
        last_status_change_from string query No Filter bydevices with status changes after specified datetime in (ISO format (2000-01-01,format: 2000-01-01 00:01:00, 2000-01-01 00:01T00:01:00+00:00)
        organization integer query No Filter devicedevices by device 'organization'organization ID fieldfor multi-tenant environments
        limit integer query No Number of results to return per page (default: 20, max: 100)
        offset integer query No The initialStarting index fromfor whichpagination to(use returnwith thelimit resultsfor page navigation)
        pending boolean query No ReportFilter ifdevices thethat device hashave pending settingsconfiguration changes (true/false)
        update_status boolean query No UsePerform configured helpers to update devicereal-time status check before returning results (may increase response time)

        ExamplecURL Request:Example:

        curl -X GET "https://control.zequenze.com/api/v1/inventory_device/?organization=1123&status=true&limit=1020" \
          -H "Authorization: Bearer YOUR_API_TOKEN" \
          -H "Content-Type: application/json"
        

        Example Response:

        {
          "count": 25,156,
          "next": "https://control.zequenze.com/api/v1/inventory_device/?limit=1020&offset=10"20&organization=123&status=true",
          "previous": null,
          "results": [
            {
              "id": 1,1001,
              "name": "Router-Main-core-router-01",
              "type": 2,
              "organization": 1,
              "status": true,
              "ip_address"hostname": "192.168.1.1",
              "serial_number": "RT5500-ABC123",
              "type": {
                "id": 1,
                "name": "Router",
                "model": "Cisco ISR 4451"
              },
              "organization": {
                "id": 123,
                "name": "Headquarters Network"
              },
              "status": true,
              "last_status_change": "2024-01-15T10:15T08:30:00Z",
              "pending_settings"pending_config": false,
              "location": "Data Center A - Rack 10",
              "created_at": "2024-01-01T00:00:10T14:20:00Z",
              "updated_at": "2024-01-15T10:15T08:30:00Z"
            },
            {
              "id": 1002,
              "name": "access-switch-02", 
              "hostname": "192.168.1.10",
              "serial_number": "SW2960-DEF456",
              "type": {
                "id": 2,
                "name": "Switch",
                "model": "Cisco Catalyst 2960"
              },
              "organization": {
                "id": 123,
                "name": "Headquarters Network"
              },
              "status": true,
              "last_status_change": "2024-01-14T16:45:00Z",
              "pending_config": true,
              "location": "Floor 2 - IDF Room",
              "created_at": "2024-01-08T09:15:00Z",
              "updated_at": "2024-01-15T07:20:00Z"
            }
          ]
        }
        

        Response Codes:

        Status Description
        200 Success - Returns paginated device list
        400 Bad Request - Invalid filter parameters 401 Unauthorized - Invalid or missing API token 403 Forbidden - Insufficient permissions for requested organization

        POST /inventory_device/

        CreateDescription: Creates a new device record in the inventory device.system. This endpoint is used when provisioning new network equipment or registering existing devices for monitoring.

        Use Cases:

          Automated device provisioning during network expansion Bulk device registration from discovery tools Manual device registration through management interfaces Integration with procurement systems for new equipment tracking

          Full URL Example:

          https://control.zequenze.com/api/v1/inventory_device/
          

          Parameters:

          Parameter Type In Required Description
          data object body Yes Device dataJSON object containing device information including name, hostname, type, organization, and optional metadata

          ExamplecURL Request:Example:

          curl -X POST "https://control.zequenze.com/api/v1/inventory_device/" \
            -H "Authorization: Bearer YOUR_API_TOKEN" \
            -H "Content-Type: application/jsonjson" \
            -d '{
              "name": "Switch-Floor-02"new-firewall-01",
              "hostname": "192.168.1.100",
              "serial_number": "FW7000-GHI789",
              "type": 3,
              "organization": 1,123,
              "ip_address"location": "192.168.1.10"Data Center B - Rack 5",
              "status": true
            }'
          

          Example Request Body:

          {
            "name": "new-firewall-01",
            "hostname": "192.168.1.100", 
            "serial_number": "FW7000-GHI789",
            "type": 3,
            "organization": 123,
            "location": "Data Center B - Rack 5",
            "status": true,
            "description": "Primary firewall for DMZ network"
          }
          

          Example Response:

          {
            "id": 2,1003,
            "name": "Switch-Floor-02"new-firewall-01",
            "hostname": "192.168.1.100",
            "serial_number": "FW7000-GHI789",
            "type": {
              "id": 3,
              "name": "Firewall",
              "model": "Fortinet FortiGate 600E"
            },
            "organization": 1,{
              "ip_address"id": 123,
              "name": "192.168.1.10"Headquarters Network"
            },
            "status": true,
            "last_status_change": "2024-01-15T14:20:15T10:45:00Z",
            "pending_settings"pending_config": false,
            "location": "Data Center B - Rack 5",
            "description": "Primary firewall for DMZ network",
            "created_at": "2024-01-15T14:20:15T10:45:00Z",
            "updated_at": "2024-01-15T14:20:15T10:45:00Z"
          }
          

          Response Codes:

          Status Description
          201 Created - Device successfully created
          400 Bad requestRequest - validationInvalid errorsor missing required fields
          401 Unauthorized - Invalid or missing API token
          409 Conflict - Device with same hostname or serial number already exists

          GET /inventory_device/{id}/

          RetrieveDescription: Retrieves detailed information for a specific inventory device by ID.its unique identifier. This endpoint provides complete device metadata and supports real-time status updates.

          Use Cases:

            Device detail pages in management interfaces Real-time device monitoring and status checking Configuration management workflows Troubleshooting and device diagnostics

            Full URL Example:

            https://control.zequenze.com/api/v1/inventory_device/1001/?update_status=true&pending=true
            

            Parameters:

            Parameter Type In Required Description
            id integer path Yes DeviceUnique IDidentifier of the device to retrieve
            pending boolean query No ReportInclude ifdetailed theinformation device hasabout pending settingsconfiguration changes
            update_status boolean query No UsePerform configured helpers to update devicereal-time status check before returning device information

            ExamplecURL Request:Example:

            curl -X GET "https://control.zequenze.com/api/v1/inventory_device/1/1001/?update_status=truetrue" \
              -H "Authorization: Bearer YOUR_API_TOKEN" \
              -H "Content-Type: application/json"
            

            Example Response:

            {
              "id": 1,1001,
              "name": "Router-Main-core-router-01",
              "type": 2,
              "organization": 1,
              "status": true,
              "ip_address"hostname": "192.168.1.1",
              "serial_number": "RT5500-ABC123",
              "mac_address": "00:1B:44:11:3A:B7",
              "type": {
                "id": 1,
                "name": "Router",
                "model": "Cisco ISR 4451",
                "manufacturer": "Cisco Systems"
              },
              "organization": {
                "id": 123,
                "name": "Headquarters Network",
                "contact_email": "netadmin@company.com"
              },
              "status": true,
              "last_status_change": "2024-01-15T10:15T08:30:00Z",
              "pending_settings"uptime": "45 days, 12:30:15",
              "pending_config": false,
              "pending_details": [],
              "location": "Data Center A - Rack 10",
              "description": "Primary core router handling inter-VLAN routing",
              "firmware_version": "16.12.05",
              "management_ip": "192.168.100.1",
              "snmp_community": "public",
              "created_at": "2024-01-01T00:00:10T14:20:00Z",
              "updated_at": "2024-01-15T10:30:45:00Z",
              "last_seen": "2024-01-15T10:45:00Z"
            }
            

            Response Codes:

            Status Description
            200 Success - Returns complete device information
            401 Unauthorized - Invalid or missing API token
            403 Forbidden - Insufficient permissions to view this device 404 Not Found - Device with specified ID does not foundexist

            PUT /inventory_device/{id}/

            UpdateDescription: Completely updates an entire inventoryexisting device record.record, replacing all fields with the provided data. This endpoint requires all mandatory fields to be included in the request.

            Use Cases:

              Complete device reconfiguration after hardware replacement Bulk device updates from configuration management systems Device migration between organizations or locations Comprehensive device metadata synchronization

              Full URL Example:

              https://control.zequenze.com/api/v1/inventory_device/1001/
              

              Parameters:

              Parameter Type In Required Description
              id integer path Yes DeviceUnique IDidentifier of the device to update
              data object body Yes Complete device dataobject objectwith all required fields

              ExamplecURL Request:Example:

              curl -X PUT "https://control.zequenze.com/api/v1/inventory_device/1/1001/" \
                -H "Authorization: Bearer YOUR_API_TOKEN" \
                -H "Content-Type: application/jsonjson" \
                -d '{
                  "name": "Router-Main-core-router-01-Updated"updated",
                  "type": 2,
                "organization": 1,
                "ip_address"hostname": "192.168.1.1",
                  "serial_number": "RT5500-ABC123",
                  "type": 1,
                  "organization": 123,
                  "status": falsetrue,
                  "location": "Data Center A - Rack 12",
                  "description": "Updated primary core router with new firmware"
                }'
              

              Example Request Body:

              {
                "name": "core-router-01-updated",
                "hostname": "192.168.1.1",
                "serial_number": "RT5500-ABC123",
                "mac_address": "00:1B:44:11:3A:B7",
                "type": 1,
                "organization": 123,
                "status": true,
                "location": "Data Center A - Rack 12",
                "description": "Updated primary core router with new firmware",
                "firmware_version": "16.12.08",
                "management_ip": "192.168.100.1"
              }
              

              Example Response:

              {
                "id": 1,1001,
                "name": "Router-Main-core-router-01-Updated"updated",
                "type": 2,
                "organization": 1,
                "ip_address"hostname": "192.168.1.1",
                "serial_number": "RT5500-ABC123",
                "mac_address": "00:1B:44:11:3A:B7",
                "type": {
                  "id": 1,
                  "name": "Router",
                  "model": "Cisco ISR 4451"
                },
                "organization": {
                  "id": 123,
                  "name": "Headquarters Network"
                },
                "status": false,true,
                "last_status_change": "2024-01-15T16:45:15T08:30:00Z",
                "pending_settings"pending_config": false,
                "location": "Data Center A - Rack 12",
                "description": "Updated primary core router with new firmware",
                "firmware_version": "16.12.08",
                "management_ip": "192.168.100.1",
                "created_at": "2024-01-01T00:00:10T14:20:00Z",
                "updated_at": "2024-01-15T16:45:15T11:30:00Z"
              }
              

              Response Codes:

              Status Description
              200 UpdatedSuccess - Device successfully updated
              400 Bad requestRequest - validationInvalid errorsor missing required fields
              401 Unauthorized - Invalid or missing API token
              404 Not Found - Device with specified ID does not foundexist

              PATCH /inventory_device/{id}/

              Description: Partially updateupdates specific fields of an inventoryexisting device record.record without affecting other fields. This endpoint is ideal for targeted updates such as status changes, location moves, or individual field corrections.

              Use Cases:

                Status updates from monitoring systems Location changes during device moves Firmware version updates after upgrades Individual field corrections without full record replacement

                Full URL Example:

                https://control.zequenze.com/api/v1/inventory_device/1001/
                

                Parameters:

                Parameter Type In Required Description
                id integer path Yes DeviceUnique IDidentifier of the device to update
                data object body Yes Partial device dataJSON object containing only the fields to be updated

                ExamplecURL Request:Example:

                curl -X PATCH "https://control.zequenze.com/api/v1/inventory_device/1/1001/" \
                  -H "Authorization: Bearer YOUR_API_TOKEN" \
                  -H "Content-Type: application/jsonjson" \
                  -d '{
                    "status": true,false,
                    "name"location": "Router-Main-01-Active"Data Center C - Rack 15",
                    "firmware_version": "16.12.09"
                  }'
                

                Example Request Body:

                {
                  "status": false,
                  "location": "Data Center C - Rack 15", 
                  "firmware_version": "16.12.09",
                  "description": "Router relocated to backup data center"
                }
                

                Example Response:

                {
                  "id": 1,1001,
                  "name": "Router-Main-core-router-01-Active"updated",
                  "type": 2,
                  "organization": 1,
                  "ip_address"hostname": "192.168.1.1",
                  "serial_number": "RT5500-ABC123",
                  "mac_address": "00:1B:44:11:3A:B7",
                  "type": {
                    "id": 1,
                    "name": "Router",
                    "model": "Cisco ISR 4451"
                  },
                  "organization": {
                    "id": 123,
                    "name": "Headquarters Network"
                  },
                  "status": true,false,
                  "last_status_change": "2024-01-15T17:00:15T12:15:00Z",
                  "pending_settings"pending_config": false,
                  "location": "Data Center C - Rack 15",
                  "description": "Router relocated to backup data center",
                  "firmware_version": "16.12.09",
                  "management_ip": "192.168.100.1",
                  "created_at": "2024-01-01T00:00:10T14:20:00Z",
                  "updated_at": "2024-01-15T17:00:15T12:15:00Z"
                }
                

                Response Codes:

                Status Description
                200 UpdatedSuccess - Device fields successfully updated
                400 Bad requestRequest - validationInvalid errorsfield values
                401 Unauthorized - Invalid or missing API token
                404 Not Found - Device with specified ID does not foundexist

                DELETE /inventory_device/{id}/

                DeleteDescription: anPermanently removes a device record from the inventory device.system. This action is irreversible and should be used carefully, typically during device decommissioning or cleanup operations.

                Use Cases:

                  Device decommissioning and retirement Cleanup of duplicate or invalid device records Automated cleanup during device lifecycle management Data purging for compliance or storage optimization

                  Full URL Example:

                  https://control.zequenze.com/api/v1/inventory_device/1001/
                  

                  Parameters:

                  Parameter Type In Required Description
                  id integer path Yes DeviceUnique IDidentifier of the device to delete

                  ExamplecURL Request:Example:

                  curl -X DELETE "https://control.zequenze.com/api/v1/inventory_device/1/1001/" \
                    -H "Authorization: Bearer YOUR_API_TOKEN"
                  

                  Response Codes:

                  Status Description
                  204 DeletedNo Content - Device successfully deleted
                  401 Unauthorized - Invalid or missing API token
                  403 Forbidden - Insufficient permissions to delete this device 404 Not Found - Device with specified ID does not foundexist 409 Conflict - Device cannot be deleted due to dependencies

                  Common Use Cases

                  Use Case 1: Network Monitoring Dashboard

                  Build a real-time network monitoring dashboard that displays device status across multiple organizations. Use GET /inventory_device/ with organization, status, and update_status=true parameters to fetch current device states, then use PATCH /inventory_device/{id}/ to update device status based on monitoring results.

                  Use Case 2: Automated Device Provisioning

                  Implement an automated provisioning workflow for new network equipment. Use POST /inventory_device/ to register new devices during deployment, then GET /inventory_device/{id}/ to retrieve device details for configuration management systems.

                  Use Case 3: Device Lifecycle Management

                  Create a comprehensive device lifecycle management system using GET /inventory_device/ with type and last_status_change_from filters to identify devices needing maintenance, PUT /inventory_device/{id}/ for major updates during hardware refresh, and DELETE /inventory_device/{id}/ for device retirement.

                  Use Case 4: Configuration Change Tracking

                  Track pending configuration changes across your network infrastructure by using GET /inventory_device/ with pending=true to identify devices with pending changes, then PATCH /inventory_device/{id}/ to update device status after configuration deployment.

                  Use Case 5: Multi-Tenant Device Management

                  Manage devices across multiple organizations or departments using the organization filter in GET /inventory_device/ requests, ensuring proper access control and data segregation for different business units.


                  Best Practices

                  • Use the

                    Pagination: update_status=trueAlways parameteruse when you need real-time device status information

                  Filter by organization to improve performance when dealing with large device inventories Use pagination (limit and offset) parameters for listing large numbersdevice ofinventories devicesto optimize performance and memory usage. Start with reasonable page sizes (20-50 devices) and adjust based on your application needs. Monitor the

                  Status Updates: Use pending_settingsupdate_status=true fieldsparingly toas identifyit devicesperforms real-time device checks that requirecan configurationsignificantly updatesincrease response time. Consider caching mechanisms for frequently accessed device status information.

                  Use PATCH

                  Error insteadHandling: ofImplement PUT for partial updates to avoid overwriting unchanged fields

                  When filtering by status, use boolean values (true/false) for consistency Include properrobust error handling for 404network responsestimeout scenarios, especially when accessingusing specificreal-time status updates. Always check response codes and provide meaningful feedback to users.

                  Batch Operations: For bulk device IDsupdates, use individual PATCH requests for targeted field updates rather than full PUT requests to minimize data transfer and reduce the risk of data conflicts.

                  Security: Never expose API tokens in client-side code. Always validate device data on the server side before submission, and implement proper access controls based on organization boundaries.

                  Data Integrity: Use ISOserial formatnumbers and MAC addresses as natural keys for datetimedevice filtersidentification to ensureprevent consistentduplicate resultsentries. acrossValidate timezonesIP addresses and hostnames before creating or updating device records.