MG Notify documentation
Everything about sending notifications, the apps, browser notifications and the API.
Getting started
- Create an account (or use the app), then open the link in the verification email we send you.
- Sign in on the devices that should get notifications: the MG Notify app on iPhone or Android, or this website with browser notifications on. Allow notifications when asked.
- Create an API key on the API keys page of your dashboard, or in the app under Settings, Account Settings, API Keys.
- Send yourself a notification by opening this address in a browser, with your key in place of
YOUR_KEY:https://notify.mad-gamer.com/api/notify?key=YOUR_KEY&msg=Hello%20from%20MG%20Notify
Every notification is also kept in your notification list in the apps and the dashboard until you delete it.
Sending notifications
Send a GET request to https://notify.mad-gamer.com/api/notify with these query parameters. Remember to URL-encode the values (spaces become %20, line breaks %0A).
| Parameter | Required | Meaning |
|---|---|---|
key | Yes | Your API key. Several keys separated by commas send to every account they belong to, once each. |
msg | Yes | The message text. |
title | No | The notification's title. Defaults to "MG Notify". |
sound | No | Accepted for older scripts. Each device plays the sound chosen in its app (see sounds). |
You can also POST the same fields to the same address, as JSON or as an HTML form (application/x-www-form-urlencoded). That keeps your key out of web server logs and handles long messages better:
POST https://notify.mad-gamer.com/api/notify
Content-Type: application/json
{"key": "YOUR_KEY", "title": "Backup", "msg": "Nightly backup finished."}
The response
A successful send returns status 200 and JSON describing the delivery to each of your devices:
{
"status": "sent",
"title": "Backup",
"message": "Nightly backup finished.",
"delivery": {
"delivered": 2,
"devices": [
{"device_id": "…", "device_name": "Matthew's iPhone", "status": "sent", …},
{"device_id": "…", "device_name": "Chrome on Windows", "status": "sent", …}
]
}
}
Each device's status is sent, failed (with an error), or removed when Apple, Google or the browser says the device no longer exists; MG Notify then forgets it. With no devices signed in, the notification is still saved: "delivered": 0, "stored": true.
When you send with several keys, the response lists requested_keys, valid_keys, ignored_keys, delivered_accounts and a deliveries list with one delivery per account.
Examples in common languages
Command line (curl)
curl -G https://notify.mad-gamer.com/api/notify \
--data-urlencode "key=YOUR_KEY" \
--data-urlencode "title=Server" \
--data-urlencode "msg=Disk usage is at 91%"
Windows PowerShell
Invoke-RestMethod -Method Post -Uri https://notify.mad-gamer.com/api/notify `
-ContentType "application/json" `
-Body (@{ key = "YOUR_KEY"; title = "Build"; msg = "The build passed." } | ConvertTo-Json)
Python
import json, urllib.request
request = urllib.request.Request(
"https://notify.mad-gamer.com/api/notify",
data=json.dumps({"key": "YOUR_KEY", "title": "Python", "msg": "Job done"}).encode(),
headers={"Content-Type": "application/json"},
)
urllib.request.urlopen(request)
JavaScript
await fetch("https://notify.mad-gamer.com/api/notify", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ key: "YOUR_KEY", title: "Website", msg: "New sign-up" }),
});
Anything else
Any program that can open a web address can notify you: point it at the GET form above.
Links in messages
Messages are plain text. The apps and the dashboard turn these into links you can tap:
- Web addresses:
https://example.com/report - Markdown links, which show only the words:
[the report](https://example.com/report) - Email and phone links:
mailto:someone@example.com,tel:5551234
Line breaks are kept. In the apps, you can copy a notification as plain or rich text.
Email to notification
Every API key also has an email address: the key followed by @notify.mad-gamer.com, for example mgkey_abc123@notify.mad-gamer.com. Email sent there becomes a notification:
- The title shows the sender and subject, for example
Jane Example: Weekly report
. - The push says
Open MG Notify to view the full email.
- Opening it in the app or dashboard shows the sender, address, subject, date and the email itself. Scripts, forms, tracking pixels and unsafe links are removed first.
- Letter case in the key part of the address doesn't matter, since some mail programs change it.
Use it to forward alerts from services that can only send email, or set up an email forwarding rule. The dashboard's API keys page has a button to copy each key's address.
The apps
iPhone and iPad
Get MG Notify on the App Store (iOS 18 or later). Sign in, allow notifications, and they arrive like any other app's. The app keeps your notification list, lets you copy, search and delete notifications, open emails, choose a sound, manage API keys and devices, and switch between several accounts.
Android
The Android app works the same way, with your choice of sound for each device, a long-press menu on each notification, TalkBack actions, and a share target: share audio files to MG Notify to add them as notification sounds.
Installing on Android
- On your phone, download MG Notify for Android (Android 8 or later).
- Open the downloaded file. If Android says your browser isn't allowed to install apps, choose Settings, allow it (
Always allow
orAllow from this source
, depending on your Android version), and go back. - Choose Install. If Google Play Protect says it hasn't seen the app before, you can choose
Scan app
orInstall without scanning
; MG Notify isn't on Google Play, so this is expected. - Open MG Notify and sign in.
The app keeps itself up to date: it checks for new versions about twice a day and offers to install them, and you can check yourself under Settings, About. The first time, Android asks you to let MG Notify install apps; each update still asks you to confirm.
Unread notifications and badges
New notifications are marked New
until you've seen them, in the apps and on this site. Opening your notifications on any device marks them seen everywhere, and opening an email marks that one seen straight away. Tapping an email's notification, in the apps or in your browser, opens the email itself. On iPhone and iPad, the app icon shows how many are unread, counting every account signed in on that device.
Several accounts on one device
In either app, open the account menu at the top of your notifications and choose Add Account. The device gets notifications for every account it's signed in to; tapping a notification switches to its account.
Browser notifications
Your browser can get MG Notify notifications too, even with the site closed, as long as the browser is running.
- Sign in and open Browser notifications in your dashboard.
- Choose
Turn on browser notifications
and allow notifications when the browser asks. - Use
Send a test notification
to check.
This works in current versions of Chrome, Edge, Firefox, Opera and Safari on desktop and Android. On iPhone and iPad, add the site to your Home Screen first (Share, then Add to Home Screen), open it from there, sign in and turn notifications on. The browser shows up in your device list; turn it off on the same page or sign it out from any device. Notification sounds in the browser are your system's.
If you've blocked notifications for this site, allow them again in your browser's site settings (usually the icon to the left of the address).
Notification sounds
On this website, choose a sound under Browser notifications in your dashboard: Chime, No sound, or sounds you add from your computer or phone (30 seconds or less, kept in that browser only). It plays when a notification arrives while the site is open. When the site is closed, browsers always use your system's notification sound.
Each device chooses its own sound in the app under Settings, Notification Sound: No Sound, the system default, or a sound you've added. Sounds must be 30 seconds or shorter. To add one from another app, such as Files or Voice Memos, share it and choose MG Notify.
- iPhone and iPad: AIFF, WAV and CAF files, plus MP3, M4A, AAC, FLAC and other audio iPhone can read, which the app converts automatically.
- Android: WAV, MP3, OGG, Opus, M4A, AAC, FLAC and MIDI files.
The sound applies to every account on that device, and is used whatever a script asks for.
Your account, devices and keys
- Devices
- The Devices page lists every phone and browser signed in with notifications on, with its last address and when it was last seen. Sign out any of them, or all but this one.
- API keys
- Create as many keys as you like, with a label for each, so you can delete one without breaking the others.
- Display name
- Optionally give your account a name, such as
Work
or your own name. It's shown instead of your email address in the apps' account menu and in announcements. Set it on the Account page or in the app's Account Settings. - Changing your email
- You'll need to verify the new address before using MG Notify again.
- Changing or resetting your password
- Signs you out on every device, for safety. Forgot it? Use Forgot password on the sign-in page; the emailed link works for an hour.
- Deleting your account
- Permanently removes your account, notifications, API keys and devices, and signs out your devices.
Sign-ins stay active while you use them. A device or browser unused for 180 days is signed out automatically.
API reference
The apps and this site use the same API, at https://notify.mad-gamer.com/api. It returns JSON, and takes JSON or HTML-form bodies. Requests marked session
need an Authorization: Bearer SESSION_TOKEN header, where the token comes from signing in; verified
also needs a verified email address. To just send notifications, all you need is /notify and an API key.
| Request | Needs | Does |
|---|---|---|
GET /notify, POST /notify | API key | Sends a notification (details). |
GET /health | Nothing | Server status. |
POST /auth/register | Nothing | {"email", "password"}. Creates an account and returns account and session.session_token; sends a verification email. |
POST /auth/login | Nothing | {"email", "password"}. Returns account and session.session_token. |
POST /auth/logout | Session | Ends this session, and signs out its device. |
GET /auth/me | Session | The signed-in account: account_id, email, email_verified, display_name (or null). |
GET /events | Session | A Server-Sent Events stream of changes as they happen (details). |
POST /account/display-name | Session | {"display_name"}, up to 60 characters; empty removes it. Returns the account. |
POST /auth/resend-verification | Session | Sends a new verification email. |
POST /auth/verify-email | Nothing | {"token"} from the verification email. |
POST /auth/request-password-reset | Nothing | {"email"}. Sends a reset link if the account exists. |
POST /auth/reset-password | Nothing | {"token", "new_password"}. Signs out every device. |
POST /account/change-email | Session | {"new_email", "password"}. |
POST /account/change-password | Session | {"current_password", "new_password"}. Signs out every device. |
POST /account/delete | Session | {"password"}. Deletes the account and everything in it. |
POST /account/notify | Verified | {"title", "message"}. Sends to your own devices. |
GET /notifications | Verified | Your notifications, newest first, each with seen, plus unread_count. |
POST /notifications/mark-seen | Verified | Marks notifications seen: {"notification_ids": [...]}, or {} for all. Returns marked, unread_count and badge (this device's unread total across its accounts, or null). |
DELETE /notifications/ID | Verified | Deletes one notification. |
DELETE /notifications | Verified | Deletes them all; returns deleted_count. |
GET /api-keys | Verified | Your API keys. |
POST /api-keys/create | Verified | {"label"}. Returns the new api_key. |
POST /api-keys/delete | Verified | {"key_id"}. |
POST /api-keys/delete-all | Verified | Deletes every key. |
GET /devices | Verified | Your devices. |
POST /devices/register | Session | Registers this device for pushes: device_id, device_name, platform (ios, android or web), and apns_token with apns_environment, fcm_token, or web_push (a browser push subscription) to match. Optional notification_sound, and badges: true from apps that keep their badge up to date. |
POST /devices/sound | Verified | {"device_id", "notification_sound"}. |
DELETE /devices/ID | Session | Removes a device. |
POST /devices/ID/sign-out | Verified | Signs a device out. |
POST /devices/sign-out-other | Verified | Signs out every device except the one this session registered. |
GET /web-push/public-key | Nothing | The server's Web Push (VAPID) public key, for browser subscriptions. |
Realtime events
The apps and this site stay up to date without refreshing: while one is open, it keeps a connection to GET /events (with the session's Authorization header) and the server sends each change the moment it happens. When an app is closed, a silent push does the same job.
| Event | Data | Meaning |
|---|---|---|
ready | account | Sent first on every connection; refresh anything you might have missed. |
notification | notification | A new notification. |
notification_deleted | notification_id | One was deleted. |
notifications_cleared | none | All were deleted. |
notifications_seen | notification_ids | These were seen (on any device). |
account_updated | account | Email, verification or display name changed. |
devices_updated, api_keys_updated | none | Fetch the list again. |
signed_out, account_deleted | none | This session has ended; the stream closes. |
resync | none | Some events were missed; fetch everything again. |
A comment line is sent every 20 seconds to keep the connection open. Every push for a notification also carries its notification_id, so a client can tell the push and the event apart.
Errors
Errors come back with a status code and JSON like {"detail": "Invalid API key"}.
| Status | Meaning |
|---|---|
| 400 | Something in the request isn't usable, like a used or expired link. |
| 401 | Wrong API key, password or session. For a session, sign in again. |
| 403 | The account's email address needs verifying first. |
| 404 | No such notification, key, device or link. |
| 409 | That email address already has an account. |
| 422 | A field is missing or invalid; detail says which. |
| 502, 503 | An email or push service couldn't be reached. Try again shortly. |
Privacy and your data
MG Notify keeps only what it needs to work:
- Your email address, and your password as a one-way hash (never the password itself).
- Your notifications, until you delete them or your account.
- Your API keys, so you can view and copy them.
- Your signed-in devices: their name, push address, last IP address and when they were last seen.
- Sign-ins and email links, stored only as one-way hashes.
Notifications are delivered through Apple (iPhone), Google (Android) or your browser's push service. Email sent to your API key addresses comes straight to our server (Brevo receives it only as a backup, if our server can't be reached); email we send you, such as verification and password resets, goes through Brevo. There's no advertising and no tracking. Backups are kept for 14 days. Deleting your account removes your data straight away; it leaves the backups within 14 days.
Accessibility
MG Notify is built to be fully usable with screen readers (VoiceOver, TalkBack, NVDA, JAWS and Narrator), braille displays, keyboards, switch access, zoom and large text, in light and dark mode. Every action on this site works from the keyboard, form errors and updates are announced, and new notifications are announced while your dashboard is open. In the apps, swipe actions are also in the actions menu (VoiceOver rotor or TalkBack's actions).
When a notification arrives while an app or this site is open and in front, it isn't shown as a pop-up. Instead it's announced to your screen reader, as New notification: title, message
, or New notification in account: title, message
when you're signed in to several accounts in an app, and your chosen sound plays. Everything else (deleted notifications, sign-outs, changes made on your other devices) updates straight away too.
If anything is hard to use, please tell us.
Open source
MG Notify is open source under the MIT license. The server, this website and the iPhone and Android apps are all on GitHub at mad-gamer26/MG-Notify, with instructions for running your own.
Help
Notifications aren't arriving
- Check the device appears on your Devices page. If not, sign in on it again.
- Check notifications are allowed for MG Notify in the device's or browser's settings, and that Do Not Disturb or Focus isn't on.
- Use Send a notification in your dashboard; the result says how many devices it reached.
I didn't get the verification or reset email
Check your spam folder, then use Resend verification email in the app or dashboard, or request another reset. Reset links expire after an hour, verification links after a day.
Contact
Email mattdovi@icloud.com.