Skip to main content
View as Markdown

Metadata Profiles (Schemas) - Content Management

Metadata Profiles (Schemas)​

A KalturaMetadataProfile defines a schema (XSD) that describes the structure of custom metadata. You create a profile once, then attach metadata instances conforming to that schema to individual objects (entries, categories, users, etc.).

KalturaMetadataProfile Object​

FieldTypeDescription
idintegerAuto-generated profile ID (read-only)
partnerIdintegerPartner ID (read-only)
namestringDisplay name
systemNamestringSystem-level identifier (machine-friendly, use for stable lookups)
descriptionstringProfile description
statusinteger1 = ACTIVE, 2 = DEPRECATED, 3 = TRANSFORMING
metadataObjectTypeintegerObject type this profile applies to (see 4.2)
versionintegerProfile version, incremented on XSD changes (read-only, filterable)
xsdstringThe XSD schema definition (read-only on get, set via add/update)
xsltstringXSLT applied on every metadata add/update (read-only, set via updateTransformationFromFile)
createModeinteger1 = API, 2 = KMC, 3 = APP. KMC hides API-created profiles by default.
disableReIndexingbooleanWhen true, prevents re-indexing of related objects on metadata changes
createdAtintegerUnix timestamp (read-only)
updatedAtintegerUnix timestamp (read-only)
objectTypestringAlways "KalturaMetadataProfile" (read-only)

Metadata Object Types​

ValueNameDescription
1ENTRYMedia entries
2CATEGORYCategories
3USERUsers
4PARTNERPartner-level (account-wide configuration)
5DYNAMIC_OBJECTDynamic objects
6USER_ENTRYPer-user-per-entry records (quiz answers, watch progress)

Profile Status Values​

ValueNameDescription
1ACTIVEProfile is active and can be used
2DEPRECATEDProfile is deprecated
3TRANSFORMINGProfile XSD update in progress, re-validating existing metadata

Create Profile (Inline XSD)​

POST /service/metadata_metadataProfile/action/add
curl -X POST "$KALTURA_SERVICE_URL/service/metadata_metadataProfile/action/add" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "metadataProfile[objectType]=KalturaMetadataProfile" \
-d "metadataProfile[name]=Content Classification" \
-d "metadataProfile[systemName]=content_classification" \
-d "metadataProfile[description]=Classify content by department and priority" \
-d "metadataProfile[metadataObjectType]=1" \
--data-urlencode 'xsdData=<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Department" minOccurs="0" maxOccurs="1">
<xsd:annotation><xsd:appinfo>
<label>Department</label>
<key>department</key>
<searchable>true</searchable>
<description>Owning department</description>
</xsd:appinfo></xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="listType">
<xsd:enumeration value="Engineering"/>
<xsd:enumeration value="Marketing"/>
<xsd:enumeration value="Sales"/>
<xsd:enumeration value="Support"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Project" type="textType" minOccurs="0" maxOccurs="1">
<xsd:annotation><xsd:appinfo>
<label>Project Name</label>
<key>project</key>
<searchable>true</searchable>
</xsd:appinfo></xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="textType">
<xsd:simpleContent>
<xsd:extension base="xsd:string"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="dateType">
<xsd:simpleContent>
<xsd:extension base="xsd:long"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="objectType">
<xsd:simpleContent>
<xsd:extension base="xsd:string"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="listType">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
</xsd:schema>'
ParameterTypeRequiredDescription
metadataProfile[objectType]stringYesAlways KalturaMetadataProfile
metadataProfile[name]stringYesDisplay name for the profile
metadataProfile[systemName]stringNoMachine-friendly identifier for stable lookups
metadataProfile[description]stringNoDescription
metadataProfile[metadataObjectType]integerYes1=ENTRY, 2=CATEGORY, 3=USER, 4=PARTNER, 5=DYNAMIC_OBJECT, 6=USER_ENTRY
xsdDatastringYesXSD schema definition (inline, URL-encoded)

Response: Full KalturaMetadataProfile object with generated id, version=1, and status=1 (ACTIVE).

Create Profile (File Upload)​

curl -X POST "$KALTURA_SERVICE_URL/service/metadata_metadataProfile/action/addFromFile" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "metadataProfile[objectType]=KalturaMetadataProfile" \
-d "metadataProfile[name]=Content Classification" \
-d "metadataProfile[systemName]=content_classification" \
-d "metadataProfile[metadataObjectType]=1" \
-F "xsdFile=@schema.xsd"
ParameterTypeRequiredDescription
metadataProfile[objectType]stringYesAlways KalturaMetadataProfile
metadataProfile[name]stringYesDisplay name for the profile
metadataProfile[systemName]stringNoMachine-friendly identifier for stable lookups
metadataProfile[metadataObjectType]integerYes1=ENTRY, 2=CATEGORY, 3=USER, 4=PARTNER, 5=DYNAMIC_OBJECT, 6=USER_ENTRY
xsdFilefileYesXSD schema file upload (multipart form field)

Same as add, but the XSD is uploaded as a file instead of inline.

Response: Full KalturaMetadataProfile object with generated id, version=1, and status=1 (ACTIVE).

Get Profile​

curl -X POST "$KALTURA_SERVICE_URL/service/metadata_metadataProfile/action/get" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$PROFILE_ID"
ParameterTypeRequiredDescription
idintegerYesProfile ID to retrieve

Returns the full KalturaMetadataProfile object including the XSD content. Returns METADATA_PROFILE_NOT_FOUND if the profile does not exist.

Response:

{
"id": 12345,
"partnerId": 123456,
"name": "Content Classification",
"systemName": "content_classification",
"description": "Classify content by department and priority",
"status": 1,
"metadataObjectType": 1,
"version": 1,
"createMode": 1,
"xsd": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><xsd:schema ...>...</xsd:schema>",
"createdAt": 1718409600,
"updatedAt": 1718409600,
"objectType": "KalturaMetadataProfile"
}

List Profiles​

curl -X POST "$KALTURA_SERVICE_URL/service/metadata_metadataProfile/action/list" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "filter[objectType]=KalturaMetadataProfileFilter" \
-d "filter[systemNameEqual]=content_classification" \
-d "filter[statusEqual]=1" \
-d "filter[orderBy]=-createdAt" \
-d "pager[pageSize]=50"
ParameterTypeRequiredDescription
filter[objectType]stringYesAlways KalturaMetadataProfileFilter
filter[...]variousNoFilter fields (see table below)
pager[pageSize]integerNoResults per page (default 30, max 500)
pager[pageIndex]integerNoPage number, 1-based (default 1)

Filter fields (KalturaMetadataProfileFilter):

FieldDescription
idEqual / idInExact profile ID or comma-separated IDs
nameEqualExact name match
systemNameEqual / systemNameInExact system name or comma-separated system names
metadataObjectTypeEqual / metadataObjectTypeInFilter by object type (1=ENTRY, etc.)
statusEqual / statusInFilter by status (1=ACTIVE, 2=DEPRECATED, 3=TRANSFORMING)
versionEqualFilter by profile version
createModeEqual / createModeNotEqual / createModeIn / createModeNotInFilter by creation mode (1=API, 2=KMC, 3=APP)
createdAtGreaterThanOrEqual / createdAtLessThanOrEqualDate range filters (Unix timestamp)
updatedAtGreaterThanOrEqual / updatedAtLessThanOrEqualDate range filters (Unix timestamp)
orderBy+createdAt, -createdAt, +updatedAt, -updatedAt

Response:

{
"totalCount": 1,
"objects": [
{
"id": 12345,
"name": "Content Classification",
"systemName": "content_classification",
"metadataObjectType": 1,
"status": 1,
"version": 1,
"createMode": 1,
"objectType": "KalturaMetadataProfile"
}
],
"objectType": "KalturaMetadataProfileListResponse"
}

List Fields​

curl -X POST "$KALTURA_SERVICE_URL/service/metadata_metadataProfile/action/listFields" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "metadataProfileId=$PROFILE_ID"
ParameterTypeRequiredDescription
metadataProfileIdintegerYesProfile ID whose XSD fields to list

Returns a parsed list of field definitions from the XSD. Useful for dynamically building forms or validating metadata XML without parsing XSD yourself.

Response:

{
"totalCount": 2,
"objects": [
{"fieldName": "Department", "objectType": "KalturaMetadataProfileField"},
{"fieldName": "Project", "objectType": "KalturaMetadataProfileField"}
],
"objectType": "KalturaMetadataProfileFieldListResponse"
}

Update Profile​

curl -X POST "$KALTURA_SERVICE_URL/service/metadata_metadataProfile/action/update" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$PROFILE_ID" \
-d "metadataProfile[objectType]=KalturaMetadataProfile" \
-d "metadataProfile[description]=Updated classification schema"
ParameterTypeRequiredDescription
idintegerYesProfile ID to update
metadataProfile[objectType]stringYesAlways KalturaMetadataProfile
metadataProfile[name]stringNoUpdated name
metadataProfile[description]stringNoUpdated description
xsdDatastringNoUpdated XSD (triggers re-validation of existing metadata, increments version)

Fields not included remain unchanged. Updating the XSD triggers the server to re-validate all existing metadata instances against the new schema. Keep schema changes backward-compatible (e.g., add new optional fields, widen enumerations) to pass re-validation successfully.

Update XSD from File​

curl -X POST "$KALTURA_SERVICE_URL/service/metadata_metadataProfile/action/updateDefinitionFromFile" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$PROFILE_ID" \
-F "xsdFile=@updated_schema.xsd"
ParameterTypeRequiredDescription
idintegerYesProfile ID to update
xsdFilefileYesUpdated XSD schema file (multipart form field)

Updates the profile XSD from a file upload. Triggers re-validation and transformation of all existing metadata instances. The profile version is incremented. During transformation, the profile status transitions to TRANSFORMING (3) and returns to ACTIVE (1) when complete.

Revert Profile Version​

curl -X POST "$KALTURA_SERVICE_URL/service/metadata_metadataProfile/action/revert" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$PROFILE_ID" \
-d "toVersion=2"
ParameterTypeRequiredDescription
idintegerYesProfile ID
toVersionintegerYesVersion number to revert to

Reverts the profile XSD to a previous version. All metadata instances are also reverted and re-validated against the restored schema. The version field is incremented (revert creates a new version, not a rollback).

Serve XSD​

curl -X POST "$KALTURA_SERVICE_URL/service/metadata_metadataProfile/action/serve" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$PROFILE_ID"
ParameterTypeRequiredDescription
idintegerYesProfile ID whose XSD to serve

Returns the raw XSD content of the profile. Useful for programmatic schema validation or building dynamic forms from the schema definition.

Delete Profile​

curl -X POST "$KALTURA_SERVICE_URL/service/metadata_metadataProfile/action/delete" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$PROFILE_ID"
ParameterTypeRequiredDescription
idintegerYesProfile ID to delete

Deletes the profile and cascades to all metadata instances associated with it. This is a permanent operation — back up any needed data before deleting. Profiles of type DYNAMIC_OBJECT with active references return METADATA_PROFILE_REFERENCE_EXISTS.