Memberships - Add
Create a new membership between a container and subject.
PUT https://vssps.dev.azure.com/{organization}/_apis/graph/memberships/{subjectDescriptor}/{containerDescriptor}?api-version=5.0-preview.1
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
container
|
path | True |
string |
A descriptor to a group that can be the container in the relationship. |
|
organization
|
path | True |
string |
The name of the Azure DevOps organization. |
|
subject
|
path | True |
string |
A descriptor to a group or user that can be the child subject in the relationship. |
|
api-version
|
query | True |
string |
Version of the API to use. This should be set to '5.0-preview.1' to use this version of the api. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
successful operation |
Security
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
| Name | Description |
|---|---|
| vso.graph_manage | Grants the ability to read user, group, scope and group membership information, and to add users, groups and manage group memberships |
Examples
Sample request
PUT https://vssps.dev.azure.com/fabrikam/_apis/graph/memberships/{subjectDescriptor}/{containerDescriptor}?api-version=5.0-preview.1
Sample response
{
"containerDescriptor": "TWljcm9zb2Z0LlRlYW1Gb3VuZGF0aW9uLklkZW50aXR5O1MtMS05LTE1NTEzNzQyNDUtNDI4NzE1MDg5LTI0ODk3NTM0MTMtMjc5MTIyNzA3NS0yNDUyNDc1MzktMS0xMzQwMjAwMjExLTcxMDc4MDQ5My0yMjcxMTQ2Njk2LTE5NTEzNjAxNDc",
"memberDescriptor": "TWljcm9zb2Z0LlRlYW1Gb3VuZGF0aW9uLklkZW50aXR5O1MtMS05LTE1NTEzNzQyNDUtNDI4NzE1MDg5LTI0ODk3NTM0MTMtMjc5MTIyNzA3NS0yNDUyNDc1MzktMS0zNzExMDMzOTI5LTMyMDM5ODY3NjItMzA0NzMyMzAwOS0zNzQ1OTQ0MTQy"
}
Definitions
| Name | Description |
|---|---|
|
Graph |
Relationship between a container and a member |
|
Reference |
The class to represent a collection of REST reference links. |
GraphMembership
Relationship between a container and a member
| Name | Type | Description |
|---|---|---|
| _links |
This field contains zero or more interesting links about the graph membership. These links may be invoked to obtain additional relationships or more detailed information about this graph membership. |
|
| containerDescriptor |
string |
|
| memberDescriptor |
string |
ReferenceLinks
The class to represent a collection of REST reference links.
| Name | Type | Description |
|---|---|---|
| links |
object |
The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. |