API Reference: Devices
Endpoint untuk mendaftarkan, memeriksa, memperbarui, me-restart, menghentikan, dan menghapus device ingest Liodra.
← Kembali ke Devices
Konsep device, channel, auto-restart, dan troubleshooting.
Integrasi dengan Lenz
Bagaimana Lenz memanggil endpoint ini lewat proxy /api/visionaire-media.
Liodra tidak memiliki otentikasi API sendiri; batasi akses port 9080 di tingkat jaringan atau reverse proxy. Basis URL memakai variabel LIODRA_API_URL (default http://localhost:9080). Dari Lenz, path yang sama dapat dipanggil melalui /api/visionaire-media/{nvrServerId} + path tanpa prefiks /api/v1 dengan otentikasi Lenz. Semua endpoint di halaman ini mengembalikan 404 bila fitur device dimatikan (Docker tanpa --as-nvr).
Daftar Device
Semua Device
Response Body
application/json
application/json
curl -X GET "http://localhost:9080/api/v1/devices"{ "success": true, "data": { "devices": [ { "name": "camera_front", "url": "rtsp://admin:***@192.168.1.100:554/stream1", "scheme": "rtsp", "channel": "live", "silent_audio": true, "status": "active", "publish_url": "rtmp://127.0.0.1:1935/live/camera_front", "uptime": "2h15m30s", "last_seen": "2026-09-15T10:30:00Z", "error_count": 0, "restart_count": 0 }, { "name": "stream_01", "url": "rtmp://source.example.com/live/stream1", "scheme": "rtmp", "channel": "live", "silent_audio": false, "status": "active", "publish_url": "rtmp://127.0.0.1:1935/live/stream_01", "uptime": "5h42m10s", "error_count": 0, "restart_count": 0 } ], "total": 2 }}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Device per Scheme
Path Parameters
Scheme sumber device.
"rtsp" | "rtmp" | "file" | "http" | "https"Response Body
application/json
application/json
curl -X GET "http://localhost:9080/api/v1/devices/rtsp"{ "success": true, "data": { "devices": [ { "name": "camera_front", "url": "rtsp://admin:***@192.168.1.100:554/stream1", "scheme": "rtsp", "channel": "live", "silent_audio": true, "status": "active", "publish_url": "rtmp://127.0.0.1:1935/live/camera_front", "message": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "last_seen": "2019-08-24T14:15:22Z", "error_count": 0, "restart_count": 0, "suspended": false, "uptime": "2h15m30s", "warning": "string", "srs_stream": { "id": "12345", "vhost": "__defaultVhost__", "app": "live", "name": "camera_front", "video": { "codec": "H264", "profile": "High", "level": "4.0" }, "audio": { "codec": "AAC", "sample_rate": 44100, "channels": 2 }, "clients": 3 } } ], "total": 2 }}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Registrasi dan Detail
Tambah Device
Path Parameters
Scheme sumber device. Gunakan http/https untuk URL media sosial.
"rtsp" | "rtmp" | "file" | "http" | "https"Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:9080/api/v1/devices/rtsp" \ -H "Content-Type: application/json" \ -d '{ "name": "camera_front", "url": "rtsp://admin:password@192.168.1.100:554/stream1", "channel": "live", "silent_audio": true }'{ "success": true, "data": { "name": "camera_front", "url": "rtsp://admin:***@192.168.1.100:554/stream1", "scheme": "rtsp", "channel": "live", "silent_audio": true, "status": "starting", "publish_url": "rtmp://127.0.0.1:1935/live/camera_front", "uptime": "0s" }, "message": "Device session 'camera_front' created successfully"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}{ "success": false, "error": "Device already exists", "details": "Device 'camera_front' is already registered"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Detail Device
Path Parameters
{channel}/{name}. Channel boleh bertingkat: live/hls/camera_01 berarti channel live/hls dan nama camera_01.
Response Body
application/json
application/json
application/json
curl -X GET "http://localhost:9080/api/v1/devices/rtsp/live/camera_front"{ "success": true, "data": { "name": "camera_front", "url": "rtsp://admin:***@192.168.1.100:554/stream1", "scheme": "rtsp", "channel": "live", "silent_audio": true, "status": "active", "publish_url": "rtmp://127.0.0.1:1935/live/camera_front", "uptime": "2h15m30s", "last_seen": "2026-09-15T10:30:00Z", "error_count": 0, "restart_count": 0, "srs_stream": { "id": "12345", "vhost": "__defaultVhost__", "app": "live", "name": "camera_front", "video": { "codec": "H264", "profile": "High", "level": "4.0" }, "audio": { "codec": "AAC", "sample_rate": 44100, "channels": 2 }, "clients": 3 } }}{ "success": false, "error": "Not found", "details": "Resource does not exist"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Perbarui Device
Path Parameters
{channel}/{name}.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X PATCH "http://localhost:9080/api/v1/devices/rtsp/live/camera_front" \ -H "Content-Type: application/json" \ -d '{ "url": "rtsp://admin:newpassword@192.168.1.100:554/stream1" }'{ "success": true, "data": { "name": "camera_front", "url": "rtsp://admin:***@192.168.1.100:554/stream1", "scheme": "rtsp", "channel": "live", "silent_audio": true, "status": "active", "publish_url": "rtmp://127.0.0.1:1935/live/camera_front", "message": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "last_seen": "2019-08-24T14:15:22Z", "error_count": 0, "restart_count": 0, "suspended": false, "uptime": "2h15m30s", "warning": "string", "srs_stream": { "id": "12345", "vhost": "__defaultVhost__", "app": "live", "name": "camera_front", "video": { "codec": "H264", "profile": "High", "level": "4.0" }, "audio": { "codec": "AAC", "sample_rate": 44100, "channels": 2 }, "clients": 3 } }, "message": "Device session 'camera_front' created successfully"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Hapus Device
Path Parameters
{channel}/{name}.
Response Body
application/json
application/json
curl -X DELETE "http://localhost:9080/api/v1/devices/rtsp/live/camera_front"{ "success": true, "message": "Device session 'live/camera_front' removed successfully"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Kendali Proses
Restart Device
Path Parameters
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:9080/api/v1/devices/rtsp/live/camera_front/restart"{ "success": true, "message": "Device session 'live/camera_front' restart initiated"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Hentikan Device
curl -X POST "http://localhost:9080/api/v1/devices/rtsp/live/camera_front/stop"{ "success": true, "message": "Device session 'live/camera_front' stopped successfully"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}