Compare commits

...

10 Commits

Author SHA1 Message Date
binwiederhier
3619c80544 Documentation 2026-01-27 20:22:41 -05:00
binwiederhier
27bce6f4d1 Merge branch 'main' of github.com:binwiederhier/ntfy into scalar-api-docs 2026-01-27 19:56:48 -05:00
Philipp C. Heckel
eb3549eedc Merge pull request #1577 from KavyanshKhaitan2/patch-2
[Docs/publish] Fix JSON syntax for JS examples
2026-01-27 09:35:15 -05:00
Kavyansh Khaitan
cea5fececb Fix JSON syntax for JS examples
(and make one of them more consistent)
2026-01-27 20:00:29 +05:30
Philipp C. Heckel
f686b8c548 Merge pull request #1572 from oshliaer/chore_fix_some_typos_in_server-yml
chore: fix typos in server.yml config file
2026-01-26 21:19:22 -05:00
Alexander Ivanov
b26546b709 chore: fix typos in server.yml config file
Signed-off-by: Alexander Ivanov <oshli.a.er@gmail.com>
2026-01-25 19:19:31 +03:00
binwiederhier
a06550a90f Refine open API docs 2026-01-20 17:13:50 -05:00
binwiederhier
d2e0588037 Merge branch 'main' of github.com:binwiederhier/ntfy into gitglubber/main 2026-01-20 15:57:06 -05:00
gitglubber
854aa1f783 Convert from swagger to API docs.
Renamed swagger_api/openapi.yaml to api/openapi.yaml and updated references in docs/api.md.
Removed swagger add to requirements.txt
2026-01-20 10:11:14 -08:00
gitglubber
0ae2ca43bd Added Openapi spec/swagger UI - added swagger to python requirements.txt 2026-01-11 18:46:30 -08:00
7 changed files with 50468 additions and 7 deletions

192
docs/api/index.html Normal file
View File

@@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ntfy API Reference</title>
<link rel="icon" type="image/png" href="/static/img/favicon.png">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
background: #ffffff;
}
/* Header matching docs.ntfy.sh */
.header {
background: linear-gradient(to right, #317f6f, #14b8a6);
padding: 16px 20px;
color: white;
}
.header-content {
max-width: 1400px;
margin: 0 auto;
display: flex;
align-items: center;
gap: 20px;
justify-content: space-between;
}
.header-text {
flex: 1;
}
.header-text h1 {
font-size: 24px;
font-weight: 700;
margin: 0;
color: white;
line-height: 1.2;
}
.header-text p {
font-size: 13px;
margin: 2px 0 0 0;
color: rgba(255, 255, 255, 0.9);
}
.header-links {
display: flex;
gap: 20px;
align-items: center;
}
.header-links a {
color: white;
text-decoration: none;
font-size: 14px;
font-weight: 500;
opacity: 0.9;
transition: opacity 0.2s;
}
.header-links a:hover {
opacity: 1;
}
/* Scalar container */
#scalar-api-reference {
width: 100%;
min-height: calc(100vh - 100px);
}
/* Hide Share and Generate SDKs menu items */
[data-scalar-menu-item="share"],
[data-scalar-menu-item="sdk"],
.scalar-card-header-actions button[title="Share"],
.scalar-card-header-actions button[title="Generate SDK"],
button:has(> span:contains("Share")),
button:has(> span:contains("SDK")) {
display: none !important;
}
/* Responsive */
@media (max-width: 768px) {
.header-content {
flex-direction: column;
gap: 10px;
text-align: center;
}
.header-links {
flex-wrap: wrap;
justify-content: center;
}
}
</style>
</head>
<body>
<!-- Header -->
<div class="header">
<div class="header-content">
<a href="/" style="display: flex; align-items: center; text-decoration: none;">
<img src="/static/img/ntfy.png" width="35" height="35" alt="ntfy logo" style="margin-right: 10px;">
</a>
<div class="header-text">
<h1>ntfy</h1>
<p>API Reference</p>
</div>
<div class="header-links">
<a href="/">Documentation Home</a>
<a href="https://ntfy.sh">ntfy.sh</a>
<a href="https://github.com/binwiederhier/ntfy">GitHub</a>
</div>
</div>
</div>
<!-- Scalar API Reference -->
<div id="scalar-api-reference"></div>
<link rel="stylesheet" type="text/css" href="./scalar-style.css" />
<script src="./scalar-standalone.js"></script>
<script>
function initScalar() {
const targetElement = document.getElementById('scalar-api-reference');
if (!targetElement) {
setTimeout(initScalar, 50);
return;
}
if (typeof Scalar === 'undefined' || typeof Scalar.createApiReference !== 'function') {
setTimeout(initScalar, 50);
return;
}
const config = {
url: './openapi.yaml',
layout: 'modern',
theme: 'default',
customCss: `
/* Hide Share and Generate SDKs menu items in dropdowns */
[data-testid="share-button"],
[data-testid="sdk-button"],
.context-menu-item:has(svg[data-icon="share"]),
.context-menu-item:has(svg[data-icon="sdk"]),
.dropdown-item:has(span:contains("Share")),
.dropdown-item:has(span:contains("SDK")),
.scalar-dropdown-item[data-action="share"],
.scalar-dropdown-item[data-action="generate-sdk"],
button[aria-label="Share"],
button[aria-label="Generate SDK"] {
display: none !important;
}
`,
configuration: {
hideSidebar: false,
hideSearch: false,
hideModels: false,
hideDownloadButton: false,
hideTabs: false,
hideServerUrl: false,
hideInfo: false,
darkMode: false,
withDefaultFonts: false,
},
};
try {
Scalar.createApiReference('#scalar-api-reference', config);
} catch (error) {
console.error('Error initializing Scalar:', error);
targetElement.innerHTML = '<div style="padding: 20px; color: red;">Error loading API reference: ' + error.message + '</div>';
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initScalar);
} else {
setTimeout(initScalar, 100);
}
window.addEventListener('load', function() {
setTimeout(initScalar, 200);
});
</script>
</body>
</html>

2370
docs/api/openapi.yaml Normal file

File diff suppressed because it is too large Load Diff

35987
docs/api/scalar-standalone.js Normal file

File diff suppressed because one or more lines are too long

11911
docs/api/scalar-style.css Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1619,7 +1619,7 @@ And the same example using [JSON publishing](#publish-as-json):
method: 'POST',
body: JSON.stringify({
topic: "myhome",
message": "Somebody retweeted your tweet.",
message: "Somebody retweeted your tweet.",
actions: [
{
action: "view",
@@ -1879,7 +1879,7 @@ And the same example using [JSON publishing](#publish-as-json):
method: 'POST',
body: JSON.stringify({
topic: "wifey",
message": "Your wife requested you send a picture of yourself.",
message: "Your wife requested you send a picture of yourself.",
actions: [
{
"action": "broadcast",
@@ -2154,7 +2154,7 @@ And the same example using [JSON publishing](#publish-as-json):
method: 'POST',
body: JSON.stringify({
topic: "myhome",
"message": "Garage door has been open for 15 minutes. Close it?",
message: "Garage door has been open for 15 minutes. Close it?",
actions: [
{
"action": "http",

View File

@@ -91,6 +91,7 @@ nav:
- "Other things":
- "FAQs": faq.md
- "Examples": examples.md
- "API Reference": /api/
- "Integrations + projects": integrations.md
- "Release notes": releases.md
- "Emojis 🥳 🎉": emojis.md

View File

@@ -160,7 +160,7 @@
# If enabled, allow outgoing e-mail notifications via the 'X-Email' header. If this header is set,
# messages will additionally be sent out as e-mail using an external SMTP server.
#
# As of today, only SMTP servers with plain text auth (or no auth at all), and STARTLS are supported.
# As of today, only SMTP servers with plain text auth (or no auth at all), and STARTTLS are supported.
# Please also refer to the rate limiting settings below (visitor-email-limit-burst & visitor-email-limit-burst).
#
# - smtp-sender-addr is the hostname:port of the SMTP server
@@ -198,8 +198,8 @@
# - web-push-private-key is the generated VAPID private key, e.g. AA2BB1234567890abcdefzxcvbnm1234567890
# - web-push-file is a database file to keep track of browser subscription endpoints, e.g. /var/cache/ntfy/webpush.db
# - web-push-email-address is the admin email address send to the push provider, e.g. sysadmin@example.com
# - web-push-startup-queries is an optional list of queries to run on startup`
# - web-push-expiry-warning-duration defines the duration after which unused subscriptions are sent a warning (default is 55d`)
# - web-push-startup-queries is an optional list of queries to run on startup
# - web-push-expiry-warning-duration defines the duration after which unused subscriptions are sent a warning (default is 55d)
# - web-push-expiry-duration defines the duration after which unused subscriptions will expire (default is 60d)
#
# web-push-public-key:
@@ -280,7 +280,7 @@
#
# - upstream-base-url is the base URL of the upstream server. Should be "https://ntfy.sh".
# - upstream-access-token is the token used to authenticate with the upstream server. This is only required
# if you exceed the upstream rate limits, or the uptream server requires authentication.
# if you exceed the upstream rate limits, or the upstream server requires authentication.
#
# upstream-base-url:
# upstream-access-token: