Group Memberships API

Note

Usage of this API is restricted to approved partners, subject to limitations via API agreement.

The Group Memberships API represents association of a member with a LinkedIn group. You can utilize the following APIs to retrieve, update and deleting membership associations.

Group Membership Schema

Field Name Format Description
availableActions enum String Membership specific actions that can be taken on group membership determined by the viewer's group membership status. Can be the following enums:
  • MESSAGE - Send a message to a group member.
  • CONNECT - Send a connection request.
  • PROMOTE_TO_OWNER - Promote a group member/manager to be a group owner.
  • PROMOTE_TO_MANAGER - Promote a group member to be a group manager.
  • DEMOTE_TO_MANAGER - Demote a group owner to be a group manager.
  • DEMOTE_TO_MEMBER - Demote a group owner/manager to be a group member.
  • ACCEPT_REQUEST - Accept a request from a member who requested to join the group.
  • REJECT_REQUEST - Reject a request from a member who requested to join the group.
  • SEND_REQUEST - Send a request to join a group.
  • WITHDRAW_INVITATION - Withdraw the invitation to a member who was invited to join the group.
  • WITHDRAW_REQUEST - Withdraw the request to join the group.
  • REMOVE - Remove a group owner/manager/member from the group.
  • LEAVE_GROUP - Leave the group.
  • BLOCK - Block a group owner/manager/member from the group.
  • UNBLOCK - Unblock a group owner/manager/member to be again a group member.
  • TRANSFER_OWNERSHIP - Group owner transfers group ownership to a group manager in the same group. Previous owner becomes a group manager.
  • SEND_INVITATION - Invite a member to join a group.
created AuditStamp An AuditStamp corresponding to the creation of this Group Membership.
deleted optional AuditStamp An AuditStamp corresponding to the deletion of this Group Membership.
group Group URN The LinkedIn group URN.
joined AuditStamp An AuditStamp containing the timestamp when user joined the group and the corresponding user who approved the join request.
lastModified AuditStamp An AuditStamp corresponding to the last modification of this Group Membership.
member URN The URN representing an identity that is associated with the group membership. Can currently only be a person URN.
status enum string Membership status of the Group. Can be the following enums:
  • BLOCKED - User has been blocked from joining or participating in the group.
  • FORMER_MEMBER - User left the group or have been removed from the group.
  • INVITE_PENDING - User has been invited to join the group and the invite is in pending state waiting for the user to accept it.
  • MEMBER - A regular group member who can use basic functionality of a group such as viewing, engaging, posting into the group.
  • MANAGER - A group manager who is appointed to help manage the group. A manager possesses admin controls that only include group membership and content moderation. They may be multiple managers in a group.
  • OWNER - A group owner who possesses full admin control over group membership, content moderation, editing group information, archiving and deleting a group. They may be multiple owners in a group.
  • REJECTED - User has been rejected to join the group.
  • REQUEST_PENDING - User's request to join the group is in pending state and is waiting to be approved.
  • INVITE_WITHDRAWN - Invitation to join the group has been withdrawn by the inviter.
  • REQUEST_WITHDRAWN - Request to join the group has been withdrawn by the request sender.

Retrieving Group Memberships

You can retrieve one or multiple group membership association information via group URN and person URN using the API requests below:

GET

https://api.linkedin.com/v2/groupMemberships/(group:{group URN},member:{person URN})
GET

https://api.linkedin.com/v2/groupMemberships?ids=List((group:{group URN1},member:{person URN1}),(group:{group URN2},member:{person URN2}))

Note : In order to make sample calls above succeed, you need indicate X-RestLi-Protocol-Version:2.0.0 in the request header. The group URN and person URN need to be url encoded.

sample group membership response

{
    "created": {
        "actor": "urn:li:person:123ABC", 
        "time": 1527803821100
    }, 
    "group": "urn:li:group:1", 
    "joined": {
        "actor": "urn:li:person:123ABC", 
        "time": 1527803821100
    }, 
    "lastModified": {
        "actor": "urn:li:person:123ABC", 
        "time": 1527803821100
    }, 
    "member": "urn:li:person:123ABC", 
    "status": "OWNER"
}

Retrieving all Group Memberships of a Member

You can retrieve all group memberships of a member based on a number of filtering facets using the API request below:

GET

https://api.linkedin.com/v2/groupMemberships?q=member&member={person URN}&membershipStatuses=List(MEMBER,OWNER)

sample group membership response

{
  "elements": [
    {
      "created": {
        "actor": "urn:li:person:123ABC",
        "time": 1527803821100
      },
      "group": "urn:li:group:1",
      "joined": {
        "actor": "urn:li:person:123ABC",
        "time": 1527803821100
      },
      "lastModified": {
        "actor": "urn:li:person:123ABC",
        "time": 1527803821100
      },
      "member": "urn:li:person:123ABC",
      "status": "OWNER"
    },
    {
      "created": {
        "actor": "urn:li:person:456DEF",
        "time": 1527803821100
      },
      "group": "urn:li:group:1",
      "joined": {
        "actor": "urn:li:person:456DEF",
        "time": 1527803821100
      },
      "lastModified": {
        "actor": "urn:li:person:456DEF",
        "time": 1527803821100
      },
      "member": "urn:li:person:456DEF",
      "status": "MEMBER"
    },
    {...}
  ],
  "paging": {
    "count": 10,
    "links": [],
    "start": 0,
    "total": 2
  }
}

Query Parameters

Field Description Format Required
membershipStatuses Filter based on Group Membership status. Can be the following enums:
  • BLOCKED - User has been blocked from joining or participating in the group.
  • FORMER_MEMBER - User left the group or have been removed from the group.
  • INVITE_PENDING - User has been invited to join the group and the invite is in pending state waiting for the user to accept it.
  • MEMBER - A regular group member who can use basic functionality of a group such as viewing, engaging, posting into the group.
  • MANAGER - A group manager who is appointed to help manage the group. A manager possesses admin controls that only include group membership and content moderation. They may be multiple managers in a group.
  • OWNER - A group owner who possesses full admin control over group membership, content moderation, editing group information, archiving and deleting a group. They may be multiple owners in a group.
  • REJECTED - User has been rejected to join the group.
  • REQUEST_PENDING - User's request to join the group is in pending state and is waiting to be approved.
  • INVITE_WITHDRAWN - Invitation to join the group has been withdrawn by the inviter.
  • REQUEST_WITHDRAWN - Request to join the group has been withdrawn by the request sender.
String[] Yes
createdAfter Filter Group Memberships to include only once created after a given timestamp. In epoch milliseconds. long No
createdBefore Filter Group Memberships to include only once created before a given timestamp. In epoch milliseconds. long No
joinedAfter Filter Group Memberships to include only once joined after a given timestamp. In epoch milliseconds. long No
joinedBefore Filter Group Memberships to include only once joined before a given timestamp. In epoch milliseconds. long No
sort Sort order used for sorting Group Memberships. Sort memberships by the time when member joined the group. Default to DESCENDING . Can be either:
  • ASCENDING - Sort by ascending order. The interpretation of this is domain-specific -- typically increasing order for numbers, lexicographic order for strings, but it varies. Enumerated types may be sorted in order of declaration, for instance.
  • DESCENDING - Sort by descending order. The interpretation of this is domain-specific -- typically decreasing order for numbers, reverse lexicographic order for strings, but it varies. Enumerated types may be sorted in reverse order of declaration, for instance.
String No

Retrieving all Group Memberships of a Group

You can retrieve all group memberships of a group based on a number of filtering facets using the API request below:

GET

https://api.linkedin.com/v2/groupMemberships?q=group&group={group URN}&membershipStatuses=List(MEMBER)

sample group membership response

{
  "elements": [
    {
      "created": {
        "actor": "urn:li:person:123ABC",
        "time": 1527803821100
      },
      "group": "urn:li:group:1",
      "joined": {
        "actor": "urn:li:person:123ABC",
        "time": 1527803821100
      },
      "lastModified": {
        "actor": "urn:li:person:123ABC",
        "time": 1527803821100
      },
      "member": "urn:li:person:123ABC",
      "status": "MEMBER"
    },
    {
      "created": {
        "actor": "urn:li:person:456DEF",
        "time": 1527803821100
      },
      "group": "urn:li:group:1",
      "joined": {
        "actor": "urn:li:person:456DEF",
        "time": 1527803821100
      },
      "lastModified": {
        "actor": "urn:li:person:456DEF",
        "time": 1527803821100
      },
      "member": "urn:li:person:456DEF",
      "status": "MEMBER"
    },
    {...}
  ],
  "paging": {
    "count": 10,
    "links": [],
    "start": 0,
    "total": 2
  }
}

Query Parameters

Field Description Format Required
group Urn of the group to which the group memberships belong. Group URN Yes
membershipStatuses Filter based on Group Membership status. Can be the following enums:
  • BLOCKED - User has been blocked from joining or participating in the group.
  • FORMER_MEMBER - User left the group or have been removed from the group.
  • INVITE_PENDING - User has been invited to join the group and the invite is in pending state waiting for the user to accept it.
  • MEMBER - A regular group member who can use basic functionality of a group such as viewing, engaging, posting into the group.
  • MANAGER - A group manager who is appointed to help manage the group. A manager possesses admin controls that only include group membership and content moderation. They may be multiple managers in a group.
  • OWNER - A group owner who possesses full admin control over group membership, content moderation, editing group information, archiving and deleting a group. They may be multiple owners in a group.
  • REJECTED - User has been rejected to join the group.
  • REQUEST_PENDING - User's request to join the group is in pending state and is waiting to be approved.
  • INVITE_WITHDRAWN - Invitation to join the group has been withdrawn by the inviter.
  • REQUEST_WITHDRAWN - Request to join the group has been withdrawn by the request sender.
String[] Yes
createdAfter Filter Group Memberships to include only once created after a given timestamp. In epoch milliseconds. long No
createdBefore Filter Group Memberships to include only once created before a given timestamp. In epoch milliseconds. long No
joinedAfter Filter Group Memberships to include only once joined after a given timestamp. In epoch milliseconds. long No
joinedBefore Filter Group Memberships to include only once joined before a given timestamp. In epoch milliseconds. long No
sort Sort order used for sorting Group Memberships. Sort memberships by the time when member joined the group. Default to DESCENDING . Can be either:
  • ASCENDING - Sort by ascending order. The interpretation of this is domain-specific -- typically increasing order for numbers, lexicographic order for strings, but it varies. Enumerated types may be sorted in order of declaration, for instance.
  • DESCENDING - Sort by descending order. The interpretation of this is domain-specific -- typically decreasing order for numbers, reverse lexicographic order for strings, but it varies. Enumerated types may be sorted in reverse order of declaration, for instance.
String No

Creating and Updating Group Memberships

Create or update the group membership statuses for a list of group members with a given action. All the actions that can be performed on a group membership can be found in availableActions . API response will contain successful results and error information. See below for an example:

POST

https://api.linkedin.com/v2/groupMemberships?action=membershipAction

Note : In order to make sample call above succeed, you need indicate X-RestLi-Protocol-Version:2.0.0 in the request header.

Request Body Parameters

Field Names Description Format Required
action Action to be performed on membership status. See availableActions for a complete list of available actions. String yes
group The Urn of the LinkedIn group that is associated with the group membership. Urn yes
member Each Urn represents an identity that is associated with the group membership. It is currently a PersonUrn. Urn[] yes

request body

{
    "action": "SEND_REQUEST", 
    "group": "urn:li:group:7026583", 
    "members": [
        "urn:li:person:123ABC", 
        "urn:li:person:456DEF"
    ]
}

response body

{
    "value": {
        "failedActions": [
            {
                "customCode": 123, 
                "httpStatusCode": 500, 
                "member": "urn:li:person:456DEF", 
                "message": "Failed to update status"
            }
        ], 
        "succeededActions": [
            {
                "member": "urn:li:person:123ABC"
            }
        ]
    }
}

Deleting Group Memberships

As a group admin, you have the ability to delete your own group(s).

DELETE

https://api.linkedin.com/v2/groupMemberships/(group:{group URN},member:{person URN})