API: POST /api/monitor returns 404 Not Found #4175

Closed
opened 2026-02-28 03:53:42 -05:00 by deekerman · 4 comments
Owner

Originally created by @aetd on GitHub (Jun 19, 2025).

I was unable to find any similar open or closed issues or pull requests.

🛡️ Security Policy

📝 Description

A fresh Docker installation of Uptime Kuma does not accept POST requests to its API to create a new monitor. The request fails with an HTTP 404 Not Found error, and the response body says Cannot POST /api/monitor. This happens even after a clean reinstall using the :latest image tag.

Deploy Uptime Kuma on a clean Debian 12 server using the standard docker-compose.yml with the image louislam/uptime-kuma:latest.

Access the web UI at http://<SERVER_IP>:3001 and complete the initial admin user setup.

In the UI, navigate to Settings > API Keys and create a new API key.

From the same server's command line (via SSH), execute the following curl command to try and create a monitor, replacing <YOUR_API_KEY> with the key from the previous step.

👟 Reproduction steps

Bash

curl -v -X POST
-H "Content-Type: application/json"
-d '{"type":"http","name":"Test from Curl","url":"https://google.com"}'
"http://127.0.0.1:3001/api/monitor?apiKey=<YOUR_API_KEY>"

👀 Expected behavior

The curl command should succeed with an HTTP 200 OK status. The response body should be a JSON object indicating success, like {"ok":true, "msg":"Saved", "monitorID":X}. A new monitor named "Test from Curl" should appear in the Uptime Kuma dashboard.

😓 Actual Behavior

curl -v -X POST
-H "Content-Type: application/json"
-d '{"type":"http","name":"Test from Curl","url":"https://google.com"}'
"http://127.0.0.1:3001/api/monitor?apiKey=uk2__wHHF7l1rZ6Q6ADUDpuPvPerAZef-sTOJa_8Ld36"
Note: Unnecessary use of -X or --request, POST is already inferred.

  • Trying 127.0.0.1:3001...
  • Connected to 127.0.0.1 (127.0.0.1) port 3001 (#0)

POST /api/monitor?apiKey=uk2__wHHF7l1rZ6Q6ADUDpuPvPerAZef-sTOJa_8Ld36 HTTP/1.1
Host: 127.0.0.1:3001
User-Agent: curl/7.88.1
Accept: /
Content-Type: application/json
Content-Length: 66

< HTTP/1.1 404 Not Found
< X-Frame-Options: SAMEORIGIN
< Content-Security-Policy: default-src 'none'
< X-Content-Type-Options: nosniff
< Content-Type: text/html; charset=utf-8
< Content-Length: 151
< Date: Thu, 19 Jun 2025 23:54:48 GMT
< Connection: keep-alive
< Keep-Alive: timeout=5
<

<html lang="en"> <head> </head>
Cannot POST /api/monitor
</html> * Connection #0 to host 127.0.0.1 left intact

🐻 Uptime-Kuma Version

1.23.13 (from :latest tag, also tried with :1)

💻 Operating System and Arch

Debian 12

🌐 Browser

Google

🖥️ Deployment Environment

  • Runtime Environment:
    • Docker: Version X.X.X (Build Y.Y.Y)
    • Docker Compose: Version X.X.X
    • Portainer (BE/CE): Version X.X.X (LTS: Yes/No)
    • MariaDB: Version X.X.X (LTS: Yes/No)
    • Node.js: Version X.X.X (LTS: Yes/No)
    • Kubernetes (K3S/K8S): Version X.X.X (LTS: Yes/No, via [method/tool])
  • Database:
    • SQLite: Embedded
    • MariaDB: Embedded/External
  • Database Storage:
    • Filesystem:
      • Linux: ext4/XFS/Btrfs/ZFS/F2FS
      • macOS: APFS/ HFS+
      • Windows: NTFS/ReFS
    • Storage Medium: HDD/eMMC/SSD/NVMe
  • Uptime Kuma Setup:
    • Number of monitors: X

📝 Relevant log output

Отлично, у нас есть все данные!

Вот финальная, полностью готовая версия вашего сообщения об ошибке для GitHub. Она включает всю информацию, которую вы собрали.

Что делать дальше:
Скопируйте заголовок и текст описания ниже.
Перейдите на страницу создания "Issue" на GitHub Uptime Kuma: https://github.com/louislam/uptime-kuma/issues/new/choose
Выберите "Bug Report".
Вставьте заголовок и это описание в соответствующие поля.
Не забудьте вставить ваш полный вывод команды curl в раздел Actual Behavior.
Заголовок (Title):
API: POST /api/monitor returns 404 Not Found on fresh Docker install

Описание (Description):
A fresh Docker installation of Uptime Kuma does not accept POST requests to its API to create a new monitor. The request fails with an HTTP 404 Not Found error, and the response body says Cannot POST /api/monitor. This happens even after a clean reinstall using the :latest and specific version tags like :1.23.13.

Steps to Reproduce
Deploy Uptime Kuma on a clean Debian 12 server using the standard docker-compose.yml.

Access the web UI at http://<SERVER_IP>:3001 and complete the initial admin user setup.

In the UI, navigate to Settings > API Keys and create a new API key.

From the same server's command line (via SSH), execute the following curl command to try and create a monitor, replacing <YOUR_API_KEY> with the key from the previous step.

Bash

curl -v -X POST \
-H "Content-Type: application/json" \
-d '{"type":"http","name":"Test from Curl","url":"https://google.com"}' \
"http://127.0.0.1:3001/api/monitor?apiKey=<YOUR_API_KEY>"
Expected Behavior
The curl command should succeed with an HTTP 200 OK status and a JSON response like {"ok":true, "msg":"Saved", "monitorID":X}.

Actual Behavior
The command fails with an HTTP 404 Not Found status. The response body is HTML containing the text Cannot POST /api/monitor.

Full curl -v output:

<-- Сюда вставьте ваш полный вывод последней команды curl, которую вы мне присылали -->
Environment Details
Uptime Kuma Version: 1.23.13
OS: Debian 12
Runtime Environment:
Docker: Version 28.2.2
Docker Compose: Version v2.36.2
Node.js: Version v18.20.2 (from inside the container)
Database:
SQLite: Embedded (Default)
Database Storage:
Filesystem: ext4
Uptime Kuma Setup:
Number of monitors: 0 (occurs on a fresh install)
Reverse Proxy: No
Originally created by @aetd on GitHub (Jun 19, 2025). ### 📑 I have found these related issues/pull requests I was unable to find any similar open or closed issues or pull requests. ### 🛡️ Security Policy - [x] I have read and agree to Uptime Kuma's [Security Policy](https://github.com/louislam/uptime-kuma/security/policy). ### 📝 Description A fresh Docker installation of Uptime Kuma does not accept POST requests to its API to create a new monitor. The request fails with an HTTP 404 Not Found error, and the response body says Cannot POST /api/monitor. This happens even after a clean reinstall using the :latest image tag. Deploy Uptime Kuma on a clean Debian 12 server using the standard docker-compose.yml with the image louislam/uptime-kuma:latest. Access the web UI at http://<SERVER_IP>:3001 and complete the initial admin user setup. In the UI, navigate to Settings > API Keys and create a new API key. From the same server's command line (via SSH), execute the following curl command to try and create a monitor, replacing <YOUR_API_KEY> with the key from the previous step. ### 👟 Reproduction steps Bash curl -v -X POST \ -H "Content-Type: application/json" \ -d '{"type":"http","name":"Test from Curl","url":"https://google.com"}' \ "http://127.0.0.1:3001/api/monitor?apiKey=<YOUR_API_KEY>" ### 👀 Expected behavior The curl command should succeed with an HTTP 200 OK status. The response body should be a JSON object indicating success, like {"ok":true, "msg":"Saved", "monitorID":X}. A new monitor named "Test from Curl" should appear in the Uptime Kuma dashboard. ### 😓 Actual Behavior curl -v -X POST \ -H "Content-Type: application/json" \ -d '{"type":"http","name":"Test from Curl","url":"https://google.com"}' \ "http://127.0.0.1:3001/api/monitor?apiKey=uk2__wHHF7l1rZ6Q6ADUDpuPvPerAZef-sTOJa_8Ld36" Note: Unnecessary use of -X or --request, POST is already inferred. * Trying 127.0.0.1:3001... * Connected to 127.0.0.1 (127.0.0.1) port 3001 (#0) > POST /api/monitor?apiKey=uk2__wHHF7l1rZ6Q6ADUDpuPvPerAZef-sTOJa_8Ld36 HTTP/1.1 > Host: 127.0.0.1:3001 > User-Agent: curl/7.88.1 > Accept: */* > Content-Type: application/json > Content-Length: 66 > < HTTP/1.1 404 Not Found < X-Frame-Options: SAMEORIGIN < Content-Security-Policy: default-src 'none' < X-Content-Type-Options: nosniff < Content-Type: text/html; charset=utf-8 < Content-Length: 151 < Date: Thu, 19 Jun 2025 23:54:48 GMT < Connection: keep-alive < Keep-Alive: timeout=5 < <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Error</title> </head> <body> <pre>Cannot POST /api/monitor</pre> </body> </html> * Connection #0 to host 127.0.0.1 left intact ### 🐻 Uptime-Kuma Version 1.23.13 (from :latest tag, also tried with :1) ### 💻 Operating System and Arch Debian 12 ### 🌐 Browser Google ### 🖥️ Deployment Environment - **Runtime Environment**: - Docker: Version `X.X.X` (Build `Y.Y.Y`) - Docker Compose: Version `X.X.X` - Portainer (BE/CE): Version `X.X.X` (LTS: Yes/No) - MariaDB: Version `X.X.X` (LTS: Yes/No) - Node.js: Version `X.X.X` (LTS: Yes/No) - Kubernetes (K3S/K8S): Version `X.X.X` (LTS: Yes/No, via `[method/tool]`) - **Database**: - SQLite: Embedded - MariaDB: Embedded/External - **Database Storage**: - **Filesystem**: - Linux: ext4/XFS/Btrfs/ZFS/F2FS - macOS: APFS/ HFS+ - Windows: NTFS/ReFS - **Storage Medium**: HDD/eMMC/SSD/NVMe - **Uptime Kuma Setup**: - Number of monitors: `X` ### 📝 Relevant log output ```bash session Отлично, у нас есть все данные! Вот финальная, полностью готовая версия вашего сообщения об ошибке для GitHub. Она включает всю информацию, которую вы собрали. Что делать дальше: Скопируйте заголовок и текст описания ниже. Перейдите на страницу создания "Issue" на GitHub Uptime Kuma: https://github.com/louislam/uptime-kuma/issues/new/choose Выберите "Bug Report". Вставьте заголовок и это описание в соответствующие поля. Не забудьте вставить ваш полный вывод команды curl в раздел Actual Behavior. Заголовок (Title): API: POST /api/monitor returns 404 Not Found on fresh Docker install Описание (Description): A fresh Docker installation of Uptime Kuma does not accept POST requests to its API to create a new monitor. The request fails with an HTTP 404 Not Found error, and the response body says Cannot POST /api/monitor. This happens even after a clean reinstall using the :latest and specific version tags like :1.23.13. Steps to Reproduce Deploy Uptime Kuma on a clean Debian 12 server using the standard docker-compose.yml. Access the web UI at http://<SERVER_IP>:3001 and complete the initial admin user setup. In the UI, navigate to Settings > API Keys and create a new API key. From the same server's command line (via SSH), execute the following curl command to try and create a monitor, replacing <YOUR_API_KEY> with the key from the previous step. Bash curl -v -X POST \ -H "Content-Type: application/json" \ -d '{"type":"http","name":"Test from Curl","url":"https://google.com"}' \ "http://127.0.0.1:3001/api/monitor?apiKey=<YOUR_API_KEY>" Expected Behavior The curl command should succeed with an HTTP 200 OK status and a JSON response like {"ok":true, "msg":"Saved", "monitorID":X}. Actual Behavior The command fails with an HTTP 404 Not Found status. The response body is HTML containing the text Cannot POST /api/monitor. Full curl -v output: <-- Сюда вставьте ваш полный вывод последней команды curl, которую вы мне присылали --> Environment Details Uptime Kuma Version: 1.23.13 OS: Debian 12 Runtime Environment: Docker: Version 28.2.2 Docker Compose: Version v2.36.2 Node.js: Version v18.20.2 (from inside the container) Database: SQLite: Embedded (Default) Database Storage: Filesystem: ext4 Uptime Kuma Setup: Number of monitors: 0 (occurs on a fresh install) Reverse Proxy: No ```
deekerman 2026-02-28 03:53:42 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@CommanderStorm commented on GitHub (Jun 19, 2025):

We don't currently have this api.
Not sure where you got the idea we have

@CommanderStorm commented on GitHub (Jun 19, 2025): We don't currently have this api. Not sure where you got the idea we have
Author
Owner

@valzargaming commented on GitHub (Jun 20, 2025):

This looks like a spam bot

@valzargaming commented on GitHub (Jun 20, 2025): This looks like a spam bot
Author
Owner

@louislam commented on GitHub (Jun 20, 2025):

This looks like a spam bot

I don't think so, but it looks like the idea was coming from AI, and then op trusted AI and opened an issue here.

@louislam commented on GitHub (Jun 20, 2025): > This looks like a spam bot I don't think so, but it looks like the idea was coming from AI, and then op trusted AI and opened an issue here.
Author
Owner

@brojor commented on GitHub (Nov 17, 2025):

@CommanderStorm I guess he was trying (just like me) to manage Uptime Kuma using terraform provider that attempts to call this endpoint. This wrapper is required for it to work correctly.

@brojor commented on GitHub (Nov 17, 2025): @CommanderStorm I guess he was trying (just like me) to manage Uptime Kuma using [terraform provider](https://registry.terraform.io/providers/kill3r-queen/uptimekuma/latest) that attempts to call this endpoint. This [wrapper](https://github.com/alencarsouza/Uptime-Kuma-Web-API) is required for it to work correctly.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/uptime-kuma#4175
No description provided.