Added Openapi spec/swagger UI - added swagger to python requirements.txt

This commit is contained in:
gitglubber
2026-01-11 18:46:30 -08:00
parent e18d64933f
commit 0ae2ca43bd
5 changed files with 3194 additions and 0 deletions

31
docs/api.md Normal file
View File

@@ -0,0 +1,31 @@
# API Reference
This page contains the interactive API documentation for ntfy. You can try out the API endpoints directly from this page.
## Using the API Documentation
### Server Selection
The Swagger UI includes a server selector dropdown at the top of the page. By default, it's configured to use the **public ntfy.sh server**.
To use your own ntfy instance, edit `docs/swagger_api/openapi.yaml` and add your server URL to the `servers` section:
```yaml
servers:
- url: https://ntfy.sh
description: Public ntfy server
- url: https://your-ntfy-instance.com
description: Your custom server
```
After editing the file, rebuild the docs with `mkdocs build`.
### Authentication
Click the **Authorize** button (lock icon) in Swagger UI to add your access token. Use the format `Bearer <your_token>` or `Basic <base64_encoded_credentials>`.
### Try It Out
Click **Try it out** on any endpoint to test it directly. Parameters will be empty by default - enter your own values to test.
<swagger-ui src="swagger_api/openapi.yaml"/>