Inventory Device
ManageTheinventoryInventorydevicesDeviceincludingAPIstatusprovidesmonitoring,comprehensiveorganizationmanagementfiltering, and CRUD operationscapabilities for network devices within your infrastructure. These endpoints enable you to retrieve, create, update, and delete devicemanagement.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:
Common Integration Scenarios:
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:
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 |
| status | string | query | No | Filter by |
| last_status_change_from | string | query | No | Filter |
| organization | integer | query | No | Filter |
| limit | integer | query | No | Number of results |
| offset | integer | query | No | |
| pending | boolean | query | No | |
| update_status | boolean | query | No |
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 |
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:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| data | object | body | Yes |
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 |
| 401 | Unauthorized - Invalid or missing API token |
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:
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 | |
| pending | boolean | query | No | |
| update_status | boolean | query | No |
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 |
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:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device/1001/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | integer | path | Yes | |
| data | object | body | Yes | Complete device |
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 | |
| 400 | Bad |
| 401 | Unauthorized - Invalid or missing API token |
| 404 | Not Found - Device with specified ID does not |
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:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device/1001/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | integer | path | Yes | |
| data | object | body | Yes |
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 | |
| 400 | Bad |
| 401 | Unauthorized - Invalid or missing API token |
| 404 | Not Found - Device with specified ID does not |
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:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_device/1001/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | integer | path | Yes |
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 | |
| 401 | Unauthorized - Invalid or missing API token |
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
UsethePagination:
Alwaysupdate_status=trueparameterusewhen you need real-time device status information
limit and offsetStatus Updates: Use pending_settingsupdate_status=truefieldsparingly toas identifyit devicesperforms real-time device checks that requirecan configurationsignificantly updatesincrease response time. Consider caching mechanisms for frequently accessed device status information.
Error insteadHandling: ofImplement PUT for partial updates to avoid overwriting unchanged fields
truefalseBatch 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.