0
votes

I want to create a git repository in azure devops using rest api. POST https://dev.azure.com/{organization}/{project}/_apis/git/repositories?api-version=5.1

2

2 Answers

0
votes

Request body should be like this.

{ "name": "repo_name", "teamProjectReference": { "id": "azure_project_id" } }

Also, you can go through this link to know better https://docs.microsoft.com/en-us/rest/api/azure/devops/git/repositories/create?view=azure-devops-rest-5.1

0
votes

You only need to pass the repository name and the project id within the body:

{
  "name": "AnotherRepository",
  "project": {
    "id": "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c"
  }
}

See also: Create a repository