Skip to content

API Overview

articwake provides a REST API for programmatic control of Wake-on-LAN and LUKS unlock operations.

http://<articwake-host>
EndpointMethodAuthDescription
/GETNoServe embedded web UI
/api/authPOSTNoVerify PIN, return bearer token
/api/statusGETYesServer reachability and SSH port status
/api/wolPOSTYesSend Wake-on-LAN magic packet
/api/unlockPOSTYesSend LUKS passphrase via SSH

Protected endpoints require a bearer token in the Authorization header.

Terminal window
curl -X POST http://localhost/api/auth \
-H "Content-Type: application/json" \
-d '{"pin": "your-pin"}'

Response:

{
"token": "a1b2c3d4e5f6..."
}
Terminal window
curl http://localhost/api/status \
-H "Authorization: Bearer a1b2c3d4e5f6..."

Tokens are valid for 15 minutes from creation. After expiry, you’ll receive a 401 Unauthorized response and need to re-authenticate.

The /api/auth endpoint is rate limited to 10 attempts per minute per IP address. Exceeding this limit returns 429 Too Many Requests.

All error responses follow this format:

{
"error": "Error message describing what went wrong"
}
CodeMeaning
200Success
400Bad request (invalid input)
401Unauthorized (invalid/expired token or wrong PIN)
429Rate limited
500Internal server error
  • Request bodies: application/json
  • Response bodies: application/json
Terminal window
# 1. Authenticate
TOKEN=$(curl -s -X POST http://localhost/api/auth \
-H "Content-Type: application/json" \
-d '{"pin": "1234"}' | jq -r '.token')
# 2. Check status
curl -s http://localhost/api/status \
-H "Authorization: Bearer $TOKEN" | jq
# 3. Wake the server
curl -s -X POST http://localhost/api/wol \
-H "Authorization: Bearer $TOKEN" | jq
# 4. Wait for boot, then unlock
sleep 30
curl -s -X POST http://localhost/api/unlock \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"passphrase": "my-luks-passphrase"}' | jq