Skip to main content

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]:8889 or https://[HOSTNAME]:8889 (with certificates)
To get all available network addresses:

Authentication

All endpoints (except /health) require API key authentication.

Methods

Header Authentication (Recommended)
Query Parameter Authentication

Getting Your API Key

The API key is automatically generated on first startup and stored in mixer_config.json under the key toast_api_key. You can also:
  1. Check the console output when the server starts
  2. Use the Toast Settings UI in the desktop app
  3. Call POST /api/toast/regenerate to 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.
Authentication: Not required Response: 200 OK

Send Toast Notification

Send a toast notification to the device.
Authentication: Required Request Body:
Parameters: Available Icons:
  • bell - Notification bell
  • checkmark - Success checkmark
  • warning - Warning triangle
  • close - Error/close X
  • settings - Gear icon
  • wifi - WiFi signal
  • audio - Speaker icon
  • play - Play button
  • pause - Pause button
  • volume - Volume icon
  • mute - Mute icon
  • power - Power button
  • refresh - Refresh/reload
  • home - Home icon
  • download - Download arrow
  • upload - Upload arrow
Response: 200 OK
Error Responses: 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.
Authentication: Required Response: 200 OK

Get Server Status

Get information about the API server and device connection.
Authentication: Required Response: 200 OK

Get Network Information

Get all available network addresses and Tailscale status.
Authentication: Required Response: 200 OK

Example Usage

cURL

Basic Example:
Success Notification:
Error Notification:

Python

JavaScript / Node.js

PowerShell

Bash

Use Cases

CI/CD Integration

GitHub Actions:
Jenkins Pipeline:

Server Monitoring

Task Automation

HTTPS with Tailscale

For secure remote access, use Tailscale with HTTPS:
  1. Install Tailscale: https://tailscale.com/download
  2. Enable MagicDNS: In Tailscale admin console
  3. Generate Certificates:
  4. Place Certificates: Copy .crt and .key files to main/certs/ folder
  5. Restart App: API server will automatically detect and use HTTPS
Your API will now be available at:

Troubleshooting

Cannot Connect to API

  1. Check if server is running:
  2. Check firewall: Ensure port 8889 is not blocked
  3. Check device connection: API requires device to be connected

Unauthorized Errors

  1. Verify API key: Check mixer_config.json for toast_api_key
  2. Check header format: Use X-API-Key (case-sensitive)
  3. Regenerate key: Use desktop app settings or restart server

Rate Limit Errors

  1. Wait: Rate limits reset after 60 seconds
  2. Reduce frequency: Send max 30 requests per minute
  3. 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