2026.3.4 - Regex POST and PATCH APIs Not Working When App at Root

Backlog

2026.3.4 - Regex POST and PATCH APIs Not Working When App at Root

avatar

PSU: 2026.3.4

OS: Windows Server 2025

Hosting: IIS


I saw in the patch notes for 2026.3.4 that regex APIs were fixed in instances when you have an app set up at "/", and they partially are (as GETs work); however, it seems POST and PATCH methods do not work.


To reproduce, setup an app at "/" and then setup a RegEX API endpoint that supports POST and PATCH and returns some data. When attempting a POST or PATCH via Invoke-RestMethod externally (from a client system), you will receive a blank response. Logs indicate no endpoint is found/method not supported. Moving the app from "/" to some new home (ie "/Hosting"), the API will start accepting a POST or PATCH and return data.


If you use Invoke-PSUEndpoint, it will work in both situations.


Example configuration:

New-PSUApp -Name "Server Management" -FilePath "Dashboards\Server Management\Dashboard.ps1" -BaseUrl "/" -Environment "Dedicated - App - Server Management" -Authenticated -SessionTimeout 120 -IdleTimeout 60 -AutoDeploy -Description "Server Management Dashboard"


$Var = @{ URL = 'my/api/v1/Computer/Request'; Method = @('POST','PATCH','DELETE'); Environment = 'Dedicated - API - v1'; Description = "Request API" ;  Regex = $True ; Authentication = $True; Role = @('Administrator', 'Requestors'); Path = "D:\Powershell Universal\Endpoints\myendpoint.ps1" }
New-PSUEndpoint @Var

The above endpoint will not be triggered when called with Invoke-RestMethod. However, if you move the App to "/Hosting", the endpoint will work.


Logs attached. I also noticed in the systemLog that despite specifically using a POST, the initial logs show the request as a GET which is strange.

All Comments (3)

avatar

Hello Sunny,


Thank you for testing 2026.3.4 so quickly, and for the clear steps to reproduce it.


We reproduced the issue in our lab on 2026.3.4, and the log you sent shows the same result on your server.


When an app is hosted at the root ("/"), regex endpoints that accept POST, PATCH or DELETE get an HTTP 405 (Method Not Allowed) with an empty body.


That empty 405 is the blank response you see.


The web routing hands the request to the app at the root before PowerShell Universal checks its regex endpoints, and that app only accepts GET.


GET requests to regex endpoints are not affected, which is why the 2026.3.4 fix looks partial.


It also explains your Invoke-PSUEndpoint result, because that cmdlet runs the endpoint inside PowerShell Universal and skips the web routing.


The GET in your log is a separate request, sent about 13 seconds before the POST.


The app at the root answered it, signed the user in with Windows authentication, and returned the app page.


The POST was not turned into a GET, and it received the 405 directly.


I am reporting this to our development team with our lab results and your log, as a follow-up to the earlier regex issue (ticket PSU-283, for internal reference only).


Moving the app away from the root still works, and we confirmed it in the lab.


If the app needs to stay at the root, there is a second workaround that we also confirmed.


Standard endpoints, without the Regex setting, accept POST, PATCH and DELETE normally when an app is at the root.


Your example URL has no regex pattern in it, so you can define it as a standard endpoint with a leading slash, and keep everything else the same:



$Var = @{ URL = '/my/api/v1/Computer/Request'; Method = @('POST','PATCH','DELETE'); Environment = 'Dedicated - API - v1'; Description = "Request API"; Authentication = $True; Role = @('Administrator', 'Requestors'); Path = "D:\Powershell Universal\Endpoints\myendpoint.ps1" }

New-PSUEndpoint @Var


In our lab, this endpoint worked next to your regex GET endpoint on the same base path.


If a write URL needs a variable part, the colon syntax also worked, for example /my/api/v1/Computer/:Id/Update.


You can find the syntax here: https://docs.devolutions.net/powershell-universal/api/endpoints/


Your GET endpoints that use regex can stay as they are.


One more point from your log: the account my\jsundberg3 received only the Reader role, while this endpoint allows Administrator and Requestors.


Please check that the account that calls the endpoint has one of those two roles.


Best regards,

Patrick Ouimet

avatar

Hello Patrick,


Thanks for the follow up.


Good call on the non-regex option. I can use that for the time being. I've been trying to do regex for all of them to keep things consistent, but for the time being, I can use that to get around the bug.


I mainly ended up using the regex option as I would only need to configure one endpoint that could then support multiple in-line variables with varying requirements. Example:


URL = 'my/api/v1/NamingDictionary/(?<Dictionary>[A-Za-z0-9]+)/?(?<ID>[0-9]+)?'

This supports all the variations of what this endpoint needs to support.


However, if I configured it using the non-regex way:

URL = '/my/api/v1/NamingDictionary/:Dictionary/:Id'

I couldn't then call the endpoint with/my/api/v1/NamingDictionary/Location, I would need to include a / at the end to get it to work (alternately, I'd need to create a "different" endpoint, one that only had the :Dictionary value)..


As for the roles, I am in a group that is part of the endpoint role groups. I just removed some from the configuration provided as sanitization.


Thanks,


Jacob

avatar

Hello Jacob,

Thank you for confirming that the non-regex workaround is fine for now.

Our development team confirmed the issue and is now working on a fix (ticket PSU-1616, for internal reference only).

The fix is currently planned for the 2027.1 release.

I will update this thread when the fix is available.

For your NamingDictionary endpoint, the documented colon syntax has no optional segment, so each URL form needs its own endpoint.

If that endpoint only answers GET requests, you can keep your regex version as it is.

We tested your exact NamingDictionary pattern on 2026.3.4 with an app at the root, and GET requests worked with and without the ID.

If it also needs POST or PATCH, you can create two standard endpoints, one for each URL form:

$Common = @{ Method = @('POST','PATCH'); Environment = 'Dedicated - API - v1'; Authentication = $True; Role = @('Administrator', 'Requestors') }
New-PSUEndpoint -Url '/my/api/v1/NamingDictionary/:Dictionary' -Path 'D:\Powershell Universal\Endpoints\NamingDictionary.ps1' @Common
New-PSUEndpoint -Url '/my/api/v1/NamingDictionary/:Dictionary/:Id' -Path 'D:\Powershell Universal\Endpoints\NamingDictionaryId.ps1' @Common

Each endpoint needs its own script file, because PSU does not load a second endpoint that uses the same file.

To keep the logic in one place, you can put it in a shared script and dot-source it from both endpoint files.

Each endpoint file then only needs this one line:

. 'D:\Powershell Universal\Shared\NamingDictionary.ps1'

Adjust the paths and roles to match your setup.

In the shared script, $Dictionary and $Id work as usual, and $Id is empty when the URL has no ID.

We tested this setup on 2026.3.4 with an app at the root, and POST and PATCH reached the shared script for both URL forms.

The regex GET endpoint also kept working next to these two endpoints on the same base path.

You can find the colon syntax in the Variable URL section of the endpoints page: https://docs.devolutions.net/powershell-universal/api/endpoints

Once the fix is released, you can move these endpoints back to regex if you want to keep everything consistent.

Best regards,

Patrick Ouimet