ffplay -rtsp_transport tcp rtsp://127.0.0.1:2021/myMonitor
ffplay -rtsp_transport tcp rtsp://127.0.0.1:2021/myMonitor_sub
Remember to expose the ports if you're using Docker.
ffplay http://127.0.0.1:2022/hls/myMonitor/stream.m3u8
vlc http://127.0.0.1:2022/hls/myMonitor_sub/stream.m3u8
All requests require basic auth, POST, PUT and DELETE requests need to have a matching CSRF-token in the X-CSRF-TOKEN
header.
curl -k -u admin:pass -X GET https://127.0.0.1/api/users
TOKEN=$(curl -k -u admin:pass -X GET https://127.0.0.1/api/user/my-token)
printf "token: %s\n" "$TOKEN"
curl -k -u admin:pass -X POST https://127.0.0.1/api/monitor/restart?id=x -H "X-CSRF-TOKEN: $TOKEN"
System time zone location.
General settings.
Example response:{"diskSpace":"20","theme":"default"}
Set general configuration.
Example request:{"diskSpace":"21","theme":"default"}
Users.
Example response:
{
"11":{
"id":"11",
"username":"admin",
"isAdmin":true
},
"22":{
"id":"22",
"username":
"user","isAdmin":false
}
}
Note: the name of the object matches the account ID.
Set user data.
Example request:
{
"id": "7phg3h7v3ayb5g2f",
"username": "name",
"isAdmin": false,
"plainPassword": "pass"
}
Delete a user by id.
CSRF-token of current user.
Uncensored monitor configuration.
Example response:
{
"111": {
"id": "111",
"name": "a",
"enable": "true"
// More fields.
},
"222": {
"id": "222",
"name": "b",
"enable": "false"
// More fields.
}
}
Note: the name of the object matches the monitor ID.
Delete a monitor by id.
Censored monitor configuration.
{
"111": {
"audioEnabled":"false",
"enable":"true",
"id":"111",
"name":"a",
"subInputEnabled":"false"
},
"222":{
"audioEnabled":"false",
"enable":"false",
"id":"222",
"name":"b",
"subInputEnabled":"false"
}
}
Restart monitor by id.
Create/update monitor configuration.
Example request:
{
"id": "111",
"name": "a",
"enable": "true",
"inputOptions": "x",
"mainInput": "x",
"subInput": "x",
"hwaccel": "hwaccel",
"videoEncoder": "copy",
"audioEncoder": "none",
"alwaysRecord": "false",
"videoLength": "15",
"timestampOffset": "500",
"logLevel": "fatal"
}
The id
field is used to determine the monitor to create/update.
There is currently no way to get the config for a single monitor, /api/monitor/configs
can be used to get all of them at once.
Use the /api/monitor/restart?id=x
endpoint to restart the monitor and make the changes take effect.
The recording ID is a string in the following format and has multiple matching files with the same name in the recordings directory. All timestamps in the back-end use the UTC timezone.
Format:YYYY-MM-DD_hh-mm-ss_MonitorID
Example 2020-12-31_23-59-59_x
See crawler.go for more info.
Delete recording by id.
Thumbnail by exact recording ID.
Video by exact recording ID.
curl example:
curl -k -u admin:pass -X GET https://127.0.0.1/api/recording/video/2025-12-28_23-59-59
Query recordings. The time parameter can accept a recording ID and will check if a recording with that exact id exist on disk and if true will start returning subsequent alphabetically ordered recordings but not the recording itself. If an exact match isn't found, it will start from the closest match.
See the test cases in crawler_test.go
Example request:
/api/recording/query?limit=1&time=9999-12-28_23-59-59&data=true
Example response: data=false
[
{
"id":"YYYY-MM-DD_hh-mm-ss_id",
"data": null
}
]
Example response: data=true
[{
"id":"YYYY-MM-DD_hh-mm-ss_id",
"data": {
"start": "YYYY-MM-DDThh:mm:ss.000000000Z",
"end": "YYYY-MM-DDThh:mm:ss.000000000Z",
"events": [{
"time": "YYYY-MM-DDThh:mm:ss.000000000Z",
"detections": [{
"label": "person",
"score": 100,
"region": {
"rect": [0, 0, 100, 100]
}
}],
"duration": 000000000
}]}}]
## Logs
Query logs. Time is in Unix micro seconds.
Example response:
[
{
"level":0,
"time":0,
"msg":"",
"src":"",
"monitorID":""
},
{
"level":0,
"time":0,
"msg":"",
"src":"",
"monitorID":""
}
]
List of log sources.
Example response:["app","monitor","recorder","storage","watchdog"]
Requires basic auth and TLS. Authentication is validated before each response.
Example: wss://127.0.0.1/api/logs
curl doesn't support wss.
Live log feed.