-
-
Notifications
You must be signed in to change notification settings - Fork 108
Rest API
seriousm4x edited this page Jan 22, 2025
·
6 revisions
This project is based on PocketBase, therefore you can use their API. You can check our the documentation here: https://pocketbase.io/docs/api-records/
To get better documentation than this wiki page: login to the admin dashboard at localhost:8090/_/ and click the "API Preview" button at the top right. You should get plenty examples on all things you can do. There is also filtering and much more.
All routes require the "Authorization" header with jwt token. You can get the jwt token like this:
Users:
- [POST]
/api/collections/users/auth-with-password
Superusers:
- [POST]
/api/collections/_superusers/auth-with-password
With body:
{
"identity": "username or email",
"password": "password"
}
- [GET]
/api/collections/devices/records
returns first 30 devices - [GET]
/api/collections/devices/records/:id
returns single device by id - [PATCH]
/api/collections/devices/records/:id
updates single device with json body - [DELETE]
/api/collections/devices/records/:id
deletes single device by id
- [GET]
/api/upsnap/wake/:id
wakes the device with given id - [GET]
/api/upsnap/sleep/:id
send device with given id to sleep using sleep-on-lan - [GET]
/api/upsnap/reboot/:id
wakes the device with given id - [GET]
/api/upsnap/shutdown/:id
shuts down the device with given id - [GET]
/api/upsnap/scan
scans the network for devices