API error 500 with edit Triggers

Hi,

I have to create script in PowerShell to connect via API to Orchestrator. Script have to change some details in one Trigger. I can create trigger, delete trigger. Edit also but only if I set “Enabled” parameter to “false”. If I run script changes are made, but trigger is disabled and I can’t enable it by API. If I run script with edit Trigger with “Enable” parameters is true I get 500 error code.

If I use this command

Invoke-RestMethod $url’/odata/ProcessSchedules/UiPath.Server.Configuration.OData.SetEnabled’ -Method ‘POST’ -Headers $headers -Body $body

with body

$body = "{
n "schedulesIds": [5165], n "Enabled": true

`n}"

I have 400 error code: Bad Request

Any idea ?

Problem solved. In body I used a capital letter in the parameter name and it was an error …