I'm using the Azure DevOps API to create a new work item. However I get an error
404 page not found
Documentation: Work Items - Create
Things I've tried
- Using postman and powershell (see screenshot and script below).

- In the json data I am populating only the required fields. The various values come from get API calls (e.g. get iterations).
- Changed the API version (6.0, 5.1)
- Included / excluded the project name in the URL
- Created a new personal access token
Get calls work (e.g. get list of teams, projects, work item types)
Why the 404 error for post?
Below the powershell script
$url= "https://dev.azure.com/my-org/my-project/_apis/wit/workitems/$($witType)?api-version=6.0"
$JSON = @'
[
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "Sample task"
} ,
{
"op": "add",
"path": "/fields/System.IterationId",
"from": null,
"value": "e5c8d590-5283-4642-8262-716d083bc045"
},
{
"op": "add",
"path": "/fields/System.AreaId",
"from": null,
"value": "138233"
},
{
"op": "add",
"path": "/fields/System.State",
"from": null,
"value": "To Do"
}
]
'@
Invoke-RestMethod -Uri $url -Headers @{Authorization = "Basic $token"} -Method Post -Body $JSON -ContentType application/json-patch+json