Documentation

This commit is contained in:
binwiederhier
2026-01-27 20:22:41 -05:00
parent 27bce6f4d1
commit 3619c80544

View File

@@ -1,27 +1,32 @@
openapi: 3.1.0 openapi: 3.1.0
info: info:
title: ntfy API title: ntfy API
description: 'ntfy is a simple HTTP-based pub-sub notification service. It allows description: 'This is the **OpenAPI (Swagger) documentation** for the ntfy API.
**For lots of examples, screenshots, and detailed usage guides, please visit the
[main ntfy documentation](https://docs.ntfy.sh/).**
ntfy is a simple HTTP-based pub-sub notification service. It allows
you to send push notifications to your phone or desktop via scripts from any computer. you to send push notifications to your phone or desktop via scripts from any computer.
## Features ## Features
- **Publish messages**: Send messages to topics via PUT/POST - **[Publish messages](https://docs.ntfy.sh/publish/)**: Send messages to topics via PUT/POST
- **Subscribe to topics**: Receive messages via JSON stream, SSE, raw stream, - **[Subscribe to topics](https://docs.ntfy.sh/subscribe/api/)**: Receive messages via JSON stream, SSE, raw stream,
or WebSocket or WebSocket
- **User management**: Authentication, tiered access, and account management - **User management**: Authentication, tiered access, and account management
- **Attachments**: Upload and attach files to messages - **[Attachments](https://docs.ntfy.sh/publish/#attachments)**: Upload and attach files to messages
- **Email & Phone**: Forward notifications to email or via phone calls - **[Email](https://docs.ntfy.sh/publish/#e-mail-notifications) & [Phone](https://docs.ntfy.sh/publish/#phone-calls)**: Forward notifications to email or via phone calls
- **UnifiedPush**: Support for UnifiedPush protocol - **[UnifiedPush](https://docs.ntfy.sh/publish/#unifiedpush)**: Support for UnifiedPush protocol
## Authentication ## [Authentication](https://docs.ntfy.sh/publish/#authentication)
Some endpoints require authentication if access control is enabled. Use either: Some endpoints require authentication if access control is enabled. Use either:
@@ -30,7 +35,7 @@ info:
- Bearer Token: `Authorization: Bearer <token>` - Bearer Token: `Authorization: Bearer <token>`
## Rate Limiting ## [Rate Limiting](https://docs.ntfy.sh/#limitations)
Requests may be rate-limited based on IP address or user tier. Requests may be rate-limited based on IP address or user tier.
@@ -1524,7 +1529,7 @@ components:
XTitle: XTitle:
name: X-Title name: X-Title
in: header in: header
description: Message title description: 'Message title. See [ntfy docs](https://docs.ntfy.sh/publish/#message-title) for details.'
schema: schema:
type: string type: string
simple: simple:
@@ -1534,7 +1539,7 @@ components:
XPriority: XPriority:
name: X-Priority name: X-Priority
in: header in: header
description: 'Message priority level: description: 'Message priority level. See [ntfy docs](https://docs.ntfy.sh/publish/#message-priority) for details.
- 1 (min): Low priority, may be hidden - 1 (min): Low priority, may be hidden
@@ -1562,40 +1567,42 @@ components:
XTags: XTags:
name: X-Tags name: X-Tags
in: header in: header
description: Comma-separated list of tags (may map to emojis) description: 'Comma-separated list of tags (may map to emojis). See [ntfy docs](https://docs.ntfy.sh/publish/#tags-emojis) for details.'
schema: schema:
type: string type: string
XClick: XClick:
name: X-Click name: X-Click
in: header in: header
description: URL to open when notification is clicked description: 'URL to open when notification is clicked. See [ntfy docs](https://docs.ntfy.sh/publish/#click-action) for details.'
schema: schema:
type: string type: string
format: uri format: uri
XIcon: XIcon:
name: X-Icon name: X-Icon
in: header in: header
description: URL to an image to use as notification icon description: 'URL to an image to use as notification icon. See [ntfy docs](https://docs.ntfy.sh/publish/#icons) for details.'
schema: schema:
type: string type: string
format: uri format: uri
XAttach: XAttach:
name: X-Attach name: X-Attach
in: header in: header
description: URL of a file to attach to the notification description: 'URL of a file to attach to the notification. See [ntfy docs](https://docs.ntfy.sh/publish/#attachments) for details.'
schema: schema:
type: string type: string
format: uri format: uri
XFilename: XFilename:
name: X-Filename name: X-Filename
in: header in: header
description: Filename for the attachment description: 'Filename for the attachment. See [ntfy docs](https://docs.ntfy.sh/publish/#attachments) for details.'
schema: schema:
type: string type: string
XActions: XActions:
name: X-Actions name: X-Actions
in: header in: header
description: 'Action buttons for the notification. Format: action,label,url[,clear=true] description: 'Action buttons for the notification. See [ntfy docs](https://docs.ntfy.sh/publish/#action-buttons) for details.
Format: action,label,url[,clear=true]
Actions: Actions:
@@ -1615,14 +1622,14 @@ components:
XEmail: XEmail:
name: X-Email name: X-Email
in: header in: header
description: Forward notification to email address description: 'Forward notification to email address. See [ntfy docs](https://docs.ntfy.sh/publish/#e-mail-notifications) for details.'
schema: schema:
type: string type: string
format: email format: email
XCall: XCall:
name: X-Call name: X-Call
in: header in: header
description: 'Make phone call when notification is received. description: 'Make phone call when notification is received. See [ntfy docs](https://docs.ntfy.sh/publish/#phone-calls) for details.
Set to "1" or "yes" to call verified phone number, or specify phone number Set to "1" or "yes" to call verified phone number, or specify phone number
@@ -1634,7 +1641,9 @@ components:
XDelay: XDelay:
name: X-Delay name: X-Delay
in: header in: header
description: 'Delay delivery of message. Supports: description: 'Delay delivery of message. See [ntfy docs](https://docs.ntfy.sh/publish/#scheduled-delivery) for details.
Supports:
- Absolute timestamp: 2023-12-25 08:00:00 EST - Absolute timestamp: 2023-12-25 08:00:00 EST
@@ -1648,7 +1657,7 @@ components:
XCache: XCache:
name: X-Cache name: X-Cache
in: header in: header
description: 'Cache message for delayed subscribers (default: yes)' description: 'Cache message for delayed subscribers (default: yes). See [ntfy docs](https://docs.ntfy.sh/publish/#message-caching) for details.'
schema: schema:
type: string type: string
enum: enum:
@@ -1659,7 +1668,7 @@ components:
XFirebase: XFirebase:
name: X-Firebase name: X-Firebase
in: header in: header
description: 'Forward to Firebase Cloud Messaging (default: yes)' description: 'Forward to Firebase Cloud Messaging (default: yes). See [ntfy docs](https://docs.ntfy.sh/publish/#disable-firebase) for details.'
schema: schema:
type: string type: string
enum: enum:
@@ -1670,7 +1679,7 @@ components:
XMarkdown: XMarkdown:
name: X-Markdown name: X-Markdown
in: header in: header
description: Render message as Markdown description: 'Render message as Markdown. See [ntfy docs](https://docs.ntfy.sh/publish/#markdown-formatting) for details.'
schema: schema:
type: string type: string
enum: enum:
@@ -1682,7 +1691,7 @@ components:
name: X-Template name: X-Template
in: header in: header
description: 'Template name from server templates directory, or "yes"/"true" description: 'Template name from server templates directory, or "yes"/"true"
for inline templating. for inline templating. See [ntfy docs](https://docs.ntfy.sh/publish/#message-templating) for details.
When "yes", the message/title should be a Go template. When "yes", the message/title should be a Go template.
@@ -1693,7 +1702,7 @@ components:
name: X-Poll-Id name: X-Poll-Id
in: header in: header
description: 'Poll request ID. When set, this becomes a poll request message description: 'Poll request ID. When set, this becomes a poll request message
for UnifiedPush. for UnifiedPush. See [ntfy docs](https://docs.ntfy.sh/publish/#unifiedpush) for details.
The message body is ignored when this is set. The message body is ignored when this is set.
@@ -1703,7 +1712,7 @@ components:
XUnifiedPush: XUnifiedPush:
name: X-UnifiedPush name: X-UnifiedPush
in: header in: header
description: Enable UnifiedPush mode description: 'Enable UnifiedPush mode. See [ntfy docs](https://docs.ntfy.sh/publish/#unifiedpush) for details.'
schema: schema:
type: string type: string
enum: enum:
@@ -1715,14 +1724,14 @@ components:
Poll: Poll:
name: poll name: poll
in: query in: query
description: Return cached messages and close connection description: 'Return cached messages and close connection. See [ntfy docs](https://docs.ntfy.sh/subscribe/api/#poll-for-messages) for details.'
schema: schema:
type: boolean type: boolean
default: false default: false
Since: Since:
name: since name: since
in: query in: query
description: 'Return cached messages since: description: 'Return cached messages since. See [ntfy docs](https://docs.ntfy.sh/subscribe/api/#fetch-cached-messages) for details.
- Unix timestamp: 1635528757 - Unix timestamp: 1635528757
@@ -1747,38 +1756,38 @@ components:
Scheduled: Scheduled:
name: scheduled name: scheduled
in: query in: query
description: Include scheduled/delayed messages in response description: 'Include scheduled/delayed messages in response. See [ntfy docs](https://docs.ntfy.sh/subscribe/api/#fetch-scheduled-messages) for details.'
schema: schema:
type: boolean type: boolean
default: false default: false
FilterId: FilterId:
name: id name: id
in: query in: query
description: Only return messages matching this exact message ID description: 'Only return messages matching this exact message ID. See [ntfy docs](https://docs.ntfy.sh/subscribe/api/#filter-messages) for details.'
schema: schema:
type: string type: string
FilterMessage: FilterMessage:
name: message name: message
in: query in: query
description: Only return messages matching this exact message string description: 'Only return messages matching this exact message string. See [ntfy docs](https://docs.ntfy.sh/subscribe/api/#filter-messages) for details.'
schema: schema:
type: string type: string
FilterTitle: FilterTitle:
name: title name: title
in: query in: query
description: Only return messages matching this exact title string description: 'Only return messages matching this exact title string. See [ntfy docs](https://docs.ntfy.sh/subscribe/api/#filter-messages) for details.'
schema: schema:
type: string type: string
FilterPriority: FilterPriority:
name: priority name: priority
in: query in: query
description: Only return messages matching any of these priorities (comma-separated) description: 'Only return messages matching any of these priorities (comma-separated). See [ntfy docs](https://docs.ntfy.sh/subscribe/api/#filter-messages) for details.'
schema: schema:
type: string type: string
FilterTags: FilterTags:
name: tags name: tags
in: query in: query
description: Only return messages containing all these tags (comma-separated) description: 'Only return messages containing all these tags (comma-separated). See [ntfy docs](https://docs.ntfy.sh/subscribe/api/#filter-messages) for details.'
schema: schema:
type: string type: string
responses: responses: