Inventory Device
The Inventory Device API provides comprehensive device management
capabilitiescapabilities,forallowing you to perform CRUD operations on networkdevicesdevices,withinmonitoryourtheirinfrastructure.status, and execute device operations like reboots and factory resets. These endpointsenableareyouessentialtoforretrieve,managingcreate,deviceupdate,inventories, tracking device health, anddeleteperforming remote devicerecords,administrationmonitorindevicenetworkstatus,managementand track organizational device inventory with advanced filtering options.systems.
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 interfaceof device management operations, providing full lifecycle management for managing network devices in your infrastructure monitoring system.devices. This API category allowsenables you to maintain a complete inventory of network devices including routers, switches, servers, and other network equipment across different organizations.
Key Capabilities:to:
- Device Inventory Management: Create, read, update, and delete device records with comprehensive metadata including serial numbers, locations, firmware versions, and organizational assignments
-
Status Monitoring: Track device
statusoperational(Up/Down)status, connection history, andmonitorconfigurationstatusstateschangeswithoverreal-timetimeupdates
Common Integration Scenarios:
The API supports both individual devicebulk operations andthrough bulkthe operationslist endpoint with advanced filtering, and individual device management through the detail endpoints. Device operations are designed to work with CWMP/TR-069 protocols for remote device management, making it suitableideal for both real-time applicationsISP and batchenterprise processingnetwork workflows.management scenarios.
Key concepts include device types (profiles/templates), pending settings tracking, firmware management, and comprehensive audit trails for all device interactions.
Endpoints
GET /inventory_device/
Description: Retrieves a paginated list of inventory devices with comprehensive filtering options.capabilities. This endpoint is essential for buildingdevice discovery, status monitoring, and bulk device dashboards,management generatingoperations. reports,It supports real-time status updates and synchronizingpending devicesettings inventories with external systems.detection.
Use Cases:
BuildingDashboardnetworkdisplaysmonitoringshowingdashboardsall devices with current status
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device/?status=1&organization=123&status=true5&limit=50&offset=0update_status=true
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| type | integer | query | No | Filter devices by device |
| status | string | query | No | Filter by device status. Use '0'/'false'/'False' for Down devices, '1'/'true'/'True' for Up |
| last_status_change_from | string | query | No | Filter devices with status changes after specified datetime (ISO format: 2000-01-01T00:01:00+00:00) |
| organization | integer | query | No | Filter devices by organization ID |
| limit | integer | query | No | Number of results per page (default: |
| offset | integer | query | No | Starting index for pagination |
| pending | boolean | query | No | |
| update_status | boolean | query | No |
cURL Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_device/?status=1&organization=123&status=true5&limit=20"25&update_status=true" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 156,150,
"next": "https://control.zequenze.com/api/v1/inventory_device/?limit=2025&offset=2025&organization=1235&status=1&update_status=true",
"previous": null,
"results": [
{
"id": 1001,
"uuid": "550e8400-e29b-41d4-a716-446655440001",
"name": "core-router-01"Router-Branch-Office-001",
"hostname"customer_id": "CUST-2024-001",
"is_active": true,
"status": "Up",
"status_change": "2024-01-15T09:30:15Z",
"type": 12,
"type_short_name": "enterprise_router",
"software_version": "2.4.1",
"hardware_version": "v1.2",
"manufacturer": "Zequenze Systems",
"serial_number": "ZEQ240100001",
"description": "Main branch office router",
"organization_id": 5,
"location_name": "New York Branch Office",
"location": 25,
"location_short_name": "ny_branch",
"latitude": "40.7128",
"longitude": "-74.0060",
"address": "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"last_connection": "2024-01-15T08:30:00Z"15T14:22:30Z",
"pending_config": false,
"location": "Data Center A - Rack 10",
"created_at"last_configuration": "2024-01-10T14:20:14T10:15:00Z",
"updated_at"created": "2024-01-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:10T08:00:00Z",
"pending_config": true,
"location"pending_settings": "Floor 2 - IDF Room",
"created_at": "2024-01-08T09:15:00Z",
"updated_at": "2024-01-15T07:20:00Z"firmware_update,reboot_scheduled"
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns paginated device list |
POST /inventory_device/
Description: Creates a new inventory device record in the inventory system. This endpoint is used whenfor provisioningdevice onboarding, bulk device imports, and integrating new network equipment orinto registeringthe existingmanagement devices for monitoring.platform.
Use Cases:
AutomatedAddingdevicenewprovisioningdevices during network expansion- Bulk
deviceimportingregistrationdevices fromdiscoveryspreadsheetstoolsor other systems ManualPre-configuring deviceregistrationrecordsthroughbeforemanagementphysicalinterfacesdeploymentIntegrationSettingwithupprocurementdevicesystemscredentials fornewCWMP/TR-069equipment trackingauthentication
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device/
Parameters:
cURL Example:
curl -X POST "https://control.zequenze.com/api/v1/inventory_device/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "new-firewall-01"Router-Branch-Office-002",
"hostname"customer_id": "192.168.1.100"CUST-2024-002",
"serial_number": "FW7000-GHI789"ZEQ240100002",
"type": 3,12,
"organization"organization_id": 123,5,
"location"location_name": "DataBoston CenterBranch B - Rack 5"Office",
"status"description": true"Secondary branch office router",
"username": "device_admin",
"password": "secure_password_123",
"update_frequency": 300
}'
Example Request Body:
{
"name": "new-firewall-01"Router-Branch-Office-002",
"hostname"customer_id": "192.168.1.100"CUST-2024-002",
"serial_number": "FW7000-GHI789"ZEQ240100002",
"serial_number_alt": "ALT-ZEQ240100002",
"type": 3,12,
"organization"organization_id": 123,5,
"location"location_name": "DataBoston CenterBranch B - Rack 5"Office",
"status"latitude": true,"42.3601",
"longitude": "-71.0589",
"description": "PrimarySecondary firewallbranch foroffice DMZrouter",
network""username": "device_admin",
"password": "secure_password_123",
"update_frequency": 300
}
Example Response:
{
"id": 1003,1002,
"uuid": "550e8400-e29b-41d4-a716-446655440002",
"name": "new-firewall-01"Router-Branch-Office-002",
"hostname"customer_id": "192.168.1.100"CUST-2024-002",
"is_active": false,
"status": "Down",
"status_change": "2024-01-15T15:30:00Z",
"type": 12,
"type_short_name": "enterprise_router",
"software_version": null,
"hardware_version": null,
"manufacturer": null,
"serial_number": "FW7000-GHI789"ZEQ240100002",
"type": {
"id": 3,
"name"serial_number_alt": "Firewall",
"model": "Fortinet FortiGate 600E"
},
"organization": {
"id": 123,
"name": "Headquarters Network"
},
"status": true,
"last_status_change": "2024-01-15T10:45:00Z",
"pending_config": false,
"location": "Data Center B - Rack 5"ALT-ZEQ240100002",
"description": "PrimarySecondary firewallbranch foroffice DMZ network"router",
"created_at"organization_id": 5,
"location_name": "Boston Branch Office",
"latitude": "42.3601",
"longitude": "-71.0589",
"username": "device_admin",
"update_frequency": 300,
"created": "2024-01-15T10:45:15T15:30:00Z",
"updated_at"pending_settings": "2024-01-15T10:45:00Z"null
}
Response Codes:
| Status | Description |
|---|---|
| 201 | Created - Device successfully created |
| 400 | Bad Request - Invalid input data or missing required fields |
| 401 | Unauthorized - Invalid or missing API token |
GET /inventory_device/{id}/
Description: Retrieves detailed information forabout a specific inventory device by its unique identifier.ID. This endpoint provides complete device metadatametadata, operational status, and supportsconfiguration real-timedetails statusfor updates.individual device management.
Use Cases:
- Device detail
pagesviews in management interfaces Real-timeRetrieving devicemonitoringinformation for configuration operations
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device/1001/?update_status=pending=true&pending=update_status=true
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | integer | path | Yes | Unique |
| pending | boolean | query | No | Include detailed |
| update_status | boolean | query | No |
cURL Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_device/1001/?pending=true&update_status=true" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"id": 1001,
"uuid": "550e8400-e29b-41d4-a716-446655440001",
"name": "core-router-01"Router-Branch-Office-001",
"hostname"customer_id": "CUST-2024-001",
"is_active": true,
"status": "Up",
"status_change": "2024-01-15T09:30:15Z",
"type": 12,
"type_short_name": "enterprise_router",
"software_version": "2.4.1",
"hardware_version": "v1.2",
"manufacturer": "Zequenze Systems",
"unique_identifier": "ZEQ:ENT:RTR:240100001",
"product_class": "EnterpriseRouter",
"serial_number": "ZEQ240100001",
"serial_number_alt": "ALT-ZEQ240100001",
"description": "Main branch office router",
"organization_id": 5,
"firmware_image": 45,
"firmware_image_is_pending": true,
"location_name": "New York Branch Office",
"location": 25,
"location_short_name": "ny_branch",
"latitude": "40.7128",
"longitude": "-74.0060",
"username": "device_admin",
"update_frequency": 300,
"address": "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"last_connection": "2024-01-15T08:30:15T14:22:30Z",
"last_configuration": "2024-01-14T10:15:00Z",
"uptime"last_change": "45 days, 12:30:15"2024-01-15T12:45:20Z",
"pending_config"created": "2024-01-10T08:00:00Z",
"debug": false,
"pending_details": [],
"location"pending_settings": "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": "firmware_update:pending,reboot_scheduled:2024-01-10T14:20:00Z",
"updated_at": "2024-01-15T10:45:00Z",
"last_seen": "2024-01-15T10:45:16T02:00:00Z"
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Insufficient permissions to view this device |
| 404 | Not Found - Device with specified ID does not exist |
PUT /inventory_device/{id}/
Description: CompletelyUpdates updatesall fields of an existing inventory device record, replacing all fields with the provided data.record. This endpoint requiresperforms alla mandatorycomplete fieldsreplacement to be included inof the request.device record and is used for comprehensive device configuration updates and bulk data corrections.
Use Cases:
- Complete device reconfiguration
afterduring network changes
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device/1001/
Parameters:
cURL Example:
curl -X PUT "https://control.zequenze.com/api/v1/inventory_device/1001/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "core-router-01-updated"Router-Branch-Office-001-Updated",
"hostname"customer_id": "192.168.1.1"CUST-2024-001",
"serial_number": "RT5500-ABC123"ZEQ240100001",
"type": 1,15,
"organization"organization_id": 123,5,
"status": true,
"location"location_name": "DataNew CenterYork AMain - Rack 12"Office",
"description": "Updated primarymain coreoffice router with new firmware"configuration",
"latitude": "40.7589",
"longitude": "-73.9851",
"update_frequency": 180
}'
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": 1001,
"name": "core-router-01-updated",
"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,
"last_status_change": "2024-01-15T08:30:00Z",
"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-10T14:20:00Z",
"updated_at": "2024-01-15T11:30:00Z"
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Device updated successfully |
| 400 | Bad Request - Invalid |
| 401 | Unauthorized - Invalid or missing API token |
PATCH /inventory_device/{id}/
Description: PartiallyPerforms partial updates specific fields ofon an existing inventory device recordrecord. This endpoint allows you to update specific fields without affecting other fields.device Thisproperties endpointand is ideal for targeted updatesoperations such aslike status changes, locationconfiguration moves,updates, or individualdevice field corrections.operations.
Use Cases:
StatusTriggeringupdatesdevicefromoperationsmonitoring(reboot,systemsfactory reset, sync)Location changes duringUpdating devicemoveslocation or description without changing credentialsFirmwareSettingversionfirmwareupdatesupdateafterflagsupgradesand scheduling operationsIndividualEnablingfielddebugcorrectionsmodewithoutorfullchangingrecordadministrativereplacementstate
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device/1001/
Parameters:
cURL Example:Example for Device Reboot:
curl -X PATCH "https://control.zequenze.com/api/v1/inventory_device/1001/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"status"reboot": false,true,
"location"debug": "Data Center C - Rack 15",
"firmware_version": "16.12.09"true
}'
cURL Example Requestfor Body:Firmware Update:
curl -X PATCH "https://control.zequenze.com/api/v1/inventory_device/1001/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"status"firmware_image": false,47,
"location"firmware_image_is_pending": "Data Center C - Rack 15",
"firmware_version": "16.12.09",
"description": "Router relocated to backup data center"true
}'
cURL Example Response:for Configuration Sync:
curl -X PATCH "https://control.zequenze.com/api/v1/inventory_device/1001/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id"sync": 1001,true,
"name"reconf": "core-router-01-updated",
"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"true
},'
"organization":
Device "id":Operation 123,Parameters:
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Device |
| 400 | Bad Request - Invalid operation or field values |
| 401 | Unauthorized - Invalid or missing API token |
DELETE /inventory_device/{id}/
Description: Permanently removes aan inventory device record from the inventory system. This actionoperation is irreversible and shouldwill bedelete usedall carefully, typically duringassociated device decommissioningdata, orconfigurations, cleanupand operations.history. Use with caution in production environments.
Use Cases:
DeviceRemovingdecommissioningdecommissionedanddevicesretirementfrom inventoryCleanupCleaningofupduplicatetest orinvalidduplicate device recordsAutomated cleanup during deviceDevice lifecycle management for retired equipmentDataBulkpurgingcleanupforoperationscomplianceduringorsystemstorage optimizationmaintenance
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device/1001/
Parameters:
cURL Example:
curl -X DELETE "https://control.zequenze.com/api/v1/inventory_device/1001/" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Response Codes:
| Status | Description |
|---|---|
| 204 | No 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 exist |
| 409 | Conflict - Device cannot be deleted due to dependencies |
Common Use Cases
Use Case 1: NetworkDevice Health Monitoring Dashboard
BuildCreate a real-time network monitoring dashboard thatby displaysusing devicethe list endpoint with status acrossfiltering multipleand organizations.automatic Useupdates. Combine GET /inventory_device/ with organization, status, and status=1&update_status=true parameters to fetchshow currentall deviceactive states,devices, then use to PATCH /inventory_device/{id}/status=0updateidentify devicedown statusdevices basedrequiring on monitoring results.attention.
Use Case 2: AutomatedRemote Device ProvisioningOperations
ImplementExecute anremote automateddevice provisioningmanagement workflowby forusing newPATCH networkoperations equipment.to trigger device actions. Use the detail endpoint to check pending operations, then PATCH with specific operation flags like POSTreboot=true/inventory_device/or sync=true to registerperform newmaintenance devices during deployment, then GET /inventory_device/{id}/ to retrieve device details for configuration management systems.tasks.
Use Case 3: Device LifecycleFirmware Management Workflow
CreateImplement afirmware comprehensiveupdates deviceby lifecycle management systemfirst using GET /inventory_device/ with type and last_status_change_from filters to identify devices needing maintenance,updates, then PATCH to set PUT /inventory_device/{id}/firmware_image for major updates during hardware refresh, and DELETE /inventory_device/{id}/firmware_image_is_pending=trueforflags. deviceMonitor retirement.the process through the pending_settings field in subsequent GET requests.
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 inparameter. GETCombine /inventory_device/ requests, ensuringwith proper API token scoping to ensure users only access controldevices within their authorized organizations.
Use Case 5: Device Onboarding Automation
Automate device deployment by using POST to create device records with pre-configured credentials and datasettings, segregationthen formonitor differentfirst businessconnection units.through the last_connection field using GET requests with update_status=true.
Best Practices
-
Pagination Management: Always use
limitandoffsetparameters for large deviceinventories to optimize performance and memory usage.inventories. Start with reasonable page sizes (20-25-50 devices) to balance performance andadjust based on your application needs.usability. -
Status
UpdatesUpdate Optimization: Useupdate_status=truesparinglyjudiciously as itperformstriggers real-time devicechecksqueries.thatEnablecan significantly increase response time. Consider caching mechanismsit forfrequentlycriticalaccessedmonitoringdevicebutstatusavoidinformation.it in high-frequency polling scenarios to prevent network overhead. -
ErrorDeviceHandlingOperations:ImplementWhenrobustperformingerrordevicehandlingoperationsforvianetworkPATCH,timeoutmonitorscenarios,theespeciallypending_settingswhenfieldusingtoreal-timetrackstatusoperationupdates.completion.AlwaysOperationscheckareresponse codesasynchronous andprovidemaymeaningfultakefeedbacktime tousers.complete. -
Batch Operations: For bulk device
updates,management,useimplementindividualpropererrorPATCHrequestshandlingforandtargetedretryfieldlogic.updatesUseratherthethanlistfullendpointwithPUTrequestsappropriate filters tominimizeidentifydatatargettransferdevicesandbeforereduceperformingthebatchrisk of data conflicts.updates. -
Security Considerations:
Never expose API tokens in client-side code. Always validateStore devicedatapasswordsonsecurely and rotate them regularly. Use strong authentication credentials and consider theserversecuritysideimplicationsbeforeofsubmission,debugandmodeimplementwhenproper access controls based on organization boundaries.troubleshooting. -
DataErrorIntegrityHandling:UseImplementserialcomprehensivenumberserrorand MAC addresses as natural keyshandling for deviceidentificationoperations, especially for remote operations that may fail due topreventnetworkduplicate entries. Validate IP addresses and hostnames before creatingconnectivity orupdatingdevicerecords.state issues.