[GH-ISSUE #1334] Cannot use more than one param in an action body #944

Closed
opened 2026-05-07 00:29:00 +02:00 by BreizhHardware · 1 comment

Originally created by @mattmccormick on GitHub (May 11, 2025).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1334

🐞 Describe the bug
When creating a notification that has an http action, I'm not able to use more than one colon : in the actions header.

💻 Components impacted
API

💡 Screenshots and/or logs
For example, if we use the example request from Send HTTP Request but I add an additional param to the body, I'll receive the following error response:

curl     -d "Garage door has been open for 15 minutes. Close it?"     -H "Actions: http, Close door, https://api.mygarage.lan/, method=PUT, headers.Authorization=Bearer zAzsx1sk.., body={\"action\": \"close\", \"action2\": \"close2\"}"     ntfy.sh/myhome
{"code":40018,"http":400,"error":"invalid request: actions invalid; unexpected character ':' at position 132","link":"https://ntfy.sh/docs/publish/#action-buttons"}
Originally created by @mattmccormick on GitHub (May 11, 2025). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1334 :lady_beetle: **Describe the bug** When creating a notification that has an http action, I'm not able to use more than one colon `:` in the actions header. :computer: **Components impacted** API :bulb: **Screenshots and/or logs** For example, if we use the [example request from Send HTTP Request](https://docs.ntfy.sh/publish/#send-http-request) but I add an additional param to the body, I'll receive the following error response: ``` curl -d "Garage door has been open for 15 minutes. Close it?" -H "Actions: http, Close door, https://api.mygarage.lan/, method=PUT, headers.Authorization=Bearer zAzsx1sk.., body={\"action\": \"close\", \"action2\": \"close2\"}" ntfy.sh/myhome ``` ``` {"code":40018,"http":400,"error":"invalid request: actions invalid; unexpected character ':' at position 132","link":"https://ntfy.sh/docs/publish/#action-buttons"} ```
BreizhHardware 2026-05-07 00:29:00 +02:00
  • closed this issue
  • added the
    🪲 bug
    label
Author
Owner

@wunter8 commented on GitHub (May 14, 2025):

The issue is actually due to the comma in your body. The comma breaks the "simple" action parser.

To get around this, you need to send the request using the JSON format. Here's the working equivalent:

curl -d '{
    "topic": "myhome",
    "message": "Garage door has been open for 15 minutes. Close it?",
    "actions": [
        {
            "action": "http",
            "label": "Close door",
            "url": "https://api.mygarage.lan/",
            "method": "PUT",
            "headers": {
                "Authorization": "Bearer zAzsx1sk..."
            },
            "body": "{\"action\": \"close\", \"action2\": \"close2\"}"
        }
    ]
}' ntfy.sh
<!-- gh-comment-id:2880971922 --> @wunter8 commented on GitHub (May 14, 2025): The issue is actually due to the comma in your `body`. The comma breaks the "simple" action parser. To get around this, you need to send the request using the JSON format. Here's the working equivalent: ``` curl -d '{ "topic": "myhome", "message": "Garage door has been open for 15 minutes. Close it?", "actions": [ { "action": "http", "label": "Close door", "url": "https://api.mygarage.lan/", "method": "PUT", "headers": { "Authorization": "Bearer zAzsx1sk..." }, "body": "{\"action\": \"close\", \"action2\": \"close2\"}" } ] }' ntfy.sh ```
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/ntfy#944
No description provided.