{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nmi/json-schema/nmi-device-response-schema.json",
  "title": "Device Response",
  "description": "Response containing cloud device data",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nmi-devices-api-openapi.yml#/components/schemas/DeviceResponse",
  "type": "object",
  "required": [
    "object",
    "id",
    "registration_status"
  ],
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "device"
      ],
      "description": "String representing the object's type. Always 'device' for device objects."
    },
    "id": {
      "type": "string",
      "description": "Unique identifier for the device"
    },
    "device_nickname": {
      "type": [
        "string",
        "null"
      ],
      "description": "Nickname assigned to the device"
    },
    "make": {
      "type": [
        "string",
        "null"
      ],
      "description": "Device manufacturer"
    },
    "model": {
      "type": [
        "string",
        "null"
      ],
      "description": "Device model"
    },
    "serial_number": {
      "type": [
        "string",
        "null"
      ],
      "description": "Device serial number"
    },
    "registration_status": {
      "type": "string",
      "enum": [
        "registered",
        "deregistered"
      ],
      "description": "Current registration status of the device"
    },
    "last_transaction_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Date and time of the last transaction processed on this device"
    },
    "date_registered": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Date and time when the device was registered"
    },
    "date_deregistered": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Date and time when the device was deregistered"
    },
    "connection_status": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Whether the device is currently connected"
    },
    "last_connected_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Date and time when the device was last connected"
    },
    "last_disconnected_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Date and time when the device was last disconnected"
    },
    "battery_info": {
      "type": [
        "object",
        "null"
      ],
      "description": "Battery information (only included when current_status=true)"
    },
    "wifi_info": {
      "type": [
        "object",
        "null"
      ],
      "description": "WiFi information (only included when current_status=true)"
    }
  }
}