xPlantAPI
API referenceDevices

Send a heartbeat

Tells xPlant the device is alive and stamps its last-seen time. xPlant shows a device as offline once 15 minutes pass without hearing from it, so send a heartbeat every minute or two. The request has no body.

POST/api/v1/devices/{deviceId}/heartbeat
Scope write:devicesAccepts a device token

A repeated heartbeat does no harm, so a retry needs no Idempotency-Key. A device token may send heartbeats only for its own device.

Path parameters

NameTypeRequiredDescription
deviceIdstring (uuid)YesThe device's id.

Example

curl -X POST https://app.xplantpro.com/api/v1/devices/5f7a9c1e-3b5d-4f7a-9c1e-3b5d7f9a1c3e/heartbeat \
  -H "Authorization: Bearer $XPLANT_DEVICE_TOKEN"

Response

200 with { "ok": true, "data": … }. data holds the result.

FieldTypeRequiredDescription
received_atstringYesWhen the heartbeat was recorded, as an ISO 8601 timestamp.
Response
{
  "ok": true,
  "data": {
    "received_at": "2026-09-25T14:05:00.000Z"
  }
}
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_WRONG_DEVICEA device token was used to write about a device other than its own.
404NOT_FOUNDNo device with this id is registered in the key's workspace.
429RATE_LIMIT_EXCEEDEDToo many requests for this key, device token or workspace. Wait Retry-After seconds.
500DEVICE_UPDATE_FAILEDThe heartbeat could not be recorded. Retry, or send the next one on schedule.

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

On this page