Edit

Create distributionList

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.

Create a new distributionList in the user's mailbox.

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
POST /users/{id | userPrincipalName}/distributionLists

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 distributionList object.

You can specify the following properties when you create a distributionList.

Property Type Description
displayName String The display name of the distribution list. Required.
members member collection The list of members to add to the distribution list. Optional.

Response

If successful, this method returns a 201 Created 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
Content-Type: application/json

{
  "displayName": "Project Team",
  "members": [
    {
      "displayName": "Adele Vance",
      "emailAddress": "AdeleV@contoso.com",
      "recipientType": "mailbox"
    },
    {
      "displayName": "Alex Wilber",
      "emailAddress": "AlexW@contoso.com",
      "recipientType": "mailbox"
    }
  ]
}

Response

The following example shows the response.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('user-id')/distributionLists/$entity",
  "id": "AAMkAGI2THVSAAA=",
  "changeKey": "CQAAABYAAABE",
  "createdDateTime": "2024-03-15T10:30:00Z",
  "lastModifiedDateTime": "2024-03-15T10:30:00Z",
  "categories": [],
  "displayName": "Project Team",
  "members": [
    {
      "@odata.type": "#microsoft.graph.member",
      "displayName": "Adele Vance",
      "emailAddress": "AdeleV@contoso.com",
      "recipientType": "mailbox"
    },
    {
      "@odata.type": "#microsoft.graph.member",
      "displayName": "Alex Wilber",
      "emailAddress": "AlexW@contoso.com",
      "recipientType": "mailbox"
    }
  ]
}