Skip to main content

Devices

Manage the devices in your fleet — list, inspect, tag, update, and assign to cohorts.

Endpoints

MethodPathDescription
GET/api/orgs/{org_id}/devicesList devices
POST/api/orgs/{org_id}/devicesCreate a device
GET/api/orgs/{org_id}/devices/statsDevice counts
GET/api/orgs/{org_id}/devices/tagsList device tags
GET/api/orgs/{org_id}/devices/{id}Get a device
PUT/api/orgs/{org_id}/devices/{id}Update a device
DELETE/api/orgs/{org_id}/devices/{id}Delete a device
PUT/api/orgs/{org_id}/devices/{id}/cohortSet a device's cohort

List devices

GET /api/orgs/{org_id}/devices

Lists org devices, filtered to cohorts the caller can access.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.

Query parameters:

NameTypeRequiredDescription
searchstringNo
statusstringNoOne of: unregistered, registered, online, offline.
cohort_idstringNo
cohort_idsstringNoComma-separated cohort UUIDs.
tagsstringNoComma-separated tags.
sort_bystringNo
sort_dirstringNoOne of: asc, desc.
cursorstringNoOpaque pagination cursor from a prior response's meta.after/meta.before.
limitintegerNoMax items per page (clamped 1–100). Defaults to 20. Range 1–100.
directionstringNoPage direction relative to the cursor. One of: after, before. Defaults to "after".

Responses:

StatusBodyDescription
200data: array of Device, meta: PaginationMetaDevices.
422ErrorInvalid sort field.

Example request:

curl "https://connect.peridio.com/api/orgs/{org_id}/devices" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": [
{
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"identifier": "string",
"status": "unregistered",
"last_seen_at": "2026-08-14T12:00:00Z",
"tags": ["string"],
"metadata": {},
"shadow": {},
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"cohort_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"resolved_runtime": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"version": "string",
"project_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12"
},
"cohort": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"project_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12"
},
"active_tunnel_count": 0,
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
],
"meta": {
"after": "string",
"before": "string",
"has_next": true,
"has_previous": true,
"total": 0
}
}

Create a device

POST /api/orgs/{org_id}/devices

Admin only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.

Request body:

FieldTypeRequiredDescription
deviceobjectYes
device.namestringYes
device.identifierstringYesUnique device identifier.
device.tagsstring[]No
device.metadataobjectNo

Responses:

StatusBodyDescription
201data: DeviceCreated.
422ValidationErrorRequest body failed validation.

Example request:

curl -X POST "https://connect.peridio.com/api/orgs/{org_id}/devices" \
-H "Authorization: Bearer $AVOCADO_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"device": {
"name": "string",
"identifier": "string",
"tags": [
"string"
],
"metadata": {}
}
}'

Example response (201):

{
"data": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"identifier": "string",
"status": "unregistered",
"last_seen_at": "2026-08-14T12:00:00Z",
"tags": ["string"],
"metadata": {},
"shadow": {},
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"cohort_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"resolved_runtime": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"version": "string",
"project_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12"
},
"cohort": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"project_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12"
},
"active_tunnel_count": 0,
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
}

Device counts

GET /api/orgs/{org_id}/devices/stats

Returns device counts by status for the caller's accessible cohorts.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.

Query parameters:

NameTypeRequiredDescription
searchstringNo
cohort_idstringNo
cohort_idsstringNo
tagsstringNo

Responses:

StatusBodyDescription
200data: DeviceStatsStats.

Example request:

curl "https://connect.peridio.com/api/orgs/{org_id}/devices/stats" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": {
"total": 0,
"online": 0,
"offline": 0,
"registered": 0,
"unregistered": 0
}
}

List device tags

GET /api/orgs/{org_id}/devices/tags

Returns the distinct set of device tags across the caller's accessible cohorts.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.

Responses:

StatusBodyDescription
200data: string[]Tags.

Example request:

curl "https://connect.peridio.com/api/orgs/{org_id}/devices/tags" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": ["string"]
}

Get a device

GET /api/orgs/{org_id}/devices/{id}

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Responses:

StatusBodyDescription
200data: DeviceDevice.
404ErrorResource not found.

Example request:

curl "https://connect.peridio.com/api/orgs/{org_id}/devices/{id}" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"identifier": "string",
"status": "unregistered",
"last_seen_at": "2026-08-14T12:00:00Z",
"tags": ["string"],
"metadata": {},
"shadow": {},
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"cohort_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"resolved_runtime": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"version": "string",
"project_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12"
},
"cohort": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"project_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12"
},
"active_tunnel_count": 0,
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
}

Update a device

PUT /api/orgs/{org_id}/devices/{id}

Admin only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Request body:

FieldTypeRequiredDescription
deviceobjectYes
device.namestringNo
device.tagsstring[]No
device.metadataobjectNo

Responses:

StatusBodyDescription
200data: DeviceUpdated.
404ErrorResource not found.
422ValidationErrorRequest body failed validation.

Example request:

curl -X PUT "https://connect.peridio.com/api/orgs/{org_id}/devices/{id}" \
-H "Authorization: Bearer $AVOCADO_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"device": {
"name": "string",
"tags": [
"string"
],
"metadata": {}
}
}'

Example response (200):

{
"data": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"identifier": "string",
"status": "unregistered",
"last_seen_at": "2026-08-14T12:00:00Z",
"tags": ["string"],
"metadata": {},
"shadow": {},
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"cohort_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"resolved_runtime": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"version": "string",
"project_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12"
},
"cohort": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"project_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12"
},
"active_tunnel_count": 0,
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
}

Delete a device

DELETE /api/orgs/{org_id}/devices/{id}

Admin only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Responses:

StatusBodyDescription
200OkDeleted.
404ErrorResource not found.

Example request:

curl -X DELETE "https://connect.peridio.com/api/orgs/{org_id}/devices/{id}" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"ok": true
}

Set a device's cohort

PUT /api/orgs/{org_id}/devices/{id}/cohort

Admin only. Reassigns the device to a cohort (must be in the same project). The cohort cannot be cleared — delete the device to decommission it.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Request body:

FieldTypeRequiredDescription
cohort_idstringYes

Responses:

StatusBodyDescription
200OkReassigned.
404ErrorResource not found.
422ValidationErrorRequest body failed validation.

Example request:

curl -X PUT "https://connect.peridio.com/api/orgs/{org_id}/devices/{id}/cohort" \
-H "Authorization: Bearer $AVOCADO_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cohort_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12"
}'

Example response (200):

{
"ok": true
}

Object reference

Device

FieldTypeDescription
idstring
namestringNullable.
identifierstring
statusstringOne of: unregistered, registered, online, offline.
last_seen_atstring (date-time)Nullable.
tagsstring[]
metadataobjectNullable.
shadowobjectReported/desired device shadow state. Nullable.
organization_idstring
cohort_idstringNullable.
resolved_runtimeobjectNullable.
resolved_runtime.idstring
resolved_runtime.versionstring
resolved_runtime.project_idstring
cohortobjectPresent on list/show responses. Nullable.
cohort.idstring
cohort.namestring
cohort.project_idstring
active_tunnel_countintegerPresent on list responses.
inserted_atstring (date-time)
updated_atstring (date-time)

PaginationMeta

Cursor pagination metadata. Present only when the request supplied a pagination param (cursor, limit, or direction); otherwise the full list is returned unpaginated with no meta.

FieldTypeDescription
afterstringOpaque cursor for the next page. Pass back as ?cursor=. Nullable.
beforestringOpaque cursor for the previous page. Nullable.
has_nextboolean
has_previousboolean
totalintegerNullable.

Error

Standard error envelope.

FieldTypeDescription
errorstringMachine-readable error code.
messagestringHuman-readable explanation.

ValidationError

Changeset validation error. Keys are field names; values are lists of messages.

FieldTypeDescription
errorsobject

DeviceStats

FieldTypeDescription
totalinteger
onlineinteger
offlineinteger
registeredinteger
unregisteredinteger

Ok

Simple acknowledgement.

FieldTypeDescription
okboolean