REST API: create project with powershell returns unspecified internal error I'm creating a a project with the code below.
The response is always an unspecified error.

Invoke-RestMethod :
{&quot;$id&quot;:&quot;1&quot;,&quot;innerException&quot;:null,&quot;message&quot;:&quot;TF400898: An Internal
Error Occurred. Activity Id:
3fbed4b2-9751-41ba-acbe-4d20f02ae556.&quot;,&quot;typeName&quot;:&quot;System.Web.Http.HttpResponseException,
System.Web.Http&quot;,&quot;typeKey&quot;:&quot;HttpResponseException&quot;,&quot;errorCode&quot;:0,&quot;eventId&quot;:0}
At line:1 char:1
Invoke-RestMethod -Uri $adoTaskUri -ContentType &quot;application/json-pat ...
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

I tried the body in postman and the projects are created just fine.
Can someone see what I'm doing wrong?
Listing of the projects works; the body works in postman; I can create tasks with a similar script.
$pacToken = &quot;&quot;
$organizationName = &quot;BLECUST&quot;

$adoHeader = @{&quot;Accept&quot;=&quot;application/json&quot;;Authorization=(&quot;Basic {0}&quot; -f [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes((&quot;{0}:{1}&quot; -f &quot;&quot;,$pacToken))))}
#$adoHeader #accept about anything and add security in the header

#api to create 
$adoTaskUri = &quot;https://dev.azure.com/BLECUST/_apis/projects?api-version=5.1&quot;


#list all projects
$response = Invoke-RestMethod -Uri $adoTaskUri -ContentType &quot;application/json-patch+json&quot;  -headers $adoHeader -Method GET
$response.value | ft name, visibility, url

$body='{
  &quot;name&quot;: &quot;FabrikamTravel18&quot;,
  &quot;description&quot;: &quot;Frabrikam travel app for Windows Phone&quot;,
  &quot;capabilities&quot;: {
    &quot;versioncontrol&quot;: {
      &quot;sourceControlType&quot;: &quot;Git&quot;
    },
    &quot;processTemplate&quot;: {
      &quot;templateTypeId&quot;: &quot;6b724908-ef14-45cf-84f8-768b5384da45&quot;
    }
  }
}'


Invoke-RestMethod -Uri $adoTaskUri -ContentType &quot;application/json-patch+json&quot; -Body $body-headers $adoHeader -Method POST
Your script works, just update the last content type to application/json:
Invoke-RestMethod -Uri $adoTaskUri -ContentType &quot;application/json&quot; -Body $body -headers $adoHeader -Method POST

PATCH is used to update a team project: https://docs.microsoft.com/en-us/rest/api/azure/devops/core/projects/update?view=azure-devops-rest-6.1