https://manage.kontent.ai/v2/projects/{environment_id}/collectionshttps://manage.kontent.ai/v2/projects/{environment_id}/collectionsenvironment_idcollections[]environment_idThe operations you want to perform on the collections.
collections[]last_modifiedopvaluenamecodenamelast_modifiedexternal_idafteridcodenameexternal_idbeforeidcodenameexternal_idnull if the collections were not changed yet.addInto to add new collectionsmove to change collections' orderremove to delete collectionsreplace to update collections (e.g., change collection's name)null if the collections were not changed yet.name.codename property must meet the conditions defined in rules for codenames.codename property must meet the conditions defined in rules for codenames.idnamecodenameexternal_idexternal_id property must not contain the following characters: /, ., ;.external_id property must not contain the following characters: /, ., ;.name.{
"collections": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Default",
"codename": "default"
},
{
"id": "56ddd0f8-d3a3-5e36-9ccb-80dbe77aed23",
"external_id": "second_external_id",
"name": "Second collection",
"codename": "second_collection"
}
],
"last_modified": "2021-03-04T08:16:24.3620957Z"
}after and before properties are mutually exclusive. If neither is specified, the object is added at the end.after and before properties are mutually exclusive. If neither is specified, the object is added at the end.{
"id": "af678509-1c20-5c9e-868c-b84146000a2d",
"name": "US branch",
"codename": "us_branch",
"external_id": "my-collection-id"
}// 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.ListCollectionsAsync();
{
"collections": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Default",
"codename": "default"
},
{
"id": "56ddd0f8-d3a3-5e36-9ccb-80dbe77aed23",
"external_id": "second_external_id",
"name": "Second collection",
"codename": "second_collection"
}
],
"last_modified": "2021-03-04T08:16:24.3620957Z"
}[
{
"op": "addInto",
"value": {
"external_id": "another-collection",
"name": "Another collection",
"codename": "another_collection_codename"
},
"after": {
"codename": "second_collection"
}
},
{
"op": "move",
"reference": {
"codename": "important_collection"
},
"before": {
"codename": "first_collection"
}
},
{
"op": "remove",
"reference": {
"codename": "extra_collection"
}
},
{
"op": "replace",
"property_name": "name",
"value": "A new name",
"reference": {
"codename": "second_collection"
}
}
]