Forum Discussion
BoruAI
Jul 20, 2023Copper Contributor
API or NET client library to add users to an organization or projects under it?
the azure devops ui was like below picture, But I am wondering if I could do it through function calls?
Kidd_Ip
Sep 21, 2025MVP
Take this by using Azure DevOps REST API
To add users to an organization or project, use the User Entitlements API:
{
"accessLevel": {
"accountLicenseType": "express",
"licensingSource": "account"
},
"user": {
"principalName": "newuser@example.com",
"subjectKind": "user"
},
"projectEntitlements": [
{
"group": {
"groupType": "projectContributor"
},
"projectRef": {
"id": "your-project-id"
}
}
]
}
You’ll need:
- Organization name
- Project ID
- User email
- Proper PAT (Personal Access Token) with admin permissions