AI-Agent-First Documentation
Prompt your Agent: "Query and mutate records on the 'device' table (ID prefix 'dev_') using platform.records and platform.query.sql, ensuring all lookup fields use plain string IDs."
Device (device)
Devices are the hardware that you have connected to the Valstorm ecosystem
Python SDK & PlatformContext Example
# 1. Query device via parameterized ANSI SQL
rows = await platform.query.sql("SELECT id, name, created_date FROM device ORDER BY created_date DESC LIMIT 25")
# 2. Create device record (Generates 'dev_...' Base62 ID)
created = await platform.records.create("device", [
{"name": "Example Device"}
])| Field API Name | Type / Format | Lookup Target | Flags | Description |
|---|---|---|---|---|
| id | string | — | Id | |
| name | string | — | Name | |
| created_date | stringdate-time | — | Created Date | |
| modified_date | stringdate-time | — | Modified Date | |
| created_by | stringlookup | → user (string ID) | Created By | |
| modified_by | stringlookup | → user (string ID) | Modified By | |
| owner | stringlookup | → user (string ID) | Owner | |
| shared_with | listsharing | — | system | Shared With |
| device_type | stringenum | → unnamed (string ID) | required | Device Type |
| operating_system | string | — | required | Important for the backend to know how to format OS-specific shell commands. |
| connection_status | stringenum | — | required | Connection Status |
| last_active | stringdate-time | — | The UTC timestamp of the device's last successful WebSocket heartbeat | |
| app_version | string | — | The version of the Valstorm Desktop/Mobile app currently installed on the device (e.g., `0.1.2`) | |
| push_token | string | — | FCM/APNs token used to send background wake-up notifications if the device WebSocket drops. | |
| capabilities | list | — | An array of strings denoting what this hardware supports. | |
| hardware_specification | jsonjson | — | Optional metadata dictionary containing RAM, CPU cores, or GPU model to help the routing engine decide if a task is too heavy for the device. |
