xPlantAPI
API referenceDevices

List devices

Every device registered to the workspace, newest first, a page at a time. Pages hold up to 200 devices by default, so most workspaces receive every device in the first answer; follow meta.next_cursor until it comes back null to be sure you have them all.

GET/api/v1/devices
Scope read:devices

Query parameters

NameTypeRequiredDescription
limitintegerNoPage size. Values above 200 are capped at 200. Default 200. From 1 to 200.
offsetintegerNoNumber of records to skip. Prefer cursor where a list offers it: an offset shifts when records are added ahead of it. Default 0. At least 0.
cursorstringNoContinue from the previous page: pass its meta.next_cursor unchanged, with the same filters. Treat it as opaque. Not combinable with offset. Up to 2048 characters.

Example

curl https://app.xplantpro.com/api/v1/devices \
  -H "Authorization: Bearer $XPLANT_API_KEY"

Response

200 with { "ok": true, "data": … }. data is an array. To get the next page, pass meta.next_cursor back as cursor; it is null on the last page. See Pagination.

FieldTypeRequiredDescription
idstring (uuid)Yes—
namestringYes—
typestringYesOne of sensor, controller, gateway.
hardwarestring | nullYes—
statusstringYesactive while the device is in service. paused or retired once someone in the lab takes it out of service, which refuses its readings and revokes its device tokens.
firmware_versionstring | nullYes—
room_idstring | null (uuid)YesThe growing room the device sits in, if one was set.
last_seen_atstring | nullYesWhen the device was last heard from, as an ISO 8601 timestamp. A heartbeat updates it. Null if it has never been heard from.
metadataobjectYesThe JSON object stored with the device when it was registered.
created_atstringYes—
updated_atstringYes—
Response
{
  "ok": true,
  "data": [
    {
      "id": "8e3b1f52-6c0d-4a7e-9b21-5f4d8c2a7e13",
      "name": "Shelf 3 climate probe",
      "type": "sensor",
      "hardware": "Raspberry Pi 4",
      "status": "active",
      "firmware_version": "1.4.2",
      "room_id": "2c6f9a41-7d3e-4b8a-a1c5-9e0d4f7b3a26",
      "last_seen_at": "2026-09-25T14:05:00.000Z",
      "metadata": {
        "shelf": 3
      },
      "created_at": "2026-09-01T09:30:00.000Z",
      "updated_at": "2026-09-25T14:05:00.000Z"
    }
  ]
}

The envelope can also carry meta:

FieldTypeRequiredDescription
next_cursorstring | nullYesPass as cursor to fetch the next page. null means this is the last page.
Response headerMeaning
X-Request-IdIdentifies this request. Include it when you contact support.

Errors

StatusCodeWhen
401UNAUTHORIZEDThe key is missing, malformed or revoked, or its owner is no longer a member of the workspace.
402PAID_PLAN_REQUIREDThe workspace has no paid plan. Connecting devices is included with every paid plan.
403FORBIDDENThe key lacks a scope this operation requires, or its owner's current role in the workspace cannot use it — a key never does more than its owner can in xPlant. error names the scope, and for a role, the role it needs.
403DEVICE_TOKEN_NOT_ACCEPTEDA device token was sent; this operation needs a workspace API key.
422VALIDATION_ERRORBoth cursor and offset were sent; use one.
422INVALID_CURSORThe cursor is malformed, or came from a different list or different filters. Start again without it.
429RATE_LIMIT_EXCEEDEDToo many requests for this key, device token or workspace. Wait Retry-After seconds.
500DEVICE_QUERY_FAILEDThe devices could not be read. Retry later.

Branch on code, never on the error text. See Errors.

On this page