# Sites

## List sites

 - [GET /api/v1/sites](https://api-docs.sitecore.com/sai/sites-api/sites/listsites.md): Fetches the list of sites in the environment, with associated details.

## Create a site

 - [POST /api/v1/sites](https://api-docs.sitecore.com/sai/sites-api/sites/createsite.md): Creates a site for the environment.
            Sites are created using  site templates. Every site belongs to a site collection. You can either create a site inside an existing collection or create a new one.
            It is also possible to create a site by duplicating a site.

## Retrieve a site

 - [GET /api/v1/sites/{siteId}](https://api-docs.sitecore.com/sai/sites-api/sites/retrievesite.md): Fetches information about a site.

## Update a site

 - [PATCH /api/v1/sites/{siteId}](https://api-docs.sitecore.com/sai/sites-api/sites/updatesite.md): Updates various parameters of a site. To change the name of a site, see rename a site.

## Delete a site

 - [DELETE /api/v1/sites/{siteId}](https://api-docs.sitecore.com/sai/sites-api/sites/deletesite.md): Deletes a site, including its pages, settings, media files, data sources, presentation elements, dictionaries, components, variants, and page designs. Everyone in the environment will lose access to the deleted site.
           Deleting a site affects related websites in the collection:
           • If the site shares items with other sites, this might result in broken links.
           • Items that are cloned to other sites are turned into regular items, and the links removed.

## Duplicate a site

 - [POST /api/v1/sites/{siteId}/copy](https://api-docs.sitecore.com/sai/sites-api/sites/copysite.md): You can create a site by duplicating an existing one. When you duplicate a site, its content items (such as pages and images, folder structure, and links) are copied. Most of the settings are also copied, but you can change those later. The new site's path parameters and response body schema will be the same as the original site.

## Rename a site

 - [POST /api/v1/sites/{siteId}/rename](https://api-docs.sitecore.com/sai/sites-api/sites/renamesite.md): Changes the system name of a site.

## Sort sites

 - [POST /api/v1/sites/sort](https://api-docs.sitecore.com/sai/sites-api/sites/sortsites.md): By assigning a sort value to site IDs, you can use this endpoint to apply an order by which sites are sorted in the Sites user interface and in Content Editor. The lower the sort value, the higher the site appears in the interface.

## Validate site name

 - [POST /api/v1/sites/name/validate](https://api-docs.sitecore.com/sai/sites-api/sites/validatesitename.md): Validates a site name to ensure it meets the required criteria. The validations applied to the site name:
- Is a string and can't be null.
- Is unique.
- The length of the name is a maximum of 50 characters.
- Can't start or end with a space.
- Can't start with a dash.
- Can include Latin alphanumeric characters, spaces and dashes.

## List sites that use an analytics identifier

 - [GET /api/v1/sites/analytics-identifiers/{analyticsIdentifier}](https://api-docs.sitecore.com/sai/sites-api/sites/listtrackedsites.md): Fetches a list of sites that use an analytics identifier.

## Unassign analytics identifiers from sites

 - [POST /api/v1/sites/analytics-identifiers/{analyticsIdentifier}/detach](https://api-docs.sitecore.com/sai/sites-api/sites/detachanalyticsidentifier.md): Removes the analytics identifiers from one or more sites.

## Retrieve the hierarchy of a site's main page

 - [GET /api/v1/sites/{siteId}/hierarchy](https://api-docs.sitecore.com/sai/sites-api/sites/retrievesitehierarchy.md): Fetches hierarchy information about the main page of a site, including its children, ancestors, and siblings.

## Retrieve the hierarchy of a page

 - [GET /api/v1/sites/{siteId}/hierarchy/{pageId}](https://api-docs.sitecore.com/sai/sites-api/sites/retrievepagehierarchy.md): Fetches hierarchy information about a page, including its children, ancestors, and siblings.

## List ancestors for a page

 - [GET /api/v1/sites/{siteId}/hierarchy/{pageId}/ancestors](https://api-docs.sitecore.com/sai/sites-api/sites/listpageancestors.md): Fetches information about the ancestors of a page.

## List children for a page

 - [GET /api/v1/sites/{siteId}/hierarchy/{pageId}/children](https://api-docs.sitecore.com/sai/sites-api/sites/listpagechildren.md): Fetches information about the children of a page.

## List hosts for a site

 - [GET /api/v1/sites/{siteId}/hosts](https://api-docs.sitecore.com/sai/sites-api/sites/listhosts.md): Retrieves the list of hosts for a site.

## Create a site host

 - [POST /api/v1/sites/{siteId}/hosts](https://api-docs.sitecore.com/sai/sites-api/sites/createhost.md): Creates a host for a site.

## Retrieve a site host by host ID

 - [GET /api/v1/sites/{siteId}/hosts/{hostId}](https://api-docs.sitecore.com/sai/sites-api/sites/retrievehost.md): Fetches details about a site host.

## Update a host by host ID

 - [PATCH /api/v1/sites/{siteId}/hosts/{hostId}](https://api-docs.sitecore.com/sai/sites-api/sites/updatehost.md): Modifies the properties of a host.

## Delete a site host by host ID

 - [DELETE /api/v1/sites/{siteId}/hosts/{hostId}](https://api-docs.sitecore.com/sai/sites-api/sites/deletehost.md): Deletes a site using a hostID. Deletes a site, including its pages, settings, media files, data sources, presentation elements, dictionaries, components, variants, and page designs. Everyone in the environment will lose access to the deleted site.

## List editing hosts for a site

 - [GET /api/v1/sites/{siteId}/editinghosts](https://api-docs.sitecore.com/sai/sites-api/sites/geteditinghosts.md): Fetches a list of editing hosts for a site.

## List site templates

 - [GET /api/v1/sites/templates](https://api-docs.sitecore.com/sai/sites-api/sites/listsitetemplates.md): Gets the site templates available in the environment that can be used for creating sites. Learn more about site templates.

## Upload a thumbnail for a site

 - [POST /api/v1/sites/{siteId}/upload-thumbnail](https://api-docs.sitecore.com/sai/sites-api/sites/uploadsitethumbnail.md): Uploads an image to be used as thumbnail for a site when it is displayed in the SitecoreAI Sites application.

## List localization statistics for a site

 - [GET /api/v1/sites/{siteId}/statistics/localization](https://api-docs.sitecore.com/sai/sites-api/sites/retrievelocalizationstatistics.md): Fetches localization statistics for a site, including the number of pages in each locale.

## Retrieve the sitemap configuration

 - [GET /api/v1/sites/{siteId}/configuration/sitemap](https://api-docs.sitecore.com/sai/sites-api/sites/retrievesitemapconfiguration.md): Fetches a sitemap configuration.

## Update a sitemap configuration

 - [PATCH /api/v1/sites/{siteId}/configuration/sitemap](https://api-docs.sitecore.com/sai/sites-api/sites/updatesitemapconfiguration.md): Updates a sitemap configuration.

## List workflow statistics for a site

 - [GET /api/v1/sites/{siteId}/statistics/workflow](https://api-docs.sitecore.com/sai/sites-api/sites/retrieveworkflowstatistics.md): Fetches the workflows defined for a site, their states, and the number of pages in each state.

## Translate a site

 - [POST /api/v1/sites/{siteId}/translate](https://api-docs.sitecore.com/sai/sites-api/sites/translatesite.md): Creates new translated versions of all items for a specific site using the Stream API.

## List rendering hosts for a site (deprecated)

 - [GET /api/v1/sites/{siteId}/renderinghosts](https://api-docs.sitecore.com/sai/sites-api/sites/getrenderinghosts.md): Deprecated: Use GetEditingHosts endpoint instead.

Fetches a list of rendering hosts for a site.

