Skip to content

Latest commit

 

History

History
133 lines (101 loc) · 4.71 KB

File metadata and controls

133 lines (101 loc) · 4.71 KB
title Create site
description Create a new SharePoint site.
author spgraph-docs-team
ms.localizationpriority medium
ms.subservice sharepoint
doc_type apiPageType
ms.date 10/09/2025

Create site

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Create a new SharePoint site.

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.

[!INCLUDE permissions-table]

HTTP request

POST /sites

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

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

Property Type Description
description String The descriptive text for the site. Inherited from baseItem.
locale String The language settings of the site.
name String The name of the site. Inherited from baseItem. Optional.
ownerIdentityToResolve identityInput The site owner to be provided at the time of site creation only. Optional.
shareByEmailEnabled Boolean Determines whether the site and its content can be shared via email. Optional.
template siteTemplateType Specifies the template applied to the site. The possible values are: sitepagepublishing, sts, unknownFutureValue. Optional.
webUrl String The URL for the site that can only be provided at the time of site creation. Inherited from baseItem. Optional.

Response

If successful, this method returns a 202 Accepted response code and a site object in the response body. The response also contains a Location header, which contains the location of the getOperationStatus that was created to handle the site creation operation. Check the status of the creation operation by making a GET request to this location.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/sites
Content-Type: application/json

{
  "name": "Communication Site Test",
  "webUrl": "https://contoso.sharepoint.com/sites/commsite1",
  "locale": "en-US",
  "shareByEmailEnabled": false,
  "description": "Test Site Description",
  "template": "sitepagepublishing",
  "ownerIdentityToResolve": {
    "email": "ryan@contoso.com"
  }
}

[!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]


Response

The following example shows the response.

HTTP/1.1 202 Accepted
Location: https://graph.microsoft.com/beta/sites/getOperationStatus(operationId='JXMnaHR0cHMlM0ElMkYlMkZncmFwaC5taWNyb3NvZnQuY29tJTJGc2l0ZXMlMkZ0ZWFtc2l0ZTE=')