Skip to main content

Get Devices

GET
/api/external/devices
Returns all devices for a specific customer

Query Parameters

customerId
string
required
The customer’s unique ID

Request Example

curl -X GET "https://dashboard.sphud.com/api/external/devices?customerId=cust-uuid-1234" \
  -H "X-API-Key: sphud_abc12345_xxxxxxxxxxxxxxxxxxxxxxxx"

Response

{
  "customerId": "cust-uuid-1234",
  "customerName": "Acme Corp",
  "devices": [
    {
      "id": "device-uuid-9012",
      "name": "ACME-PC-001",
      "deviceType": "Workstation",
      "externalId": "rmm-dev-777",
      "serialNumber": "SN-ABC-123"
    },
    {
      "id": "device-uuid-3456",
      "name": "ACME-SRV-001",
      "deviceType": "Server",
      "externalId": "rmm-dev-888",
      "serialNumber": "SN-DEF-456"
    }
  ],
  "count": 2
}

Import Devices

POST
/api/external/devices
Import or sync devices from an external system
Import devices from RMM tools or asset management systems. Devices are matched by:
  1. externalId (primary)
  2. serialNumber (fallback)
  3. name (final fallback)

Request Body

customerId
string
required
The customer’s unique ID
devices
array
required
Array of device objects to import
mode
string
default:"merge"
Import mode: merge or replace
  • merge (default): Adds new devices, preserves existing ones
  • replace: Removes all existing devices first, then imports

Request Example

curl -X POST "https://dashboard.sphud.com/api/external/devices" \
  -H "X-API-Key: sphud_abc12345_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": "cust-uuid-1234",
    "devices": [
      { 
        "name": "ACME-PC-001", 
        "deviceType": "Workstation", 
        "externalId": "rmm-dev-777",
        "serialNumber": "SN-ABC-123"
      },
      { 
        "name": "ACME-PC-002", 
        "deviceType": "Laptop", 
        "serialNumber": "SN-DEF-456"
      }
    ],
    "mode": "merge"
  }'

Response

{
  "success": true,
  "customerId": "cust-uuid-1234",
  "mode": "merge",
  "imported": 2,
  "total": 42
}
imported
number
Number of devices added or updated in this import
total
number
Total number of devices for this customer after import
Include both externalId and serialNumber when possible. This ensures accurate matching even if device names change.
When using replace mode, all existing devices will be removed before importing. Make sure your import data is complete!

Common Device Types

  • Workstation
  • Laptop
  • Server
  • Printer
  • Network Device
  • Mobile Device
  • Unknown (default if not specified)