---
title: "Archive a site"
method: PUT
path: "/api/v1/site/{siteId}/_archive"
tags: ["Site"]
---

# Archive a site

`PUT /api/v1/site/{siteId}/_archive`

Archives the specified site. The default site cannot be archived. If the site is locked, it will be unlocked before archiving. The 'siteId' parameter is the site identifier (also known as 'hostId' or 'host' in other parts of the API).

## Path parameters

- `siteId` string, required

## Response `200`

Site archived successfully

- ResponseEntitySiteView
  - `errors` ErrorEntity[]
    - `errorCode` string
    - `message` string
    - `fieldName` string
  - `entity` object
  - `messages` MessageEntity[]
    - `message` string
  - `i18nMessagesMap` object
  - `permissions` string[]
  - `pagination` Pagination
    - `currentPage` integer
    - `perPage` integer
    - `totalEntries` integer

## Other responses

- `400` — Cannot archive the default site, or site does not exist
- `401` — Unauthorized access
- `403` — User does not have permission to archive sites
- `404` — Site not found

---

[API](https://skmtc.dev/jostens/apis/dotcms-rest-api.md) · [All operations](https://skmtc.dev/jostens/apis/dotcms-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/jostens/dotcms-rest-api/revisions/a088fe9f515c/schema)
