Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Namespace: microsoft.graph
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Add members to a distributionList.
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
| Permission type | Least privileged permissions | Higher privileged permissions |
|---|---|---|
| Delegated (work or school account) | Contacts.ReadWrite | Not available. |
| Delegated (personal Microsoft account) | Contacts.ReadWrite | Not available. |
| Application | Contacts.ReadWrite | Not available. |
HTTP request
POST /me/distributionLists/{distributionList-id}/addMembers
POST /users/{id | userPrincipalName}/distributionLists/{distributionList-id}/addMembers
Request headers
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
Request body
In the request body, supply a JSON representation of the parameters.
The following table lists the parameters that are required when you call this action.
| Parameter | Type | Description |
|---|---|---|
| members | member collection | The list of members to add to the distribution list. Each member must include an emailAddress. The displayName and recipientType properties are optional. Required. |
Response
If successful, this action returns a 200 OK response code and a distributionList object in the response body.
Examples
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/me/distributionLists/AAMkAGI2THVSAAA=/addMembers
Content-Type: application/json
{
"members": [
{
"displayName": "Megan Bowen",
"key": "MeganB@contoso.com",
"routingType": "SMTP",
"recipientType": "mailbox"
}
]
}
Response
The following example shows the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users('user-id')/distributionLists/$entity",
"id": "AAMkAGI2THVSAAA=",
"displayName": "Project Team",
"lastModifiedDateTime": "2024-03-17T11:00:00Z"
}