Skip to content

Commit c086dc4

Browse files
authored
Merge pull request #25314 from microsoftgraph/neelporiya/add-site-archive-unarchive-api-docs
Adding site archive unarchive API docs
2 parents e8487c3 + 84a3204 commit c086dc4

File tree

7 files changed

+209
-7
lines changed

7 files changed

+209
-7
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: "site: archive"
3+
description: "Archive an active SharePoint site."
4+
ms.localizationpriority: medium
5+
author: "neelporiya"
6+
ms.subservice: "sharepoint"
7+
doc_type: apiPageType
8+
ms.date: 12/15/2024
9+
---
10+
11+
# site: archive
12+
13+
Namespace: microsoft.graph
14+
15+
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
16+
17+
Archive an active SharePoint [site](../resources/site.md).
18+
19+
## Permissions
20+
21+
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](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference).
22+
23+
<!-- { "blockType": "ignore" } -->
24+
|Permission type|Least privileged permissions|Higher privileged permissions|
25+
|:---|:---|:---|
26+
|Delegated (work or school account)|Sites.FullControl.All|Not available.|
27+
|Delegated (personal Microsoft account)|Not supported.|Not supported.|
28+
|Application|Sites.FullControl.All|Not available.|
29+
30+
In delegated scenarios, the signed-in user must also be assigned one of the following supported [Microsoft Entra roles](/entra/identity/role-based-access-control/permissions-reference) for this operation:
31+
32+
* SharePoint Administrator
33+
* Global Administrator
34+
35+
*SharePoint Administrator* is the least privileged role for this operation.
36+
37+
## HTTP request
38+
39+
```http
40+
POST /sites/{site-id}/archive
41+
```
42+
43+
## Request headers
44+
45+
| Name | Description |
46+
| :------------ | :------------------------ |
47+
|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).|
48+
49+
## Request body
50+
51+
Don't supply a request body for this method.
52+
53+
## Response
54+
55+
If successful, this method returns a `204 No Content` response code. It doesn't return anything in the response body.
56+
57+
## Examples
58+
59+
### Request
60+
61+
The following example shows how to archive a site.
62+
63+
<!-- {
64+
"blockType": "request",
65+
"name": "archive_site",
66+
"sampleKeys": ["contoso.sharepoint.com,da60e844-ba1d-49bc-b4d4-d5e36bae9019,712a596e-90a1-49e3-9b48-bfa80bee8740"]
67+
}
68+
-->
69+
```http
70+
POST https://graph.microsoft.com/beta/sites/contoso.sharepoint.com,da60e844-ba1d-49bc-b4d4-d5e36bae9019,712a596e-90a1-49e3-9b48-bfa80bee8740/archive
71+
```
72+
73+
### Response
74+
75+
The following example shows the response.
76+
77+
<!-- {
78+
"blockType": "response",
79+
"truncated": true
80+
}
81+
-->
82+
```http
83+
HTTP/1.1 204 No Content
84+
```
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: "site: unarchive"
3+
description: "Unarchive an archived SharePoint site."
4+
ms.localizationpriority: medium
5+
author: "neelporiya"
6+
ms.subservice: "sharepoint"
7+
doc_type: apiPageType
8+
ms.date: 12/15/2024
9+
---
10+
11+
# site: unarchive
12+
13+
Namespace: microsoft.graph
14+
15+
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
16+
17+
Unarchive an archived SharePoint [site](../resources/site.md).
18+
19+
## Permissions
20+
21+
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](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference).
22+
23+
<!-- { "blockType": "ignore" } -->
24+
|Permission type|Least privileged permissions|Higher privileged permissions|
25+
|:---|:---|:---|
26+
|Delegated (work or school account)|Sites.FullControl.All|Not available.|
27+
|Delegated (personal Microsoft account)|Not supported.|Not supported.|
28+
|Application|Sites.FullControl.All|Not available.|
29+
30+
In delegated scenarios, the signed-in user must also be assigned one of the following supported [Microsoft Entra roles](/entra/identity/role-based-access-control/permissions-reference) for this operation:
31+
32+
* SharePoint Administrator
33+
* Global Administrator
34+
35+
*SharePoint Administrator* is the least privileged role for this operation.
36+
37+
## HTTP request
38+
39+
```http
40+
POST /sites/{site-id}/unarchive
41+
```
42+
43+
## Request headers
44+
45+
| Name | Description |
46+
| :------------ | :------------------------ |
47+
|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).|
48+
49+
## Request body
50+
51+
Don't supply a request body for this method.
52+
53+
54+
## Response
55+
56+
If successful, this method returns a `202 Accepted` response code. The response also contains a `Location` header, which contains the location of the site that is unarchived. To check the status of the unarchive operation, make a GET request to the location URL.
57+
58+
## Examples
59+
60+
### Request
61+
62+
The following example shows how to unarchive a site.
63+
64+
<!-- {
65+
"blockType": "request",
66+
"name": "unarchive_site",
67+
"sampleKeys": ["contoso.sharepoint.com,da60e844-ba1d-49bc-b4d4-d5e36bae9019,712a596e-90a1-49e3-9b48-bfa80bee8740"]
68+
}
69+
-->
70+
```http
71+
POST https://graph.microsoft.com/beta/sites/contoso.sharepoint.com,da60e844-ba1d-49bc-b4d4-d5e36bae9019,712a596e-90a1-49e3-9b48-bfa80bee8740/unarchive
72+
```
73+
74+
### Response
75+
76+
The following example shows the response.
77+
78+
<!-- {
79+
"blockType": "response",
80+
"truncated": true
81+
}
82+
-->
83+
```http
84+
HTTP/1.1 202 Accepted
85+
Location: https://graph.microsoft.com/beta/sites/contoso.sharepoint.com,da60e844-ba1d-49bc-b4d4-d5e36bae9019,712a596e-90a1-49e3-9b48-bfa80bee8740
86+
```

api-reference/beta/resources/site.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ The **site** resource provides metadata and relationships for a SharePoint site.
3232
| [List sites across geographies][] | GET /site/getAllSites |
3333
| [List subsites for a site][] | GET /sites/{site-id}/sites |
3434
| [Search for sites][] | GET /sites?search={query} |
35+
| [Archive site](../api/site-archive.md) | POST /sites/{site-id}/archive |
36+
| [Unarchive site](../api/site-unarchive.md) | POST /sites/{site-id}/unarchive |
3537
| [Follow site][] | POST /users/{user-id}/followedSites/add |
3638
| [Unfollow site][] | POST /users/{user-id}/followedSites/remove |
3739
| [List followed sites][] | GET /me/followedSites |

api-reference/beta/resources/sitecollection.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ If a [**site**](site.md) resource has a non-null **siteCollection** property, th
2222

2323
| Property | Type | Description |
2424
| :------------------- | :------- | :---------------------------------------------------------------------------------- |
25-
| **hostname** | string | The hostname for the site collection. Read-only. |
26-
| **dataLocationCode** | string | The geographic region code for where this site collection resides. Only present for multi-geo tenants. Read-only. |
27-
| **root** | [root][] | If present, indicates that this is a root site collection in SharePoint. Read-only. |
28-
| **archivalDetails** | [siteArchivalDetails][] | Represents whether the site collection is recently archived, fully archived, or reactivating. Possible values are: `recentlyArchived`, `fullyArchived`, `reactivating`, `unknownFutureValue`. |
29-
25+
| archivalDetails | [siteArchivalDetails][] | Represents whether the site collection is recently archived, fully archived, or reactivating. Possible values are: `recentlyArchived`, `fullyArchived`, `reactivating`, `unknownFutureValue`. To update this property, use the [site: archive](../api/site-archive.md) or [site: unarchive](../api/site-unarchive.md) APIs. |
26+
| dataLocationCode | string | The geographic region code for where this site collection resides. Only present for multi-geo tenants. Read-only. |
27+
| hostname | string | The hostname for the site collection. Read-only. |
28+
| root | [root][] | If present, indicates that this is a root site collection in SharePoint. Read-only. |
3029

3130
## Relationships
3231
None.

api-reference/beta/toc/sites-and-lists/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ items:
3232
href: ../../api/site-list-subsites.md
3333
- name: Search for sites
3434
href: ../../api/site-search.md
35+
- name: Archive site
36+
href: ../../api/site-archive.md
37+
- name: Unarchive site
38+
href: ../../api/site-unarchive.md
3539
- name: Follow site
3640
href: ../../api/site-follow.md
3741
- name: Unfollow site

changelog/Microsoft.SharePoint.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
{
22
"changelog": [
3+
{
4+
"ChangeList": [
5+
{
6+
"Id": "a3f702b8-6939-4208-a6d3-6ec841bc13b3",
7+
"ApiChange": "Method",
8+
"ChangedApiName": "archive",
9+
"ChangeType": "Addition",
10+
"Description": "Added the [site: archive](https://learn.microsoft.com/en-us/graph/api/site-archive?view=graph-rest-beta) method to the [site](https://learn.microsoft.com/en-us/graph/api/resources/site?view=graph-rest-beta) resource.",
11+
"Target": "site"
12+
},
13+
{
14+
"Id": "a3f702b8-6939-4208-a6d3-6ec841bc13b3",
15+
"ApiChange": "Method",
16+
"ChangedApiName": "unarchive",
17+
"ChangeType": "Addition",
18+
"Description": "Added the [site: unarchive](https://learn.microsoft.com/en-us/graph/api/site-unarchive?view=graph-rest-beta) method to the [site](https://learn.microsoft.com/en-us/graph/api/resources/site?view=graph-rest-beta) resource.",
19+
"Target": "site"
20+
}
21+
],
22+
"Id": "a3f702b8-6939-4208-a6d3-6ec841bc13b3",
23+
"Cloud": "Prod",
24+
"Version": "beta",
25+
"CreatedDateTime": "2025-01-10T15:52:02.6103372Z",
26+
"WorkloadArea": "Sites and lists",
27+
"SubArea": ""
28+
},
329
{
430
"ChangeList": [
531
{
@@ -301,4 +327,4 @@
301327
"SubArea": ""
302328
}
303329
]
304-
}
330+
}

concepts/whats-new-overview.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ Enabled the **description**, **displayName**, and **severity** properties as sup
108108

109109
### Sites and lists
110110

111-
Create and manage a [news link page](/graph/api/resources/newslinkpage?view=graph-rest-beta&preserve-view=true) in SharePoint.
111+
- Create and manage a [news link page](/graph/api/resources/newslinkpage?view=graph-rest-beta&preserve-view=true) in SharePoint.
112+
- [Archive](/graph/api/site-archive?view=graph-rest-beta&preserve-view=true) or [unarchive](/graph/api/site-unarchive?view=graph-rest-beta&preserve-view=true) a SharePoint site.
112113

113114
### Teamwork and communications | Calls and online meetings
114115

0 commit comments

Comments
 (0)