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.1-preview.1

URI Parameters

Name In Required Type Description
containerDescriptor
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.

subjectDescriptor
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.1-preview.1' to use this version of the api.

Responses

Name Type Description
200 OK

GraphMembership

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/{organization}/_apis/graph/memberships/{subjectDescriptor}/{containerDescriptor}?api-version=5.1-preview.1

Sample Response

{
  "containerDescriptor": "vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMjc2NDUyMzk5MS0zNTcwNTk2NDktMjg0Mjg0MDY1My0zODY1MTM4Nzcw",
  "memberDescriptor": "vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMTE2OTQxODg1MC0zMTAxNjQ5MjE2LTIyMTE3NzI3NzMtMTUyNTg1MzYzNA",
  "_links": {
    "self": {
      "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Memberships/vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMTE2OTQxODg1MC0zMTAxNjQ5MjE2LTIyMTE3NzI3NzMtMTUyNTg1MzYzNA/vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMjc2NDUyMzk5MS0zNTcwNTk2NDktMjg0Mjg0MDY1My0zODY1MTM4Nzcw"
    },
    "member": {
      "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Groups/vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMTE2OTQxODg1MC0zMTAxNjQ5MjE2LTIyMTE3NzI3NzMtMTUyNTg1MzYzNA"
    },
    "container": {
      "href": "https://vssps.dev.azure.com/Fabrikam/_apis/Graph/Groups/vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTc2MDU2ODQ4LTMyODAwNzczODUtMjM4NDQzMDA4Mi0yNTc3Njk3NTA4LTEtMjc2NDUyMzk5MS0zNTcwNTk2NDktMjg0Mjg0MDY1My0zODY1MTM4Nzcw"
    }
  }
}

Definitions

Name Description
GraphMembership

Relationship between a container and a member

ReferenceLinks

The class to represent a collection of REST reference links.

GraphMembership

Relationship between a container and a member

Name Type Description
_links

ReferenceLinks

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

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.