Toast Notification API
The Toast Notification API is a lightweight HTTP REST server that allows external applications to send toast notifications to your Mixlar device.Base URL
Network Access Options
- Local:
http://localhost:8889(this computer only) - Local Network:
http://[YOUR-LOCAL-IP]:8889(e.g.,http://192.168.1.100:8889) - Tailscale:
http://[TAILSCALE-IP]:8889orhttps://[HOSTNAME]:8889(with certificates)
Authentication
All endpoints (except/health) require API key authentication.
Methods
Header Authentication (Recommended)Getting Your API Key
The API key is automatically generated on first startup and stored inmixer_config.json under the key toast_api_key. You can also:
- Check the console output when the server starts
- Use the Toast Settings UI in the desktop app
- Call
POST /api/toast/regenerateto generate a new key
Rate Limiting
- Limit: 30 requests per minute per IP address
- Window: 60 seconds rolling window
- Response: HTTP 429 Too Many Requests
Endpoints
Health Check
Check if the API server is running.200 OK
Send Toast Notification
Send a toast notification to the device.| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
message | string | Yes | Header text displayed in bold | Max 30 characters |
icon | string | No | Icon name (see below) | Default: "bell" |
subtitle | string | No | Subtitle text displayed below | Max 40 characters |
duration_ms | integer | No | Display duration in milliseconds | 1000-30000, default: 3000 |
color | string | No | Background color (hex) | With or without # prefix |
bell- Notification bellcheckmark- Success checkmarkwarning- Warning triangleclose- Error/close Xsettings- Gear iconwifi- WiFi signalaudio- Speaker iconplay- Play buttonpause- Pause buttonvolume- Volume iconmute- Mute iconpower- Power buttonrefresh- Refresh/reloadhome- Home icondownload- Download arrowupload- Upload arrow
200 OK
400 Bad Request - Missing required fields
401 Unauthorized - Invalid API key
429 Too Many Requests - Rate limit exceeded
List Toast Handlers
Get a list of all available toast handlers and their status.200 OK
Get Server Status
Get information about the API server and device connection.200 OK
Get Network Information
Get all available network addresses and Tailscale status.200 OK
Example Usage
cURL
Basic Example:Python
JavaScript / Node.js
PowerShell
Bash
Use Cases
CI/CD Integration
GitHub Actions:Server Monitoring
Task Automation
HTTPS with Tailscale
For secure remote access, use Tailscale with HTTPS:- Install Tailscale: https://tailscale.com/download
- Enable MagicDNS: In Tailscale admin console
- Generate Certificates:
- Place Certificates: Copy
.crtand.keyfiles tomain/certs/folder - Restart App: API server will automatically detect and use HTTPS
Troubleshooting
Cannot Connect to API
-
Check if server is running:
- Check firewall: Ensure port 8889 is not blocked
- Check device connection: API requires device to be connected
Unauthorized Errors
- Verify API key: Check
mixer_config.jsonfortoast_api_key - Check header format: Use
X-API-Key(case-sensitive) - Regenerate key: Use desktop app settings or restart server
Rate Limit Errors
- Wait: Rate limits reset after 60 seconds
- Reduce frequency: Send max 30 requests per minute
- Batch notifications: Combine multiple events into single notification
Security Considerations
- API Key Storage: Store API keys securely (environment variables, secrets manager)
- Local Network: API accessible to anyone on your network by default
- Tailscale: Recommended for secure remote access
- HTTPS: Use Tailscale certificates for encrypted communication
- Firewall: Block port 8889 from internet if not using Tailscale
Documentation Version: 1.0 Last Updated: 2025-12-10 API Port: 8889