Content Groups
Content groups help you manage your content by grouping content pieces and nesting different groups inside each other. The API gives you full control over them.
Retrieve Content Group
Retrieves details of a single content group, by specified ID.
ID of the content group
Whether to list the entire subtree of the group
curl --request GET \
--url "https://api.vrite.io/content-groups?id={ID}" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Accept: application/json'
const client = createClient({
token: "<API_TOKEN>"
});
const result = await client.contentGroups.get({
id: "d9b18d9c09e366bbe649215e"
});
{
"id": "d9b18d9c09e366bbe649215e",
"name": "string",
"ancestors": [
"0953ab1168879e1e6f001bde"
],
"descendants": [
"4744416c628dce71abc72087"
]
}
List Content Groups
By default, lists all top-level content groups. When an ancestor ID is specified, lists all content groups that are its direct descendants.
ID of the content group to list descendants for
Whether to list the entire subtree of the group
curl --request GET \
--url "https://api.vrite.io/content-groups/list" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Accept: application/json'
const client = createClient({
token: "<API_TOKEN>"
});
const result = await client.contentGroups.list({
// Optional
ancestor: "8bf9f4bf93f700e1a6863d9f"
});
[
{
"id": "73307c760d5998414947f942",
"name": "string",
"ancestors": [
"8bf9f4bf93f700e1a6863d9f"
],
"descendants": [
"ef690a99e9cc09eed46a2419"
]
}
]
Create Content Group
Creates a content group with the specified name, either top-level or nested inside the ancestor specified by ID.
Name of the content group
ID of the content group to be the direct ancestor
ID of the content group
curl --request POST \
--url "https://api.vrite.io/content-groups" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"name": "{NAME}"
}'
const client = createClient({
token: "<API_TOKEN>",
});
const result = await client.contentGroups.create({
name: "test",
// Optional
ancestor: "8bf9f4bf93f700e1a6863d9f",
});
{
"id": "c3d507504db761ab7bcbf25a"
}
Update Content Group
Updates the content group specified by ID. If an ancestor is specified by an ID, the content group will be moved to be nested inside it.
ID of the content group
Name of the content group
ID of the new ancestor for the content group
curl --request PUT \
--url "https://api.vrite.io/content-groups" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "{ID}"
}'
const client = createClient({
token: "<API_TOKEN>",
});
await client.contentGroups.update({
id: "8f30880079d4ec05a3831e8c",
// Optional
name: "string",
// Optional
ancestor: "c153d112c3b6361836ffce76",
});
Delete Content Group
Deletes the content group specified by ID, together with all the content groups and content pieces inside it down to the lowest level.
ID of the content group
curl --request DELETE \
--url "https://api.vrite.io/content-groups?id={ID}" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Accept: application/json'
const client = createClient({
token: "<API_TOKEN>",
});
await client.contentGroups.delete({
id: "8f30880079d4ec05a3831e8c",
});