# METADATA TEMPLATES Invoke the Metadata Templates API to create, read, update, and delete Metadata Templates, and to apply Metadata definition changes. A Metadata Template defines a set of Metadata Attributes that, when assigned to an Asset, become available for population on that Asset. **Admin Endpoints (NEW!):** Create, read, update, and delete Metadata Templates. These endpoints require the Metadata Management admin privilege. ## (NEW!) List Metadata Templates (Paginated) - [GET /metadata/templates](https://api.tenovos.com/openapi/v1.5/metadata-templates/listmetadatatemplates.md): Retrieve a paginated list of metadata templates for UI consumption. Supports filtering by name, pagination via offset, and sorting via query parameters. Each result includes the full template object with attributesDefaultValue, accessTemplates, an inUse flag indicating whether the template is currently assigned to any assets, and an indexStatus indicating whether the template is ready to be assigned to assets. Defaults: - includeDenormalized defaults to false. templateDenormalized is only included in each result when includeDenormalized is true. - inUse is unset by default, returning templates regardless of usage. The user submitting the request must have the Metadata Management admin privilege. ## Retrieve Metadata Templates - [GET /metadata/template](https://api.tenovos.com/openapi/v1.5/metadata-templates/getmetadatatemplates.md): Retrieve all metadata templates available to the requesting user The user submitting the request must have administrator rights to view metadata templates. Average Response Time: 492ms ## (NEW!) Create Metadata Template - [POST /metadata/template](https://api.tenovos.com/openapi/v1.5/metadata-templates/createmetadatatemplate.md): Create a new metadata template for admin use. The endpoint derives customerId from the authenticated user context, validates all referenced metadata groups and access templates, generates the denormalized template structure, and returns the created template object directly. For templates with templateType including action, template-as-asset creation is triggered asynchronously after successful template creation. Defaults: - templateType defaults to ["default"] when omitted - attributesDefaultValue defaults to [] when omitted - accessTemplates defaults to [] when omitted Validation: - All provided groupIds must exist and be valid metadata groups for the customer - All provided accessTemplates must exist and be valid access templates for the customer - The system group is automatically included if not already provided - Duplicate group IDs are deduplicated while preserving order - Duplicate effective attributes across selected groups return 400 The user submitting the request must have the Metadata Management admin privilege. ## Get Metadata Template - [GET /metadata/template/{id}](https://api.tenovos.com/openapi/v1.5/metadata-templates/getmetadatatemplate.md): "Retrieve the metadata template and its attributes list by template ID \n\nThe user submitting the request to metadata template must have the Metadata Template Management security role privilege.\n\nIn response, it will contain the metadata groups template have and each group metadata attributes list." Average Response Time: 1406ms ## (NEW!) Update Metadata Template - [PATCH /metadata/template/{id}](https://api.tenovos.com/openapi/v1.5/metadata-templates/updatemetadatatemplate.md): Partially update an existing metadata template. Only fields included in the request body will be updated — omitted fields remain unchanged. Updatable Fields: name, groupIds, attributesDefaultValue, accessTemplates, templateOverride Fields that cannot be updated: templateId, customerId, createdBy, createdEpoch, createdDate, templateType, templateDenormalized, dependencies Key Business Rules: - Request body must contain at least one updatable field - Unknown or immutable fields are rejected with 400 - name must be unique per customer (case-insensitive) — duplicate returns 409 - groupIds must reference existing groups; system group is auto-appended last - Duplicate effective attributes across groups return 400 - accessTemplates must reference existing access templates; can be cleared with [] - attributesDefaultValue keys must exist in the effective template - templateDenormalized is regenerated on every successful update The user submitting the request must have the Metadata Management admin privilege. ## (NEW!) Delete Metadata Template - [DELETE /metadata/template/{id}](https://api.tenovos.com/openapi/v1.5/metadata-templates/deletemetadatatemplate.md): Permanently delete a metadata template by its ID. Deletion is blocked if the template has dependencies (e.g., assets using this template). Delete Rules: - Template must exist for the authenticated customer - Template ID must be a valid UUID - Template type must be one of default, asset, or action - Template cannot be deleted if it has dependencies (assets using it) - Related asset records are cleaned up - Deletion is recorded in tenovos_delete_history This action is permanent and cannot be undone. The user submitting the request must have the Metadata Management admin privilege. ## Apply Metadata Definition Changes - [POST /metadata/apply](https://api.tenovos.com/openapi/v1.5/metadata-templates/applymetadatachanges.md): Apply the metadata definition changes. Use this operation after making any modification in metadata. In response, it will contain the object of metadata definition attributes like id, name, type and search fields etc. Average Response Time: 53ms