PageRule Post Api Bad Request

I am using the following powershell to manipulate the api related to page rules. I can get, delete fine so I know my headers are set correctly, but can’t post to create a new page rule. All I get is bad request and no more information. I’ve removed my zone id from the following for privacy reasons.

$cloudFlareUrl = $cloudFlareBaseUrl + 'zones/' + $cloudFlareZoneId + '/pagerules/'

this makes: https://api.cloudFlare.com/client/v4/zones/my zone id/pagerules/
I’ve tried this with and without the trailing slash

$forwardingRule = '{targets:[{"target":"url","constraint":{"operator":"matches","value":"' + $sitePrefix + '.' + $SiteBaseUrl + 
    '/*"}}],actions:[{"id":"forwarding_url","value":{"url":"https://excelwrapsgeneral.z35.web.core.windows.net/?redirectTo=' + 
    $sitePrefix + '.' + $SiteBaseUrl + '/$1","status_code":302}}]}'
$result = Invoke-RestMethod -Method POST -Uri $cloudFlareUrl -Headers $cloudFlareHeaders -Body $forwardingRule

so forwarding rule is
{targets:[{“target”:“url”,“constraint”:{“operator”:“matches”,“value”:“selenium.test.excelwraps.com/*"}}],actions:[{“id”:“forwarding_url”,“value”:{“url”:"https://excelwrapsgeneral.z3
5.web.core.windows.net/?redirectTo=selenium.test.excelwraps.com/$1","status_code”:302}}]}

I can set this up manually using the website no problem. I have set it up manually and also checked what I Http GET from the site is also what I am sending.

Please can we have more meaningful error messages? What is wrong with the request above?

In case this helps anyone, powershell Invoke-restmethod was swallowing the error. This told me what the actual error was:

try {
    $result = Invoke-RestMethod -Method POST -Uri $cloudFlareUrl -Headers $cloudFlareHeaders -Body $forwardingRule
} catch {
    // Workaround because Invoke-RestMethod swallows any error message
    $streamReader = [System.IO.StreamReader]::new($_.Exception.Response.GetResponseStream())
    $errorResponse = $streamReader.ReadToEnd() | ConvertFrom-Json
    $streamReader.Close()
    $errorResponse.messages
}