| title | Create sharePointGroup |
|---|---|
| description | Create a new sharePointGroup object. |
| author | tmarwendo-microsoft |
| ms.localizationpriority | medium |
| ms.subservice | onedrive |
| doc_type | apiPageType |
| ms.date | 1/31/2025 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Create a new sharePointGroup object. The sharePointGroup only exists within the scope of the fileStorageContainer in which it was created. To add permissions for the sharePointGroup on driveItem objects, you must use the Create permission on a driveItem API. Up to 10,000 sharePointGroup objects can be created per fileStorageContainer. For more information on service limits, see SharePoint online limits.
[!INCLUDE national-cloud-support]
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.
[!INCLUDE permissions-table]
Note
In addition to Microsoft Graph permissions, applications calling this API must at least have the AddPermissions container type-level permission on the container type of the corresponding containers. For more information, see container types. To learn more about container type-level permissions, see SharePoint Embedded authorization.
POST /storage/fileStorage/containers/{fileStorageContainerId}/sharePointGroups| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
In the request body, supply a JSON representation of the sharePointGroup object.
You can specify the following properties when you create a sharePointGroup.
| Property | Type | Description |
|---|---|---|
| description | String | A user-visible description of the sharePointGroup. The description can't be longer than 512 characters. Optional. |
| title | String | The title of the sharePointGroup. The title can't be longer than 255 characters. Required. |
If successful, this method returns a 201 Created response code and a sharePointGroup object in the response body.
The following example shows a request that creates a new sharePointGroup that is local to a fileStoragContainer. The title and description of the sharePointGroup are shown in the request body.
POST https://graph.microsoft.com/beta/storage/fileStorage/containers/b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z/sharePointGroups
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.sharePointGroup",
"title": "Sample Group",
"description": "This is a sample description"
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response. The group is successfully created with a newly assigned ID that acts as an identifier.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.sharePointGroup",
"id" : "4",
"title": "Sample Group",
"description": "This is sample description"
}