1

I'm using collections (not organization) in azure devops and trying to add users in teams (under project settings) through Postman REST API.

I can retrieve teams details using PAT auth:

GET https://devops.company.com/tfs/COL/_apis/projects/My-WORK/teams?api-version=6.0

Success Response:

{
    "value": [
        {
            "id": "01xxccrayr-a443-600d-db0d-12435",
            "name": "MY-WORK Team",
            "url": "",
            "description": "team description",
            "identityUrl": "xxxx",
            "projectName": "MY-WORK",
            "projectId": "8540tuyfred-qawsd-fre432-fre3-57wedsa1546thyf"
        }
    ],
    "count": 1
}

but unable to add users into specific teams through Postman:

PUT https://devops.company.com/tfs/COL/_apis/GroupEntitlements/{teamID}/members/{memberId}?api-version=6.0

e.g. PUT https://devops.company.com/tfs/COL/_apis/GroupEntitlements/01xxccrayr-a443-600d-db0d-12435/members/anyemailid@not.com?api-version=6.0

Error Response:

<head>
    <title>Page not found. - Azure DevOps Server</title>
    <style type="text/css">

Also, I tried below urls but didn't work:

How to add team members in Azure Devops via API? Also Groups API does not work

https://learn.microsoft.com/en-us/rest/api/azure/devops/memberentitlementmanagement/members/add?view=azure-devops-rest-5.1

Any input would be helpful, Thank you.

Evandro Pomatti
  • 13,341
  • 16
  • 97
  • 165
John_D
  • 31
  • 1
  • 4

1 Answers1

0

You can use Members – Add to add users to a team in Azure DevOps

You can use below method to add users to a team:

PUT https://vsaex.dev.azure.com/{organization}/_apis/GroupEntitlements/{groupId}/members/{memberId}?api-version=6.0-preview.1

Because teams are also considered as groups in Azure DevOps

Reference: Members - Add - REST API (Azure DevOps Member Entitlement Management) | Microsoft Docs

RamaraoAdapa
  • 2,837
  • 2
  • 5
  • 11