<your server>/account) under Manage access tokens. The token starts with tk_ and is shown once. The key can also be username:password, which is sent as HTTP Basic. A self-hosted server is set with the account’s base_url (or the serverUrl plugin option); leave it empty for ntfy.sh. A bad Authorization header is a 401 even on public topics, so check the key before anything else. With the anonymous: true option and no key, calls go out without credentials (open topics, signup). Credentials are only sent over https (or to localhost). Things to know before you send:
- Real pushes.
messages.send,messages.sendFileandmessages.updatedeliver real push notifications to every subscriber of the topic and are marked destructive.emailandcallon a send also email or phone someone. On ntfy.sh a visitor can send 250 messages per rolling 24 hours. Failed sends are never replayed after a 5xx or a dropped connection, because a retry can duplicate a notification. A burst-limit 429 (42901, 42906, 42911) is retried twice; a spent daily quota (messages, emails, calls, bandwidth) never is. - Sequences. Publishing with
sequenceId([-_A-Za-z0-9]{1,64}) gives the message a stable id: publishing again with the same id updates it (the server keeps both versions),messages.clearmarks it read and dismissed, andmessages.deletetells subscribers to remove it. A scheduled message that has not gone out yet is cancelled and removed from the server; a delivered one stays in the cache with a delete event after it, and clients that support it remove the notification. - Polling, not webhooks. ntfy sends no webhooks:
messages.pollreads the topic cache as NDJSON and returns the messages withevent: "message". An unknown topic polls to an empty list, not an error. Usesince(a duration like10min, unix seconds, a message id,allorlatest) as the cursor, andscheduled: trueto list undelivered scheduled messages. - Priorities and actions.
prioritytakes 1-5 or min|low|default|high|urgent; names are sent as their number, since the JSON publish takes an int only.actionstakes up to 3 buttons of type view, http, broadcast or copy. - Attachments.
messages.sendFileuploads a file (base64 in, PUT body out) and the message carriesattachment.url;files.downloadfetches it by the id at the end of that URL.attachonmessages.sendlinks an external URL instead. - Account and admin routes.
account.*,tokens.*,subscriptions.*,reservations.*,phoneNumbers.*,emails.*,billing.*andwebPush.*act on the signed-in user.users.*andtiers.*need an admin. Routes for a feature the server has turned off (email, calls, payments, web push, signup) answer 400 or 404.
- 59 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the ntfy API key before the first call: More: API Key
pnpm corsair setup --plugin=ntfy --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
Poll a topicWhat’s next
API reference
Every
ntfy.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.