Skip to main content
View as Markdown

Category CRUD - Content Management

Category CRUD​

Create a Category​

POST /service/category/action/add
curl -X POST "$KALTURA_SERVICE_URL/service/category/action/add" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "category[objectType]=KalturaCategory" \
-d "category[name]=Training" \
-d "category[description]=Training materials" \
-d "category[tags]=training,onboarding"
ParameterTypeRequiredDescription
category[objectType]stringYesAlways KalturaCategory
category[name]stringYesCategory display name
category[parentId]integerNoParent category ID (omit or 0 for root-level)
category[description]stringNoDescription text
category[tags]stringNoComma-separated tags
category[referenceId]stringNoExternal reference ID
category[privacy]integerNoPrivacy level (1=ALL, 2=AUTHENTICATED, 3=MEMBERS_ONLY)
category[privacyContext]stringNoPrivacy context label for entitlement
category[appearInList]integerNoVisibility in listings (1=PARTNER_ONLY, 3=CATEGORY_MEMBERS_ONLY)
category[contributionPolicy]integerNoWho can assign content (1=ALL, 2=MEMBERS_WITH_CONTRIBUTION_PERMISSION)
category[moderation]integerNo1 to require entry approval before activation
category[userJoinPolicy]integerNoHow users join (1=AUTO, 2=REQUEST, 3=NOT_ALLOWED)

Response:

{
"id": 12345,
"name": "Training",
"fullName": "Training",
"fullIds": "12345",
"parentId": 0,
"depth": 0,
"status": 2,
"privacy": 1,
"entriesCount": 0,
"directEntriesCount": 0,
"directSubCategoriesCount": 0,
"membersCount": 0,
"description": "Training materials",
"tags": "training,onboarding",
"createdAt": 1718467200,
"updatedAt": 1718467200,
"objectType": "KalturaCategory"
}

Creating a Child Category​

curl -X POST "$KALTURA_SERVICE_URL/service/category/action/add" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "category[objectType]=KalturaCategory" \
-d "category[name]=Onboarding" \
-d "category[parentId]=$PARENT_CATEGORY_ID" \
-d "category[description]=Onboarding materials"

The response includes the computed fullName (e.g., "Training>Onboarding") and fullIds (e.g., "12345>67890").

Get a Category​

curl -X POST "$KALTURA_SERVICE_URL/service/category/action/get" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$CATEGORY_ID"

Returns the full KalturaCategory object. Returns CATEGORY_NOT_FOUND if the ID is invalid.

List Categories​

curl -X POST "$KALTURA_SERVICE_URL/service/category/action/list" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "filter[objectType]=KalturaCategoryFilter" \
-d "filter[parentIdEqual]=0" \
-d "filter[orderBy]=-createdAt" \
-d "pager[pageSize]=50" \
-d "pager[pageIndex]=1"

Filter fields (KalturaCategoryFilter):

FieldDescription
idEqualExact category ID
idInComma-separated category IDs
parentIdEqualFilter by parent category (0 for root categories)
parentIdInComma-separated parent IDs
nameEqualExact category name match (case-sensitive, returns first match when duplicates exist)
fullNameStartsWithInFull path prefix match (e.g., "Training>")
ancestorIdInCategories under any of these ancestor IDs
freeTextFree-text search across name, description, tags
tagsLikeTags match (OR)
referenceIdEqualExact reference ID match
statusEqualFilter by status (1=UPDATING, 2=ACTIVE, 3=DELETED)
privacyEqualFilter by privacy level
privacyInComma-separated privacy levels
orderBy+createdAt, -createdAt, +updatedAt, -updatedAt, +name, -name, +depth, -depth

Response:

{
"totalCount": 5,
"objects": [
{
"id": 12345,
"name": "Training",
"fullName": "Training",
"parentId": 0,
"status": 2,
"objectType": "KalturaCategory"
}
],
"objectType": "KalturaCategoryListResponse"
}

Update a Category​

curl -X POST "$KALTURA_SERVICE_URL/service/category/action/update" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$CATEGORY_ID" \
-d "category[objectType]=KalturaCategory" \
-d "category[description]=Updated training materials" \
-d "category[tags]=training,updated"

Fields not included remain unchanged. Response: Full updated KalturaCategory object.

Delete a Category​

curl -X POST "$KALTURA_SERVICE_URL/service/category/action/delete" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$CATEGORY_ID"

Deletes the category. Child categories are also deleted. Entries assigned to the category are unlinked (not deleted).

ParameterTypeRequiredDescription
idintegerYesCategory ID to delete
moveEntriesToParentCategoryintegerNo1 to move entries to parent before deleting

Clone a Category Branch​

POST /service/category/action/clone
curl -X POST "$KALTURA_SERVICE_URL/service/category/action/clone" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$CATEGORY_ID" \
-d "cloneOptions[objectType]=KalturaCategoryClone"

Duplicates the category and its entire subtree under the same parent as the source. Cloned categories receive new IDs while preserving hierarchy structure, names, and settings.