https://manage.kontent.ai/v2/projects/{environment_id}/clone-environmenthttps://manage.kontent.ai/v2/projects/{environment_id}/environment-cloning-statehttps://manage.kontent.ai/v2/projects/{environment_id}https://manage.kontent.ai/v2/projects/{environment_id}/mark-environment-as-productionhttps://manage.kontent.ai/v2/projects/{environment_id}https://manage.kontent.ai/v2/projects/{environment_id}environment_idSpecify the environment's name and the roles that should be active in the new environment.
nameroles_to_activate[]copy_data_optionsidmanagement_api_keysecured_delivery_api_keyenvironment_idcloning_stateenvironment_ididnameenvironmentis_productionenvironment_idSpecify whether you want to enable webhooks.
enable_webhooksenvironment_idSpecify the environment's name.
opvalueidnameenvironmentis_productionenvironment_iddelivery_preview_api_keyroles_to_activate when initiating the cloning.rename_environment.{
"cloning_state": "done"
}{
"request_id": "4c3b488c74c18640",
"error_code": 232,
"message": "The environment 4a8b44fa-785c-00ae-4d5c-029de7428cab is already marked as production."
}{
"request_id": "af1567cb33d85545",
"error_code": 233,
"message": "The production environment can’t be deleted."
}{
"id": "71386f85-cddb-4cb0-aa54-988566feb9a1",
"management_api_key": "ey...",
"secured_delivery_api_key": "ey...",
"delivery_preview_api_key": "ey..."
}{
"id": "8d20758c-d74c-4f59-ae04-ee928c0816b7",
"name": "Sample project",
"environment": "Production",
"is_production": true
}{
"id": "4a8b44fa-785c-00ae-4d5c-029de7428cab",
"name": "Production",
"is_production": true
}// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.cloneEnvironment()
.withData({
name: 'Develop',
roles_to_activate: ['ee483b59-5a24-4010-b277-ae224c34bc71'],
copy_data_options: {
content_items_assets: true,
content_item_version_history: false,
},
})
.toPromise();
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client.getEnvironmentCloningState().toPromise();
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client.environmentInformation().toPromise();
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.markEnvironmentAsProduction()
.withData({
enable_webhooks: false,
})
.toPromise();
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.modifyEnvironment()
.withData([
{
op: 'rename_environment',
value: 'My Little Production',
},
])
.toPromise();
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client.deleteEnvironment().toPromise();