https://manage.kontent.ai/v2/projects/{environment_id}/spaceshttps://manage.kontent.ai/v2/projects/{environment_id}/spaces/{space_identifier}https://manage.kontent.ai/v2/projects/{environment_id}/spaceshttps://manage.kontent.ai/v2/projects/{environment_id}/spaces/{space_identifier}https://manage.kontent.ai/v2/projects/{environment_id}/spaces/{space_identifier}environment_idThe space to be added.
namecodenameweb_spotlight_root_itemidnamecodenameweb_spotlight_root_itemenvironment_idspace_identifieridnamecodenameweb_spotlight_root_itemenvironment_ididnamecodenameenvironment_idspace_identifierSpecifies the operations to perform on the specified space.
opproperty_nameidnamecodenameweb_spotlight_root_itemenvironment_idspace_identifiercollections[]collections[]collections[]web_spotlight_root_itemidcollections[]idvaluestringcollections[]6291c693-f6e4-4a6b-ac67-5c31c32f9388) or codename (eg., codename/space_1)6291c693-f6e4-4a6b-ac67-5c31c32f9388) or codename (eg., codename/space_1)6291c693-f6e4-4a6b-ac67-5c31c32f9388) or codename (eg., codename/space_1)value property depends on the value of the property_name property.property_name of name or codename, the value property is a string.property_name of web_spotlight_root_item, the value property is a Reference object.property_namecollectionsvalueidnamecodenameweb_spotlight_root_itemcollections[]{
"": {
"id": "6291c693-f6e4-4a6b-ac67-5c31c32f9388",
"name": "Space 1",
"codename": "space_1",
"web_spotlight_root_item": {
"id": "3f367e4f-75b7-4b48-be3b-1136bbaf1f53"
},
"collections": [
{
"id": "511d4c6e-ff91-453e-9850-774867780ea3"
},
{
"id": "faa44123-a826-4d78-9d2d-2fde10fb0d56"
},
{
"id": "3c70b0cc-d9d8-4c9d-a01f-47a2d677fdd5"
}
]
}
}{
"request_id": "50e4b06809cbde0b",
"error_code": 121,
"message": "The requested space '{id: 6291c693-f6e4-4a6b-ac67-5c31c32f9388}' was not found."
}{
"id": "6291c693-f6e4-4a6b-ac67-5c31c32f9388",
"name": "Space 1",
"codename": "space_1",
"web_spotlight_root_item": {
"id": "3f367e4f-75b7-4b48-be3b-1136bbaf1f53",
"codename": "object_codename",
"external_id": "your-own-custom-identifier"
},
"collections": [
{
"id": "511d4c6e-ff91-453e-9850-774867780ea3"
},
{
"id": "faa44123-a826-4d78-9d2d-2fde10fb0d56"
},
{
"id": "3c70b0cc-d9d8-4c9d-a01f-47a2d677fdd5"
}
]
}{
"id": "6291c693-f6e4-4a6b-ac67-5c31c32f9388",
"name": "Space 1",
"codename": "space_1",
"web_spotlight_root_item": {
"id": "3f367e4f-75b7-4b48-be3b-1136bbaf1f53"
},
"collections": [
{
"id": "511d4c6e-ff91-453e-9850-774867780ea3"
},
{
"id": "faa44123-a826-4d78-9d2d-2fde10fb0d56"
},
{
"id": "3c70b0cc-d9d8-4c9d-a01f-47a2d677fdd5"
}
]
}{
"id": "6291c693-f6e4-4a6b-ac67-5c31c32f9388",
"name": "Space 1",
"codename": "space_1",
"web_spotlight_root_item": {
"id": "3f367e4f-75b7-4b48-be3b-1136bbaf1f53"
},
"collections": [
{
"id": "511d4c6e-ff91-453e-9850-774867780ea3"
},
{
"id": "faa44123-a826-4d78-9d2d-2fde10fb0d56"
},
{
"id": "3c70b0cc-d9d8-4c9d-a01f-47a2d677fdd5"
}
]
}{
"id": "6291c693-f6e4-4a6b-ac67-5c31c32f9388",
"name": "Space 1",
"codename": "space_1",
"web_spotlight_root_item": {
"id": "3f367e4f-75b7-4b48-be3b-1136bbaf1f53"
},
"collections": [
{
"id": "511d4c6e-ff91-453e-9850-774867780ea3"
},
{
"id": "faa44123-a826-4d78-9d2d-2fde10fb0d56"
},
{
"id": "3c70b0cc-d9d8-4c9d-a01f-47a2d677fdd5"
}
]
}// 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
.addSpace()
.withData({
name: 'my new_space',
codename: 'my_new_space',
})
.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
.viewSpace()
.bySpaceCodename('my_new_space')
.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.listSpaces().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
.deleteSpace()
.bySpaceCodename('my_new_space')
.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',
});
client
.modifySpace()
.bySpaceCodename('my_new_space')
.withData([
{
op: 'replace',
property_name: 'codename',
value: 'new_space_codename',
},
{
op: 'replace',
property_name: 'name',
value: 'new_space_name',
},
])
.toPromise();