Update a custom hostname

Request

Partially updates a custom hostname by replacing the defaultSiteId, defaultContextId, or both, as needed.

The hostname itself cannot be updated after the custom hostname has been created and registered. As a workaround, you must delete the existing custom hostname and create a new one to change the hostname.

Security
BearerAuth
Path
hostnamestringrequired

The specific custom hostname you want to interact with.

Example:sitecore-api-preview.example.com
Bodyapplication/json
defaultSiteIdstring

The default site ID associated with the custom hostname.

If you don't specify a value for defaultSiteId, you'll need to manually include it in the query parameter or body with each request to the custom hostname to ensure it is resolved correctly.

Example:"playsummit"
defaultContextIdstring

The default context ID associated with the custom hostname.

If you don't specify a value for defaultContextId, you'll need to manually include it in the query parameter or header with each request to the custom hostname to ensure it is resolved correctly.

Example:"3BTl4aU7w12A5M76m9p8IA"
curl -i -X PATCH \
  https://edge-platform-admin-api.sitecorecloud.io/api/admin/v1/hostnames/sitecore-api-preview.example.com \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "defaultSiteId": "playsummit",
    "defaultContextId": "3BTl4aU7w12A5M76m9p8IA"
  }'

Responses

Accepted

Bodyapplication/json
defaultSiteIdstring

The default site ID associated with the custom hostname.

If you don't specify a value for defaultSiteId, you'll need to manually include it in the query parameter or body with each request to the custom hostname to ensure it is resolved correctly.

Example:"playsummit"
defaultContextIdstring

The default context ID associated with the custom hostname.

If you don't specify a value for defaultContextId, you'll need to manually include it in the query parameter or header with each request to the custom hostname to ensure it is resolved correctly.

Example:"3BTl4aU7w12A5M76m9p8IA"
Response
{ "defaultSiteId": "playsummit", "defaultContextId": "3BTl4aU7w12A5M76m9p8IA" }