Update a site

Request

Updates various parameters of a site. To change the name of a site, see rename a site.

Security
Bearer
Path
siteIdstringrequired

The identifier of the site.

Example:497f6eca-6276-4993-bfeb-53cbbbba6f08
Query
environmentIdstring

The identifier of the environment

Example:environmentId=main
Body

Various site configuration properties

displayNamestring or null, [ 0 .. 100 ] characters

The display name for the site. Example value: Skate Park Site

Default:"string"
Example:"Skate Park Site"
descriptionstring or null, [ 0 .. 200 ] characters

The description for the site. Example value: New site for Brand A in English-speaking countries.

Default:"string"
Example:"New site for Brand A in English-speaking countries."
supportedLanguagesArray of strings or null

The list of languages supported by Sitecore. Example value: [ "en-US", "en-CA" ]

Example:
[ "en-US", "en-CA" ]
sharedboolean or null

Whether the site should be marked as shared or not. True - site will be shared. False - site will not be marked as shared. Example value: True

Example:true
errorPagesobject(ErrorPages)

An object containing the site error pages identifiers

sortOrderinteger or null, (int32)

The sort order of the site. Example value: 100

Example:100
brandKitIdstring or null

The identifier of the brand kit associated with this site. Example value: e3f1c5a2-4b6d-4a3e-9f1b-2d3c4b5a6e7f

Example:"e3f1c5a2-4b6d-4a3e-9f1b-2d3c4b5a6e7f"
resetThumbnailboolean or null

Whether the thumbnail should be reset. True - thumbnail will be reset to automatic. False - thumbnail will not be reset. Example value: True

Example:true
editorProfilesArray of strings or null

The list of text editor profiles associated with the site. Example value: [ "e2102e93-424a-4a99-a066-7750dbf41b28", "530f7907-6eec-4b7a-9fcc-98aef2719232" ]

Example:
[ "e2102e93-424a-4a99-a066-7750dbf41b28", "530f7907-6eec-4b7a-9fcc-98aef2719232" ]
targetHostnamestring or nulldeprecated

The target hostname of the site. Example value: skatepark.local

Example:"skatepark.local"
import fetch from 'node-fetch';

async function run() {
  const query = new URLSearchParams({environmentId: 'main'}).toString();

  const siteId = '497f6eca-6276-4993-bfeb-53cbbbba6f08';
  const resp = await fetch(
    `https://xmapps-api.sitecorecloud.io/api/v1/sites/${siteId}?${query}`,
    {
      method: 'PATCH',
      headers: {
        'Content-Type': 'application/json',
        Authorization: 'Bearer <YOUR_TOKEN_HERE>'
      },
      body: JSON.stringify({
        displayName: 'Skate Park Site',
        description: 'New site for Brand A in English-speaking countries.',
        supportedLanguages: ['en-US', 'en-CA'],
        shared: true,
        errorPages: {
          errorPage: 'c5a2fe31-46bd-34ae-91fb-d3c24b5a6e7f',
          notFoundPage: 'a2fc5e31-6b4d-a43e-9f1b-c2d34b5a6e7f'
        },
        sortOrder: 100,
        targetHostname: 'skatepark.local',
        brandKitId: 'e3f1c5a2-4b6d-4a3e-9f1b-2d3c4b5a6e7f',
        resetThumbnail: true,
        editorProfiles: [
          'e2102e93-424a-4a99-a066-7750dbf41b28',
          '530f7907-6eec-4b7a-9fcc-98aef2719232'
        ]
      })
    }
  );

  const data = await resp.json();
  console.log(data);
}

run();

Responses

Success

Bodyapplication/json
idstring or null

The identifier of the site. Example value: 497f6eca-6276-4993-bfeb-53cbbbba6f08

Example:"497f6eca-6276-4993-bfeb-53cbbbba6f08"
namestring or null

The name of the site. Example value: skate-park

Example:"skate-park"
descriptionstring or null

The description of the site. Example value: New site for Brand A in English-speaking countries

Example:"New site for Brand A in English-speaking countries"
displayNamestring or null

The display name of the site. Example value: Skate Park Website

Example:"Skate Park Website"
thumbnailobject(Thumbnail)

The thumbnail response entity.

collectionIdstring or null

The identifier of the collection to which the site belongs. Example value: 5aae1eeaea2440bf96f11f43da82c77b

Example:"5aae1eeaea2440bf96f11f43da82c77b"
createdstring, (date-time)

The date when the site was created. Example value: 2019-08-24T14:15:22Z

Example:"2019-08-24T14:15:22Z"
createdBystring or null

The ID of the user who created the site. Example value: L6kfw52ZVf

Example:"L6kfw52ZVf"
sortOrderinteger or null, (int32)

Sort order of the site. Example value: 100

Example:100
brandKitIdstring or null

The identifier of the brand kit associated with this site. Example value: e3f1c5a2-4b6d-4a3e-9f1b-2d3c4b5a6e7f

Example:"e3f1c5a2-4b6d-4a3e-9f1b-2d3c4b5a6e7f"
permissionsobject(Permissions)

The access rights of the current user to the site.

languagesArray of strings or null

The list of languages in use by the site. Example value: [ "en-US", "en-CA" ]

Example:
[ "en-US", "en-CA" ]
hostsArray of objects or null(Host)

The list of hosts that the site resolves to.

supportedLanguagesArray of strings or null

The list of languages supported by Sitecore. Example value: [ "en-US", "en-CA" ]

Example:
[ "en-US", "en-CA" ]
errorPagesobject(ErrorPages)

An object containing the site error pages identifiers

errorPagesConfigurationobject(ErrorPagesConfiguration)

An object containing the site error pages

settingsobject or null

The settings for the site.

Example:
{ "thumbnailsRootPath": "/sitecore/media library/Project/sample-collection/sample-site", "generateThumbnails": "true" }
propertiesobject or null

The read-only properties of the site.

Example:
{ "SxaSiteTemplate": "{E46F3AF2-39FA-4866-A157-7017C4B2A40C}", "IsSxaSite": "true" }
Response
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "skate-park", "description": "New site for Brand A in English-speaking countries", "displayName": "Skate Park Website", "thumbnail": { "url": "https://xmc-customer-tenant.sitecorecloud.io/-/media/Project/sample-collection/sample-site/System/7/0/B/C/thumbnail_70BC64BDE257400E82BFDB3344797DB7.png", "rootPath": "sitecore/media library/Project/sample-collection/sample-site", "autogenerated": true }, "collectionId": "5aae1eeaea2440bf96f11f43da82c77b", "created": "2019-08-24T14:15:22Z", "createdBy": "L6kfw52ZVf", "sortOrder": 100, "brandKitId": "e3f1c5a2-4b6d-4a3e-9f1b-2d3c4b5a6e7f", "permissions": { "canAdmin": false, "canWrite": false, "canCreate": false, "canDelete": false, "canRename": false, "canRead": false, "canPublish": false, "canDuplicate": false, "canWriteLanguage": false }, "languages": [ "en-US", "en-CA" ], "hosts": [ { … } ], "supportedLanguages": [ "en-US", "en-CA" ], "errorPages": { "errorPage": "c5a2fe31-46bd-34ae-91fb-d3c24b5a6e7f", "notFoundPage": "a2fc5e31-6b4d-a43e-9f1b-c2d34b5a6e7f" }, "errorPagesConfiguration": { "errorPage": { … }, "notFoundPage": { … } }, "settings": { "thumbnailsRootPath": "/sitecore/media library/Project/sample-collection/sample-site", "generateThumbnails": "true" }, "properties": { "SxaSiteTemplate": "{E46F3AF2-39FA-4866-A157-7017C4B2A40C}", "IsSxaSite": "true" } }