# (NEW!) Create Metadata Template 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. Endpoint: POST /metadata/template Version: 1.5 Security: ApiKeyAuth, BasicAuth ## Header parameters: - `Authorization` (string, required) Bearer token from authentication. - `X-API-Key` (string) Customer-specific API key (optional). - `Content-Type` (string, required) Enum: "application/json" ## Request fields (application/json): - `name` (string, required) Display name of the metadata template. Example: "Product Content" - `groupIds` (array, required) Ordered list of metadata group IDs to include in the template. Example: ["52ce0235-02cc-46f6-8bdb-05238c76bf83"] - `templateType` (array) Template type list. Defaults to ["default"]. Enum: "default", "asset", "action" - `attributesDefaultValue` (array) Default metadata values for fields in the template. Example: [{"searchField":"title","value":"Test Asset"}] - `attributesDefaultValue.searchField` (string) The searchField of the attribute to set a default for. - `attributesDefaultValue.value` (any) The default value. Type varies by attribute type (string, array, etc). - `accessTemplates` (array) Access template IDs (security templates) associated to the template. Defaults to []. Example: ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"] ## Response 200 fields (application/json): - `templateId` (string) - `name` (string) - `customerId` (string) - `createdBy` (string) - `createdEpoch` (integer) - `createdDate` (string) - `lastUpdatedBy` (string) - `lastUpdatedEpoch` (integer) - `lastUpdatedDate` (string) - `groupIds` (array) - `templateType` (array) - `attributesDefaultValue` (array) - `attributesDefaultValue.searchField` (string) - `attributesDefaultValue.value` (any) Default value for the attribute. - `accessTemplates` (array) - `templateDenormalized` (object) System-generated denormalized template structure including resolved metadataGroups. ## Response 400 fields (application/json): - `message` (string) - `detail` (string) ## Response 401 fields (application/json): - `message` (string) - `detail` (string) ## Response 403 fields (application/json): - `message` (string) - `detail` (string) ## Response 409 fields (application/json): - `message` (string) - `detail` (string)