I succeded to update the target branch with the API you provided with the following body:
{"targetRefName":"refs/heads/test"}
In PowerShell:
$pat = "YOUR-PAT"
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,"$pat")))
$headers = @{Authorization=("Basic {0}" -f $base64AuthInfo)}
$url = "https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests/{pullRequestId}?api-version=5.1"
$json = '{"targetRefName":"refs/heads/master"}'
$response = Invoke-RestMethod -Uri $url -Method PATCH -ContentType application/json -Headers $headers -Body $json
It look like each PR could be re-targeted, I don't see an option enable/disable the feature.
By the way, I succeeded only in the above JSON, if you will try to get the PR and change the targetRefName you will get an error.