---
title: Microsoft Graph API Groups and Collaboration
slug: connectors/microsoft-graph-api-groups-and-collaboration
docTags: 
createdAt: 2026-06-09T16:29:39.763Z
---

This connector facilitates the management of groups and collaboration settings within Microsoft 365 through the Microsoft Graph API, enabling automated workflows for group administration and user collaboration.

Microsoft Graph API is a unified gateway to data and intelligence in Microsoft 365, providing access to rich, people-centric data and insights exposed as resources in Microsoft Graph. The Groups and Collaboration connector allows Swimlane Turbine users to automate group management and collaboration workflows. It enables the addition of members to groups, management of rejected senders, and streamlines collaboration across Microsoft services. This integration empowers security teams to maintain group integrity and manage collaboration settings efficiently, enhancing organizational security posture with minimal manual intervention.

## Configuration

### Prerequisites

To utilize the Microsoft Graph API Groups and Collaboration connector, ensure you have the following prerequisites:

- Client Credentials and Tenant ID authentication with these parameters:
  - URL: Endpoint for Microsoft Graph API
  - Client ID: Application identifier registered with Azure AD
  - Client Secret: Confidential string used to establish app identity
  - Tenant ID: Directory identifier in Azure AD
  - Scope: Permissions the app requires
- OAuth 2.0 Client Credentials with these parameters:
  - URL: Endpoint for Microsoft Graph API
  - Client ID: Application identifier registered with Azure AD
  - Client Secret: Confidential string used to establish app identity
  - Token URL: URL to obtain the access token
  - Scope: Permissions the app requires
- Delegated Flow Authentication with these parameters:
  - URL: Endpoint for Microsoft Graph API
  - Tenant ID: Directory identifier in Azure AD
    *... and so on*

## Authentication Methods

### OAuth 2.0 client credentials authentication with these parameters:

- url: Endpoint for Microsoft Graph API.
- client\_id: Application (client) ID registered in Azure AD.
- client\_secret: Client secret (key) generated for the application in Azure AD.
- token\_url: URL to retrieve the OAuth token.
- scope: Permissions the app requires.

### Password Grant (Delegated Authentication) for acting on behalf of a user:

- url: Endpoint for Microsoft Graph API.
- tenant\_id: Directory ID of the Azure AD tenant.
- oauth\_un: User's username to authenticate.
- oauth\_pwd: User's password to authenticate.
- oauth\_cl\_id: Application (client) ID registered in Azure AD.
- oauth\_cl\_secret: Client secret (key) generated for the application in Azure AD.
- login\_url: Login URL. Default value is [https://login.microsoftonline.com](https://login.microsoftonline.com). (Optional).
- scope: Permissions the app requires. Optional field. (Optional).

### Asset credentials specific to your organization (Microsoft Graph API Asset - Tenant ID):

- url: Endpoint for Microsoft Graph API.
- client\_ID: Application (client) ID registered in Azure AD.
- client\_Secret: Client secret (key) generated for the application in Azure AD.
- tenant\_id: Directory ID of the Azure AD tenant.
- scope: Permissions the app requires.

### Authentication for OAuth2 Refresh Token Grant credentials for Microsoft Graph API authentication

- url: Endpoint for Microsoft Graph API.
- client\_ID: Application (client) ID registered in Azure AD.
- client\_Secret: Client secret (key) generated for the application in Azure AD.
- refresh\_token: Refresh Token.
- scope: Permissions the app requires.

## Capabilities

The Microsoft Graph API connector gives the ability to get and update security alerts, and modify user licenses and sessions.

- Add Members
- Create RejectedSender

## Asset Setup

### Client Credential Flow Authentication

Authentication uses Azure application OAuth2.  You will need an admin account in Azure to create the application.

Recommended Application Permissions (feel free use custom permissions if you only use
certain actions):

- User.ReadWrite.All
- Directory.ReadWrite.All
- Directory.AccessAsUser.All
- Group.ReadWrite.All
- IdentityRiskyUser.Read.All

In order to set up the asset, you need the following:

- Azure Application Client ID
- Azure Application Client Secret
- Azure Tenant ID

Steps to create the Azure app:

1. Go to the [App Registration page](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade)
   in the Azure portal.
2. Click `New Registration`.
3. Enter a name for your new application and choose `Accounts in this organizational directory only`,
   then click `Register` at the bottom.
4. Navigate to the `API permissions` tab on the left navigation menu.
5. Select `Add a permission`.
6. Select `Microsoft Graph`.
7. Select `Application permissions`, then mark all the permissions you need for the
   actions you are using (See suggested permissions at the top of the asset setup section).
8. Click the `Add permissions` button at the bottom of the page.
9. Select `Grant admin consent` for your organization, then your permissions should look as below.
10. Navigate to the `Certificates & secrets` tab and select `New client secret`.
11. Fill out the description and expiration, then click the `Add` button at the bottom.
12. The `Value` of the secret you just created is the `Client Secret` needed for the Swimlane asset.
13. Navigate to the `Overview` tab on the left menu.
14. The `Client ID` and `Tenant ID` needed in the asset are shown on this page.

The `Client ID`, `Tenant ID`, and `Client Secret` described in the steps above are the credentials you
need for the asset.

### Password Flow (Delegated Auth)

- Use Delegated Permissions, instead of Application Permissions, and generate `Client ID`, `Tenant ID`, and `Client Secret` as described in the above Client Credential Flow Authentication.
- We also need an `Username` and a `Password` for this authentication.

### Authentication flow for OAuth2 Refresh Token

- Oauth 2.0 refresh token grant, which requires a `Refresh Token`,`Tenant ID`, `Client ID` and `Client Secret`. Use this auth with accounts which have MFA enabled. To generate a refresh token please follow the instructions below.
  - In step 3 of the above-mentioned setup instructions, please provide a `Redirect URI` and select the platform as 'Web', before clicking on `Register` at the the bottom.
  - Proceed with the remaining steps to generate 'Client ID', `Tenant ID` and `Client Secret`.
  - Add the permissions in **Delegated Permissions**.
  - The Swimlane team will provide a Python script and instructions on how to use the script to generate the Refresh Token.

### Limit Access to specific mailboxes

Administrators who want to limit app access to specific mailboxes can create an application access policy by using
the **New-ApplicationAccessPolicy** PowerShell cmdlet.
For more information please see the article [Limiting application permissions to specific Exchange Online mailboxes](https://docs.microsoft.com/en-us/graph/auth-limit-mailbox-access).

## Action Setup

### OData filters

Information on the filter input formatting can be found [here](https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter).

Keep in mind that not specifying a folder as an input will result in the query affecting all possible folders.
Example:
If we want to ingest only unread emails, and we don't set the input "folder", we will ingest all unread emails from all folders, including "Deleted Items", "Junk", etc.

### Well Known Folders

Well known folders can be used instead of Folder IDs for email actions.  All well known folder names can be found
[here](https://docs.microsoft.com/en-us/graph/api/resources/mailfolder?view=graph-rest-1.0).

### Sites Get Site

All the Sites actions require the site ID to be executed. The site ID can be obtained using the action Sites Get Site, in
order to run the action the `site_hostname` and `site_name` are needed. This two values can be found in a site URL:

```javascript
https://{site_hostname}.sharepoint.com/sites/{site_name}
```

For example if our site URL is `https://swimlaneintegrations.sharepoint.com/sites/IntegrationsSite` we should use:

- `site_hostname`: `swimlaneintegrations`
- `site_name`: `IntegrationsSite`

After the action execution you can find the Site ID on the `ID` output field.

### Sites Create List

In order to create a list with its columns, use the input `Columns`. You can find all the possible values with
its configuration on the following table.

| Property name         | Type                                                                                                                                | Description                                                       |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| boolean               | [booleanColumn](https://docs.microsoft.com/en-us/graph/api/resources/booleancolumn?view=graph-rest-1.0)                             | This column stores boolean values.                                |
| calculated            | [calculatedColumn](https://docs.microsoft.com/en-us/graph/api/resources/calculatedcolumn?view=graph-rest-1.0)                       | This column's data is calculated based on other columns.          |
| choice                | [choiceColumn](https://docs.microsoft.com/en-us/graph/api/resources/choicecolumn?view=graph-rest-1.0)                               | This column stores data from a list of choices.                   |
| currency              | [currencyColumn](https://docs.microsoft.com/en-us/graph/api/resources/currencycolumn?view=graph-rest-1.0)                           | This column stores currency values.                               |
| dateTime              | [dateTimeColumn](https://docs.microsoft.com/en-us/graph/api/resources/datetimecolumn?view=graph-rest-1.0)                           | This column stores DateTime values.                               |
| geolocation           | [geolocationColumn](https://docs.microsoft.com/en-us/graph/api/resources/geolocationcolumn?view=graph-rest-1.0)                     | This column stores a geolocation.                                 |
| lookup                | [lookupColumn](https://docs.microsoft.com/en-us/graph/api/resources/lookupcolumn?view=graph-rest-1.0)                               | This column's data is looked up from another source in the site.  |
| number                | [numberColumn](https://docs.microsoft.com/en-us/graph/api/resources/numbercolumn?view=graph-rest-1.0)                               | This column stores number values.                                 |
| personOrGroup         | [personOrGroupColumn](https://docs.microsoft.com/en-us/graph/api/resources/personorgroupcolumn?view=graph-rest-1.0)                 | This column stores Person or Group values.                        |
| text                  | [textColumn](https://docs.microsoft.com/en-us/graph/api/resources/textcolumn?view=graph-rest-1.0)                                   | This column stores text values.                                   |
| validation            | [columnValidation](https://docs.microsoft.com/en-us/graph/api/resources/columnvalidation?view=graph-rest-1.0)                       | This column stores validation formula and message for the column. |
| hyperlinkOrPicture    | [hyperlinkOrPictureColumn](https://docs.microsoft.com/en-us/graph/api/resources/hyperlinkorpicturecolumn?view=graph-rest-1.0)       | This column stores hyperlink or picture values.                   |
| term                  | [termColumn](https://docs.microsoft.com/en-us/graph/api/resources/termcolumn?view=graph-rest-1.0)                                   | This column stores taxonomy terms.                                |
| thumbnail             | [thumbnailColumn](https://docs.microsoft.com/en-us/graph/api/resources/thumbnailcolumn?view=graph-rest-1.0)                         | This column stores thumbnail values.                              |
| contentApprovalStatus | [contentApprovalStatusColumn](https://docs.microsoft.com/en-us/graph/api/resources/contentapprovalstatuscolumn?view=graph-rest-1.0) | This column stores content approval status.                       |

For a complete version of this table please see [the official column definition table.](https://docs.microsoft.com/en-us/graph/api/resources/columndefinition?view=graph-rest-1.0#properties)

### Create List Column

Refer to the above table to get the `Type properties` and `Column type` input. The `Type properties` are
documented within the links in the `Type` column.

### Get list items

In order to use the filter input please refer to the [OData filters](docId\:MWLlJ3tIXBXv1ccHJBgOS) section.

The column used to filter the output must be indexed, see the [Microsoft documentation](https://support.microsoft.com/en-us/office/add-an-index-to-a-list-or-library-column-f3f00554-b7dc-44d1-a2ed-d477eac463b0?ui=en-us\&rs=en-us\&ad=us) to add an index to a list.

## Limitations

When using `$filter` and `$orderby` in the same query to get messages, make sure to specify properties in the following ways:

- Properties that appear in `$orderby` must also appear in $filter.
- Properties that appear in `$orderby` are in the same order as in $filter.
- Properties that are present in `$orderby` appear in `$filter` before any properties that aren't.

Failing to do this results in the following error:

- Error code: InefficientFilter
- Error message: The restriction or sort order is too complex for this operation.

The Assign/Remove User License requires either the disabled plans and accompanying SKU IDs to assign licenses or the
SKU ID of the license you want to remove.

The Get Security Alert has additional information it can return. There are a large number of fields that don't
relate to many alerts, so they are not mapped; you can add them if desired.

## Notes

- [An Introduction to Microsoft Graph API](https://social.technet.microsoft.com/wiki/contents/articles/33525.an-introduction-to-microsoft-graph-api.aspx)
- [Microsoft Graph REST API v1.0 reference](https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0)
- [Azure AD OAuth2 flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-oauth-code)
- [oauthlib Legacy Application client](https://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#legacy-application-flow), this is sort of a hack to bypass manual login (typically required)

# Configurations

## Microsoft Graph API Asset - Tenant ID

Authenticates using Client Credentials and Tenant ID

### Configuration Parameters

| **Parameter**  | **Description**                            | **Type** | **Required** |
| -------------- | ------------------------------------------ | -------- | ------------ |
| url            | A URL to the target host.                  | string   | Required     |
| tenant\_id     | The Tenant ID.                             | string   | Required     |
| client\_ID     | The client ID                              | string   | Required     |
| client\_Secret | The client secret.                         | string   | Required     |
| scope          | List of permission scopes for this action. | array    | Required     |
| verify\_ssl    | Verify SSL certificate                     | boolean  | Optional     |
| http\_proxy    | A proxy to route requests through.         | string   | Optional     |

## Password Grant (Delegated Authentication)

Authenticates on behalf of a user using oauth 2.0 credentials

### Configuration Parameters

| **Parameter**     | **Description**                    | **Type** | **Required** |
| ----------------- | ---------------------------------- | -------- | ------------ |
| url               | A URL to the target host.          | string   | Required     |
| login\_url        |                                    | string   | Optional     |
| tenant\_id        |                                    | string   | Required     |
| oauth\_un         | The username for authentication    | string   | Required     |
| oauth\_pwd        | The password for authentication    | string   | Required     |
| oauth\_cl\_id     | The client ID                      | string   | Required     |
| oauth\_cl\_secret | The client secret.                 | string   | Required     |
| scope             | Permission scopes for this action. | array    | Optional     |
| verify\_ssl       | Verify SSL certificate             | boolean  | Optional     |
| http\_proxy       | A proxy to route requests through. | string   | Optional     |

## Oauth 2.0 Client Credentials

Authenticates using oauth 2.0 client credentials

### Configuration Parameters

| **Parameter**  | **Description**                                                                                                                                                               | **Type** | **Required** |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------ |
| url            | A URL to the target host.                                                                                                                                                     | string   | Required     |
| token\_url     | Must start with [https://login.microsoftonline.com/](https://login.microsoftonline.com/) and then continue with the tenant\_id, and then be prepended with /oauth2/v2.0/token | string   | Required     |
| client\_id     | The client ID                                                                                                                                                                 | string   | Required     |
| client\_secret | The client secret.                                                                                                                                                            | string   | Required     |
| scope          | List of permission scopes for this action.                                                                                                                                    | array    | Required     |
| verify\_ssl    | Verify SSL certificate                                                                                                                                                        | boolean  | Optional     |
| http\_proxy    | A proxy to route requests through.                                                                                                                                            | string   | Optional     |

## MS Graph OpenID Connect Refresh Token Grant

Authenticates using refresh token.

### Configuration Parameters

| **Parameter**  | **Description**                    | **Type** | **Required** |
| -------------- | ---------------------------------- | -------- | ------------ |
| url            | A URL to the target host.          | string   | Required     |
| cl\_id         | The client ID.                     | string   | Required     |
| cl\_secret     | The client secret.                 | string   | Required     |
| refresh\_token | Refresh Token.                     | string   | Optional     |
| verify\_ssl    | Verify SSL certificate             | boolean  | Optional     |
| http\_proxy    | A proxy to route requests through. | string   | Optional     |

# Actions

## Add Members

Adds a new member to a group using the 'group-id' and member's '@odata.id' in Microsoft Graph API.

### Endpoint

- **URL:** `/v1.0/groups/{{group-id}}/members/$ref`
- **Method:** `POST`

### Input

| **Argument Name**          | **Type** | **Required** | **Description**                                        |
| -------------------------- | -------- | ------------ | ------------------------------------------------------ |
| `path_parameters.group-id` | string   | Required     | The ID of the group to which the member will be added. |
| `@odata.id`                | string   | Optional     | The ID of the directory object to add as a member.     |

### Input Example

`{"json_body":{"@odata.id":"https://graph.microsoft.com/v1.0/directoryObjects/{id}"},"path_parameters":{"group-id":"f0b2d6f5-097d-4177-91af-a24e530b53cc"}}`

### Output

| **Parameter** | **Type** | **Description**                  |
| ------------- | -------- | -------------------------------- |
| `status_code` | number   | HTTP status code of the response |
| `reason`      | string   | Response reason phrase           |

### Output Example

`{}`

## Create RejectedSender

Add a user or group to the rejected sender list in Microsoft Graph API using their unique ID.

### Endpoint

- **URL:** `/v1.0/groups/{{id}}/rejectedSenders/$ref`
- **Method:** `POST`

### Input

| **Argument Name**    | **Type** | **Required** | **Description**                      |
| -------------------- | -------- | ------------ | ------------------------------------ |
| `path_parameters.id` | string   | Required     | The unique identifier for the group. |
| `@odata.id`          | string   | Optional     | The ID of a user or group object.    |

### Input Example

`{"json_body":{"@odata.id":"https://graph.microsoft.com/v1.0/users/alexd@contoso.com"},"path_parameters":{"id":"732227b1-1927-49d4-bba9-cc30e6baf602"}}`

### Output

| **Parameter**   | **Type** | **Description**                  |
| --------------- | -------- | -------------------------------- |
| `status_code`   | number   | HTTP status code of the response |
| `reason`        | string   | Response reason phrase           |
| `response_text` | string   | Output field: response\_text     |

### Output Example

`{"response_text":"string"}`

# Response Headers

| **Header**                | **Description**                                       | **Example**                                                                                                               |
| ------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| Cache-Control             | Directives for caching mechanisms                     | no-cache                                                                                                                  |
| client-request-id         | HTTP response header: client-request-id               | b15e85c5-d517-4e9e-a99e-d32ec5057dd7                                                                                      |
| Content-Encoding          | HTTP response header: Content-Encoding                | gzip                                                                                                                      |
| Content-Type              | The media type of the resource                        | application/json                                                                                                          |
| Date                      | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT                                                                                             |
| OData-Version             | HTTP response header: OData-Version                   | 4.0                                                                                                                       |
| request-id                | HTTP response header: request-id                      | b15e85c5-d517-4e9e-a99e-d32ec5057dd7                                                                                      |
| Strict-Transport-Security | HTTP response header: Strict-Transport-Security       | max-age=31536000                                                                                                          |
| Transfer-Encoding         | HTTP response header: Transfer-Encoding               | chunked                                                                                                                   |
| Vary                      | HTTP response header: Vary                            | Accept-Encoding                                                                                                           |
| x-ms-ags-diagnostic       | HTTP response header: x-ms-ags-diagnostic             | \{"ServerInfo":\{"DataCenter":"Central India","Slice":"E","Ring":"3","ScaleUnit":"002","RoleInstance":"PN2PEPF00000273"}} |
| x-ms-resource-unit        | HTTP response header: x-ms-resource-unit              | 2                                                                                                                         |
