https://manage.kontent.ai/v2/projects/{environment_id}/preview-configurationhttps://manage.kontent.ai/v2/projects/{environment_id}/preview-configurationhttps://manage.kontent.ai/v2/projects/{environment_id}/live-preview-configurationhttps://manage.kontent.ai/v2/projects/{environment_id}/live-preview-configurationenvironment_idspace_domains[]environment_idThe preview configuration you want to use.
space_domains[]space_domains[]environment_idstatusenvironment_idSpecify if you want to enable or disable the live Preview feature.
statusstatuspreview_url_patterns[]preview_url_patterns[]preview_url_patterns[]space_domains[]preview_url_patterns[]{
"space_domains": [
{
"space": {
"id": "fb2c6c2b-fb79-4d1b-856a-b59762e304b0"
},
"domain": "www.mysite1.com"
},
{
"space": {
"id": "24dace50-3cf6-4378-8704-453af9cdb60c"
},
"domain": "www.mysite2.com"
}
],
"preview_url_patterns": [
{
"content_type": {
"id": "cf75f19d-6ed4-4820-a541-cde50dd79054"
},
"url_patterns": [
{
"space": {
"id": "24dace50-3cf6-4378-8704-453af9cdb60c"
},
"url_pattern": "https://{Space}/{Lang}/articles/history/"
}
]
},
{
"content_type": {
"id": "f21f6c3b-f63e-4aa1-866f-55fd85ad262e"
},
"url_patterns": [
{
"space": null,
"url_pattern": "https://www.mysite1.com/{Lang}/articles/"
}
]
}
]
}{
"space_domains": [
{
"space": {
"id": "fb2c6c2b-fb79-4d1b-856a-b59762e304b0"
},
"domain": "www.mysite1.com"
},
{
"space": {
"id": "24dace50-3cf6-4378-8704-453af9cdb60c"
},
"domain": "www.mysite2.com"
}
],
"preview_url_patterns": [
{
"content_type": {
"id": "cf75f19d-6ed4-4820-a541-cde50dd79054"
},
"url_patterns": [
{
"space": {
"id": "24dace50-3cf6-4378-8704-453af9cdb60c"
},
"url_pattern": "https://{Space}/{Lang}/articles/history/"
}
]
},
{
"content_type": {
"id": "f21f6c3b-f63e-4aa1-866f-55fd85ad262e"
},
"url_patterns": [
{
"space": null,
"url_pattern": "https://www.mysite1.com/{Lang}/articles/"
}
]
}
]
}curl --request GET \
--url https://manage.kontent.ai/v2/projects/KONTENT_AI_ENVIRONMENT_ID/live-preview-configuration \
--header 'Authorization: Bearer KONTENT_AI_MANAGEMENT_API_KEY' \
--header 'Content-type: application/json'
curl --request PUT \
--url https://manage.kontent.ai/v2/projects/KONTENT_AI_ENVIRONMENT_ID/live-preview-configuration \
--header 'Authorization: Bearer KONTENT_AI_MANAGEMENT_API_KEY' \
--header 'Content-type: application/json'
--data '
{
"status": "enabled"
}'
{
"space_domains": [
{
"space": {
"id": "fb2c6c2b-fb79-4d1b-856a-b59762e304b0"
},
"domain": "www.mysite1.com"
},
{
"space": {
"id": "24dace50-3cf6-4378-8704-453af9cdb60c"
},
"domain": "www.mysite2.com"
}
],
"preview_url_patterns": [
{
"content_type": {
"id": "cf75f19d-6ed4-4820-a541-cde50dd79054"
},
"url_patterns": [
{
"space": {
"id": "24dace50-3cf6-4378-8704-453af9cdb60c"
},
"url_pattern": "https://{Space}/{Lang}/articles/history/"
}
]
},
{
"content_type": {
"id": "f21f6c3b-f63e-4aa1-866f-55fd85ad262e"
},
"url_patterns": [
{
"space": null,
"url_pattern": "https://www.mysite1.com/{Lang}/articles/"
}
]
}
]
}// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
using Kontent.Ai.Management;
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "KONTENT_AI_MANAGEMENT_API_KEY",
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});
var response = await client.GetPreviewConfigurationAsync()
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
using Kontent.Ai.Management;
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "KONTENT_AI_MANAGEMENT_API_KEY",
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});
var response = await client.UpdatePreviewConfigurationAsync(new PreviewConfigurationModel()
{
SpaceDomains = new List<SpaceDomainModel>
{
new()
{
Domain = "www.mysite.com",
Space = Reference.ByCodename("my_space")
}
},
PreviewUrlPatterns = new List<TypePreviewUrlPatternModel>
{
new()
{
ContentType = Reference.ByCodename("article"),
UrlPatterns = new List<PreviewUrlPatternModel>
{
new()
{
Space = null,
UrlPattern = "https://www.globalsite.com/{URLSlug}"
},
new()
{
Space = Reference.ByCodename("my_space"),
UrlPattern = "https://{Space}/{URLSlug}/test"
},
}
}
}
}
);
{
"status": "enabled"
}{
"status": "enabled"
}