Read device data and use authorized operations
Device operations use the singular /v1/device route family. Use the API session and the permissions assigned to the account.
POST
/v1/device/list
List devices
Requires can_view_devices. Send filters and pagination in the JSON body. The response contains success, devices and count. Non-empty results also include next_cursor.
JSON request body
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number; default 1. |
| page_limit | integer | Results per page; default 25. |
| search | string | Optional search text. |
| cursor_id | integer | Use next_cursor to retrieve the following, older batch. |
Request Example
curl -X POST "https://your-lexoh-server.app.lexoh.com:3000/v1/device/list" \
-H "SessionID: SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"page":1,"page_limit":25}'
Response Example
Example with no matching devices.
{
"success": true,
"devices": [],
"count": 0
}
POST
/v1/device
Retrieve one device
Send the numeric device id in the JSON body. A successful response contains success and device.
JSON request body
| Parameter | Type | Description |
|---|---|---|
| id | integer | Device identifier; replace the example value. |
Request Example
curl -X POST "https://your-lexoh-server.app.lexoh.com:3000/v1/device" \
-H "SessionID: SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"id":123}'
Configuration and lane operations
- PUT /v1/device creates a device and requires can_add_devices.
- PATCH /v1/device/config updates device configuration and requires can_edit_devices.
- POST /v1/device/open and /v1/device/close send lane commands with an id in the JSON body and require can_control_devices. A successful API response records the command; it does not prove physical gate movement.